-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cross compiling: Add build scripts for OSX/WIN/GNU using docker
- Loading branch information
Showing
4 changed files
with
104 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| CPUS=${CPUS:-4} | ||
| TRAVIS_TAG=${TRAVIS_TAG:-} | ||
|
|
||
| rm -fr bin linux osx win32 win64 | ||
|
|
||
| # GNU/Linux | ||
| export CC=gcc-4.8 | ||
| export CXX=g++-4.8 | ||
| export AR=ar | ||
| export CXXFLAGS= | ||
| export CFLAGS= | ||
| export LDFLAGS= | ||
| make clean | ||
| rm -fr bin | ||
| mkdir bin | ||
| make -j${CPUS} LINUX=true | ||
| mv bin linux | ||
|
|
||
| # OSX | ||
| mkdir bin | ||
| export CC=i686-apple-darwin10-gcc | ||
| export CXX=i686-apple-darwin10-g++ | ||
| export AR=i686-apple-darwin10-ar | ||
| export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig | ||
| export CXXFLAGS="-I/opt/local/include" | ||
| export CFLAGS="-I/opt/local/include" | ||
| make clean | ||
| touch dpf/utils/lv2_ttl_generator | ||
| chmod a+x dpf/utils/lv2_ttl_generator | ||
| make MACOS=true MACOS_OLD=true -j${CPUS} | ||
| mv bin osx | ||
|
|
||
| # WIN32 | ||
| mkdir bin | ||
| export PATH=$PATH:/opt/mingw64/bin | ||
| export CXXFLAGS="-m32 -I/opt/mingw64/x86_64-w64-mingw32/include -I/opt/mingw64/include" | ||
| export CFLAGS="-m32 -I/opt/mingw64/x86_64-w64-mingw32/include -I/opt/mingw64/include" | ||
| export LDFLAGS=-m32 | ||
| export PKG_CONFIG_PATH=/opt/mingw64/lib32/pkgconfig | ||
| export CC=x86_64-w64-mingw32-gcc | ||
| export CXX=x86_64-w64-mingw32-g++ | ||
| export AR=x86_64-w64-mingw32-ar | ||
| make clean | ||
| touch dpf/utils/lv2_ttl_generator.exe | ||
| chmod a+x dpf/utils/lv2_ttl_generator.exe | ||
| make WIN32=true -j${CPUS} | ||
| mv bin win32 | ||
|
|
||
| # WIN64 | ||
| mkdir bin | ||
| export CXXFLAGS="-I/opt/mingw64/x86_64-w64-mingw32/include -I/opt/mingw64/include" | ||
| export CFLAGS="-I/opt/mingw64/x86_64-w64-mingw32/include -I/opt/mingw64/include" | ||
| export LDFLAGS= | ||
| export PKG_CONFIG_PATH=/opt/mingw64/lib/pkgconfig | ||
| make clean | ||
| touch dpf/utils/lv2_ttl_generator.exe | ||
| chmod a+x dpf/utils/lv2_ttl_generator.exe | ||
| make WIN32=true -j${CPUS} | ||
| mv bin win64 | ||
|
|
||
| # Metadata for LV2 | ||
| mkdir bin | ||
| cd linux | ||
| for f in *.lv2; do cd $f; cp *.ttl ../../osx/$f/ ; cd .. ; done | ||
| for f in *.lv2; do cd $f; cp *.ttl ../../win32/$f/ ; cd .. ; done | ||
| for f in *.lv2; do cd $f; cp *.ttl ../../win64/$f/ ; cd .. ; done | ||
| cd ../osx | ||
| for f in *.lv2; do cd $f; perl -pi -e 's/\.so/\.dylib/g' manifest.ttl; perl -pi -e 's/X11UI/CocoaUI/g' manifest.ttl; cd .. ; done | ||
| cd ../win32 | ||
| for f in *.lv2; do cd $f; perl -pi -e 's/\.so/\.dll/g' manifest.ttl; perl -pi -e 's/X11UI/WindowsUI/g' manifest.ttl; cd .. ; done | ||
| cd ../win64 | ||
| for f in *.lv2; do cd $f; perl -pi -e 's/\.so/\.dll/g' manifest.ttl; perl -pi -e 's/X11UI/WindowsUI/g' manifest.ttl; cd .. ; done | ||
|
|
||
| # Release | ||
| cd ../linux | ||
| zip -9 -r zam-plugins-$TRAVIS_TAG-linuxlv2.zip *.lv2 | ||
| mv *.zip ../bin | ||
| cd ../osx | ||
| zip -9 -r zam-plugins-$TRAVIS_TAG-osxlv2.zip *.lv2 | ||
| mv *.zip ../bin | ||
| cd ../win32 | ||
| zip -9 -r zam-plugins-$TRAVIS_TAG-win32lv2.zip *.lv2 | ||
| mv *.zip ../bin | ||
| cd ../win64 | ||
| zip -9 -r zam-plugins-$TRAVIS_TAG-win64lv2.zip *.lv2 | ||
| mv *.zip ../bin | ||
| cd ../bin | ||
| ls -l | ||
| echo "ALL DONE!!!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| docker build . -t zam-plugins-build:latest | ||
| docker run -v `pwd`:/tmp/build --entrypoint "/bin/bash" zam-plugins-build:latest -c "cd /tmp/build; bash docker-script" |