crossbuild
crossbuild copied to clipboard
How to install project specific libraries for multiple platforms required for compiling?
First let me say GREAT! Exactly what I need for my project (I have to supply binaries for "normal" users for Linux/OSX/Windows). I also plan to use this as a CI build env.
Now my question: I need some libraries in order to compile my project (e.g. libusb, ncurses). Usually I use packet manager on the real platforms to install them (apt-get for Linux, brew for OSX and pacman for MSYS2-MinGW/Windows).
Do you have an idea / suggestion how to install (automated or manually) the different platform specific libraries?
Thanks,
Maik
Hi @stohn, interesting questions!
First ideas:
-
by mounting the local
/usr/libin the container usingdocker -v; Overriding the container's/usr/libis a bad idea, so maybe we can mount it elsewhere and configurelddto look at this path. I like this idea, it's very easy to automate, but it will probably only works for Linux -
by inheriting the Docker image and apt-get install the missing libraries
FROM multiarch/crossbuild RUN apt-get install toto-dev
Is your project open-source ? I would love to try to fix this issue against a real library-based project in Linux, OSX and Windows
Yes project is open source. I had to change my github account recently and now having 2 both connected to other projects. So sometimes using old one by accident.
The project is here: http://github.com/MaikStohn/UP3D
It's just at the begin so any change can be made easily.
Ok perfect, can you give me instructions to get/install libraries for each architectures ? Do not worry about the Docker part, just instructions/url for one of the projects of your repo; Thanks!
The relevant parts of the project for now are: "UP3DTRANSCODE" (no dependencies) and "UP3DTOOLS" (requires libusb / ncurses)
Inside of each directory is a small "make.sh" which already handles all platform specific stuff.
-> All resulting apps are console based apps.
For library installation a made a small note in the appropriate "make.sh" in the directories. Here my full notes for compilation on each platform:
Linux (debian/ubuntu):
apt-get install gcc
apt-get install libusb-1.0.0-dev
apt-get install libncurses5-dev
- compile using the appropriate "make.sh"
OSX:
- install homebrew ( http://brew.sh )
- use "brew" to install the required libraries:
brew install pkg-config
brew install libusb
brew install homebrew/dupes/ncurses
- compile using the appropriate "make.sh"
Windows:
- install msys2 (which also brings mingw + pacman package manager)
- open msys2 shell and use pacman to install
pacman -S mingw32/mingw-w64-i686-gcc
pacman -S mingw32/mingw-w64-i686-libusb
pacman -S mingw32/mingw-w64-i686-ncurses
- then close msys2 shell and open mingw32 shell to compile using the "make.sh"
EDIT: corrected / add more details to package manager instructions
I guess I need exactly this functionality for, in my case, zlib. Are there instructions for this now since it is labeled ready?
Any progress on this?