diff --git a/.travis/appveyor-deploy.ps1 b/.travis/appveyor-deploy.ps1 new file mode 100644 index 000000000..4927a8aa5 --- /dev/null +++ b/.travis/appveyor-deploy.ps1 @@ -0,0 +1,5 @@ +$filename = "qb64_" + (get-date -uformat "%Y-%m-%d-%H-%M-%S") + "_" + $Env:APPVEYOR_REPO_COMMIT.Substring(0,7) + "-" + $Env:APPVEYOR_REPO_BRANCH + "_win_" + $Env:PLATFORM + ".7z" +cd .. +7z a '-xr@qb64\.travis\common-exclusion.list' '-xr@qb64\.travis\win-exclusion.list' $filename qb64 + +scp -q -o StrictHostKeyChecking=no $filename m6rosupy1q2t@qb64.org:autobuilds/$Env:APPVEYOR_REPO_BRANCH/ diff --git a/.travis/appveyor-qb64.org_rsa.enc b/.travis/appveyor-qb64.org_rsa.enc new file mode 100644 index 000000000..4be36b374 Binary files /dev/null and b/.travis/appveyor-qb64.org_rsa.enc differ diff --git a/.travis/appveyor.bat b/.travis/appveyor.bat new file mode 100644 index 000000000..3723abeb6 --- /dev/null +++ b/.travis/appveyor.bat @@ -0,0 +1,59 @@ +SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION +del /q /s internal\c\libqb\*.o >nul 2>nul +del /q /s internal\c\libqb\*.a >nul 2>nul +del /q /s internal\c\parts\*.o >nul 2>nul +del /q /s internal\c\parts\*.a >nul 2>nul +del /q /s internal\temp\*.* >nul 2>nul + +cd internal\c +set MINGW=mingw32 +IF "%PLATFORM%"=="x64" set MINGW=mingw64 +ren %MINGW% c_compiler +cd ../.. + +echo Building library 'LibQB' +cd internal\c\libqb\os\win +call setup_build.bat +IF ERRORLEVEL 1 exit /b 1 + +cd ..\..\..\..\.. + +echo Building library 'FreeType' +cd internal\c\parts\video\font\ttf\os\win +call setup_build.bat +IF ERRORLEVEL 1 exit /b 1 + +cd ..\..\..\..\..\..\..\.. + +echo Building library 'Core:FreeGLUT' +cd internal\c\parts\core\os\win +call setup_build.bat +IF ERRORLEVEL 1 exit /b 1 + +cd ..\..\..\..\..\.. + +echo Bootstrapping QB64 +copy internal\source\*.* internal\temp\ >nul +copy source\qb64.ico internal\temp\ >nul +copy source\icon.rc internal\temp\ >nul +cd internal\c +c_compiler\bin\windres.exe -i ..\temp\icon.rc -o ..\temp\icon.o +c_compiler\bin\g++ -mconsole -s -Wfatal-errors -w -Wall qbx.cpp libqb\os\win\libqb_setup.o ..\temp\icon.o -D DEPENDENCY_LOADFONT parts\video\font\ttf\os\win\src.o -D DEPENDENCY_SOCKETS -D DEPENDENCY_NO_PRINTER -D DEPENDENCY_ICON -D DEPENDENCY_NO_SCREENIMAGE parts\core\os\win\src.a -lopengl32 -lglu32 -mwindows -static-libgcc -static-libstdc++ -D GLEW_STATIC -D FREEGLUT_STATIC -lws2_32 -lwinmm -lgdi32 -o "..\..\qb64_bootstrap.exe" +IF ERRORLEVEL 1 exit /b 1 +cd ..\.. + +echo Compiling new QB64 +echo From git %APPVEYOR_REPO_COMMIT:~0,7% > internal\version.txt +qb64_bootstrap.exe -x source\qb64.bas -o qb64.exe +IF ERRORLEVEL 1 exit /b 1 + +del qb64_bootstrap.exe +del /q /s secure-file +del /q /s internal\source\* +move internal\temp\* internal\source\ +del /q /s internal\c\libqb\*.o >nul 2>nul +del /q /s internal\c\libqb\*.a >nul 2>nul +del /q /s internal\c\parts\*.o >nul 2>nul +del /q /s internal\c\parts\*.a >nul 2>nul +cd internal\source +del /q /s debug_* recompile_* diff --git a/.travis/build-osx.sh b/.travis/build-osx.sh new file mode 100644 index 000000000..71b4f3b80 --- /dev/null +++ b/.travis/build-osx.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +g++ --version + +###### 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 "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 "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 -lcurses -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 "Translating .bas source..." +echo From git `echo $TRAVIS_COMMIT | sed 's/\(.......\).*$/\1/'` > internal/version.txt +./qb64_bootstrap -x -z source/qb64.bas > /tmp/qb64-output +rm qb64_bootstrap +if [ `grep -v '^WARNING' /tmp/qb64-output | wc -l` -gt 2 ]; then + cat /tmp/qb64-output + rm /tmp/qb64-output + exit 1 +fi +echo "Done" + +echo "Testing compile/link..." +# extract g++ line +cd internal/temp/ +cpp_call=`awk '$1=="g++" {print $0}' < recompile_osx.command` + +# 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 diff --git a/.travis/build.sh b/.travis/build.sh new file mode 100644 index 000000000..b4a0f0175 --- /dev/null +++ b/.travis/build.sh @@ -0,0 +1,75 @@ +#!/bin/bash +if [ "$TRAVIS_OS_NAME" = "osx" ]; then exec .travis/build-osx.sh; fi + +###### Part 1: Build old QB64 ###### +echo "Preparing bootstrap:" +find . -type f -iname "*.sh" -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/lnx + echo -n "Building $2..." + ./setup_build.sh + 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" +com_build "parts/core" "FreeGLUT" + +cp -r internal/source/* internal/temp/ +cd internal/c +echo -n "Bootstrapping QB64..." +g++ $NOPIE -w qbx.cpp libqb/os/lnx/libqb_setup.o parts/video/font/ttf/os/lnx/src.o parts/core/os/lnx/src.a -lGL -lGLU -lX11 -lcurses -lpthread -ldl -lrt -D FREEGLUT_STATIC -DDEPENDENCY_USER_MODS -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 From git `echo $TRAVIS_COMMIT | sed 's/\(.......\).*$/\1/'` > internal/version.txt +./qb64_bootstrap -x -z source/qb64.bas > /tmp/qb64-output +rm qb64_bootstrap +if [ `grep -v '^WARNING' /tmp/qb64-output | wc -l` -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` +echo $cpp_call + +# run g++ +cd ../c/ +${cpp_call/-no-pie/} -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" +if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit; fi + +###### Part 3: Establish new bootstrapee ###### +rm internal/source/* +mv internal/temp/* internal/source/ +find . -type f -iname "*.a" -exec rm {} \; +find . -type f -iname "*.o" -exec rm {} \; +cd internal/source +rm debug_* recompile_* diff --git a/.travis/common-exclusion.list b/.travis/common-exclusion.list new file mode 100644 index 000000000..aca915c52 --- /dev/null +++ b/.travis/common-exclusion.list @@ -0,0 +1,9 @@ +.travis +.travis.yml +appveyor.yml +.git +.gitignore +setup_win.bat +qb64/internal/c/mingw32 +qb64/internal/c/mingw64 +autosync.sh diff --git a/.travis/deploy.sh b/.travis/deploy.sh new file mode 100644 index 000000000..371460dab --- /dev/null +++ b/.travis/deploy.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +if [ "$TRAVIS_OS_NAME" != "linux" ]; then exit; fi + +# Prepare archives +# mainversion=`awk '$1=="Version$" {split($3, A, /\"/);print A[2];}' < source/global/version.bas` +# buildnum=`awk '$1=="BuildNum$" {split($3,A, /[\"\/]/); print A[3];}' < source/global/version.bas` +TZ=UTC now=`date +"%F-%H-%M-%S"` +filebase="/tmp/qb64_${now}_`echo ${TRAVIS_COMMIT} | sed 's/\(.......\).*$/\1/'`-${TRAVIS_BRANCH}" +rm -r .dpl + +cd .. +tar --create --auto-compress --file ${filebase}_osx.tar.gz --exclude-from=qb64/.travis/common-exclusion.list --exclude-from=qb64/.travis/osx-exclusion.list qb64 +tar --create --auto-compress --file ${filebase}_lnx.tar.gz --exclude-from=qb64/.travis/common-exclusion.list --exclude-from=qb64/.travis/lnx-exclusion.list qb64 +#7z a -xr@qb64/.travis/common-exclusion.list -xr@qb64/.travis/win-exclusion.list ${filebase}_win.7z qb64/ > /dev/null + +# Send to server +# Sometimes the connection can be a bit flakey, so try multiple times on error +for i in `seq 1 10` +do scp ${filebase}_* m6rosupy1q2t@qb64.org:autobuilds/${TRAVIS_BRANCH}/ + if [ "$?" -eq 0 ] + then exit 0 + fi + echo scp failed +done + diff --git a/.travis/lnx-exclusion.list b/.travis/lnx-exclusion.list new file mode 100644 index 000000000..16a8f91df --- /dev/null +++ b/.travis/lnx-exclusion.list @@ -0,0 +1,3 @@ +setup_osx.command +internal/c/c_compiler +qb64_start_osx.command diff --git a/.travis/osx-exclusion.list b/.travis/osx-exclusion.list new file mode 100644 index 000000000..d21078fd7 --- /dev/null +++ b/.travis/osx-exclusion.list @@ -0,0 +1,2 @@ +setup_lnx.sh +internal/c/c_compiler diff --git a/.travis/push.sh b/.travis/push.sh new file mode 100644 index 000000000..ff6cd7023 --- /dev/null +++ b/.travis/push.sh @@ -0,0 +1,14 @@ +#!/bin/sh +if [ "$TRAVIS_OS_NAME" != "linux" ]; then exit; fi +if [ "${UPDATE_REPO}" != "yes" ]; then exit; fi +git config --global user.email "flukiluke@gmail.com" +git config --global user.name "Autobuild process" +git clone --depth=1 --branch=$TRAVIS_BRANCH https://${GH_TOKEN}@github.com/Galleondragon/qb64.git homeqb64 +cd homeqb64 +rm -r internal/source +cp -r ../internal/source internal/source +git add --all internal/source +git commit --message "Autobuild update [ci skip]" +git push +cd .. +rm -rf homeqb64 diff --git a/.travis/travis-qb64.org_rsa.enc b/.travis/travis-qb64.org_rsa.enc new file mode 100644 index 000000000..146ccb813 Binary files /dev/null and b/.travis/travis-qb64.org_rsa.enc differ diff --git a/.travis/win-exclusion.list b/.travis/win-exclusion.list new file mode 100644 index 000000000..6d4e4f388 --- /dev/null +++ b/.travis/win-exclusion.list @@ -0,0 +1,4 @@ +setup_lnx.sh +setup_osx.command +qb64_start_osx.command +secure-file