1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-05 08:50:25 +00:00

Add OSX to travis builds

This commit is contained in:
Luke Ceddia 2018-01-11 20:54:21 +11:00
parent c23b60707b
commit d9f17b3ccf
3 changed files with 72 additions and 0 deletions

View file

@ -3,6 +3,13 @@ install: true
script: ".travis/build.sh"
after_success: ".travis/push.sh"
matrix:
include:
- os: linux
compiler: gcc
- os: osx
compiler: clang
env:
global:
secure: rKip7kNIauH6epfanefLLqsiOKNScBf3U8uCnyMCg2SNjMxdxwrL2CPBjZeD2JKWc9DgLZ8H8hlX4wcx+P0741myfOvn0pvtHH8pmt8e6lLvNJn6okJxYXmgmu+M7/jjQkzjVYFy0i779LL/+VKItnRpJ1vcpBOA+zgreaR0o2nBL6kBWW+9jPypcfatSqY+Oxur1C6m27rRYw1PJAA4oiVim50uzhm5AGJdOL6Xw1rrJjNe5OLdQOdU0JKVI8mkZi3XTuz8t7CViKsjfimZ59Rre6qF3vTp1x8g2cm11Ki2RJlfxBK/vicCRtHVsD33r5wtmBW8YyZvVBM0sF+lYCOUn28qCCZNtPJ8kvMMEqLxLV6nbF660k9Y6i4tVKtuhJAGrFSkcfdslp0egT09DeJyO+ZdDkad7gGsMdoRhjWHkznJ+HF1IOopy8kUp7NfmmX6wKJN79GuZ+ZI0CqSObRSCOZtGa6qggHDhYvz8MOVAhyt1OQ6kqXPilKfysV6aK4eVYw2QGCkFfnCJYq6AZBqfFDyj/+M1SfG+RnHEvfX/BZMvzRDzVR8m0S7oc9M5yIh/nTSSzdRNQq+d7Mu8vNTW+Fari2ojpe6M9roIWTIaneu5goBOM6n0TaZA8OIsZS/iRYXZ6gsocgIeKyXSLadlUOLe4bwu5jR7sB1r58=

64
.travis/build-osx.sh Executable file
View file

@ -0,0 +1,64 @@
#!/bin/sh
###### Part 1: Build old QB64 ######
echo "Preparing bootstrap:"
find . -type f -iname "*.command" -exec chmod +x {} \;
find . -type f -iname "*.a" -exec rm {} \;
find . -type f -iname "*.o" -exec rm {} \;
rm internal/temp/* 2> /dev/null
com_build() {
cd internal/c/$1/os/osx
echo -n "Building $2..."
./setup_build.command
if [ $? -ne 0 ]; then
echo "$2 build failed."
exit 1
fi
echo "Done"
cd - > /dev/null
}
com_build "libqb" "libQB"
com_build "parts/video/font/ttf" "FreeType"
cp -r internal/source/* internal/temp/
cd internal/c
echo -n "Bootstrapping QB64..."
g++ -w qbx.cpp libqb/os/osx/libqb_setup.o parts/video/font/ttf/os/osx/src.o -framework GLUT -framework OpenGL -framework Cocoa -o ../../qb64_bootstrap
if [ $? -ne 0 ]; then
echo "QB64 bootstrap failed"
exit 1
fi
echo "Done"
cd - > /dev/null
###### Part 2: Build new QB64 from .bas sources ######
echo -n "Translating .bas source..."
echo AutoBuildMsg\$ = CHR\$\(10\) + \"From git `echo $TRAVIS_COMMIT | sed 's/\(.......\).*$/\1/'`\" >> source/global/version.bas
./qb64_bootstrap -x -z source/qb64.bas > /tmp/qb64-output
rm qb64_bootstrap
if [ `wc -l /tmp/qb64-output |awk '{print $1}'` -gt 2 ]; then
cat /tmp/qb64-output
rm /tmp/qb64-output
exit 1
fi
echo "Done"
echo -n "Testing compile/link..."
# extract g++ line
cd internal/temp/
cpp_call=`awk '$1=="g++" {print $0}' < recompile_lnx.sh`
# run g++
cd ../c/
$cpp_call -o ../../qb64_testrun
if [ $? -ne 0 -o ! -f ../../qb64_testrun ]; then
echo "Compile/link test failed"
exit 1
fi
cd ../../
rm qb64_testrun
echo "Done"
exit

View file

@ -1,4 +1,5 @@
#!/bin/sh
if [ "$TRAVIS_OS_NAME" = "osx" ]; then exec .travis/build-osx.sh; fi
###### Part 1: Build old QB64 ######
echo "Preparing bootstrap:"