Travis changes for Xonotic:
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 11 Jan 2017 21:50:45 +0000 (21:50 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 11 Jan 2017 21:50:45 +0000 (21:50 +0000)
- Do not require root any more.
- Change the i386 build to build on Ubuntu directly, not in a chroot created using debootstrap.
- Remove the -isysroot option for OS X as the path broke after some Travis change.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12321 d7cf8633-e32d-0410-b094-e92efae38249

.travis-before_install-xonotic.sh
.travis-script-xonotic.sh
.travis.yml

index 5ed56f8..5b03c09 100755 (executable)
@@ -2,9 +2,8 @@
 
 set -ex
 
-if [ "`uname`" = 'Linux' ]; then
-  sudo apt-get update -qq
-fi
+export USRLOCAL="$PWD"/usrlocal
+mkdir "$USRLOCAL"
 
 for os in "$@"; do
   git archive --format=tar --remote=git://de.git.xonotic.org/xonotic/xonotic.git \
@@ -12,50 +11,37 @@ for os in "$@"; do
 
   case "$os" in
     linux32)
-      # Prepare an i386 chroot. This is required as we otherwise can't install
-      # our dependencies to be able to compile a 32bit binary. Ubuntu...
-      chroot="$PWD"/buildroot.i386
-      mkdir -p "$chroot$PWD"
-      sudo apt-get install -y debootstrap
-      sudo i386 debootstrap --arch=i386 precise "$chroot"
-      sudo mount --rbind "$PWD" "$chroot$PWD"
-      sudo i386 chroot "$chroot" apt-get install -y \
-        build-essential
-      # Now install our dependencies.
-      sudo i386 chroot "$chroot" apt-get install -y \
-        libxpm-dev libsdl1.2-dev libxxf86vm-dev
       wget https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
       tar xf SDL2-2.0.4.tar.gz
       (
       cd SDL2-2.0.4
-      sudo i386 chroot "$chroot" sh -c "cd $PWD && ./configure --enable-static --disable-shared"
-      sudo i386 chroot "$chroot" make -C "$PWD"
-      sudo i386 chroot "$chroot" make -C "$PWD" install
+      export CC="gcc -m32"
+      i386 ./configure --enable-static --disable-shared --prefix="$USRLOCAL" || cat config.log
+      i386 make
+      i386 make install
       )
       ;;
     linux64)
-      sudo apt-get install -y \
-        libxpm-dev libsdl1.2-dev libxxf86vm-dev
       wget https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
       tar xf SDL2-2.0.4.tar.gz
       (
       cd SDL2-2.0.4
-      ./configure --enable-static --disable-shared
+      ./configure --enable-static --disable-shared --prefix="$USRLOCAL"
       make
-      sudo make install
+      make install
       )
       ;;
     win32)
       git archive --format=tar --remote=git://de.git.xonotic.org/xonotic/xonotic.git \
         --prefix=".icons/" master:"misc/logos/icons_ico" | tar xvf -
       mv .icons/xonotic.ico darkplaces.ico
-      wget -qO- http://beta.xonotic.org/win-builds.org/cross_toolchain_32.tar.xz | sudo tar xaJvf - -C/ opt/cross_toolchain_32
+      wget -qO- http://beta.xonotic.org/win-builds.org/cross_toolchain_32.tar.xz | tar xaJvf - -C"$USRLOCAL" opt/cross_toolchain_32
       ;;
     win64)
       git archive --format=tar --remote=git://de.git.xonotic.org/xonotic/xonotic.git \
         --prefix=".icons/" master:"misc/logos/icons_ico" | tar xvf -
       mv .icons/xonotic.ico darkplaces.ico
-      wget -qO- http://beta.xonotic.org/win-builds.org/cross_toolchain_64.tar.xz | sudo tar xvJf - -C/ opt/cross_toolchain_64
+      wget -qO- http://beta.xonotic.org/win-builds.org/cross_toolchain_64.tar.xz | tar xvJf - -C"$USRLOCAL" opt/cross_toolchain_64
       ;;
     osx)
       git archive --format=tar --remote=git://de.git.xonotic.org/xonotic/xonotic.git \
index c8e2b8b..9b77373 100755 (executable)
@@ -9,6 +9,8 @@ set -x
 chmod 0600 id_rsa-xonotic
 # ssh-keygen -y -f id_rsa-xonotic
 
+export USRLOCAL="$PWD"/usrlocal
+
 rev=`git rev-parse HEAD`
 
 sftp -oStrictHostKeyChecking=no -i id_rsa-xonotic -P 2222 -b - autobuild-bin-uploader@beta.xonotic.org <<EOF || true
@@ -20,10 +22,10 @@ for os in "$@"; do
   deps=".deps/${os}"
   case "${os}" in
     linux32)
-      chroot="sudo chroot ${PWD}/buildroot.i386"
+      chroot=
       makeflags='STRIP=:
         CC="${CC} -m32 -march=i686 -g1 -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
-        SDL_CONFIG=sdl2-config
+        SDL_CONFIG=$USRLOCAL/bin/sdl2-config
         DP_LINK_CRYPTO=shared
           LIB_CRYPTO="../../../${deps}/lib/libd0_blind_id.a ../../../${deps}/lib/libgmp.a"
         DP_LINK_CRYPTO_RIJNDAEL=dlopen
@@ -40,7 +42,7 @@ for os in "$@"; do
       chroot=
       makeflags='STRIP=:
         CC="${CC} -m64 -g1 -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
-        SDL_CONFIG=sdl2-config
+        SDL_CONFIG=$USRLOCAL/bin/sdl2-config
         DP_LINK_CRYPTO=shared
           LIB_CRYPTO="../../../${deps}/lib/libd0_blind_id.a ../../../${deps}/lib/libgmp.a"
         DP_LINK_CRYPTO_RIJNDAEL=dlopen
@@ -54,16 +56,17 @@ for os in "$@"; do
       outputs='darkplaces-glx:darkplaces-linux64-glx darkplaces-sdl:darkplaces-linux64-sdl darkplaces-dedicated:darkplaces-linux64-dedicated'
       ;;
     win32)
-      # Need to use -mstackrealign as nothing guarantees that callbacks from
       # other Win32 DLLs - including SDL2 - retain 16 bytes alignment.
+      export LD_LIBRARY_PATH="$USRLOCAL/opt/cross_toolchain_32/x86_64-slackware-linux/i686-w64-mingw32/lib:$USRLOCAL/opt/cross_toolchain_32/libexec/gcc/i686-w64-mingw32/4.8.3"
       chroot=
+      # Need to use -mstackrealign as nothing guarantees that callbacks from
       makeflags='STRIP=:
         D3D=1
         DP_MAKE_TARGET=mingw
         UNAME=MINGW32
         WIN32RELEASE=1
-        CC="/opt/cross_toolchain_32/bin/i686-w64-mingw32-gcc -static -g1 -mstackrealign -Wl,--dynamicbase -Wl,--nxcompat -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
-        WINDRES="/opt/cross_toolchain_32/bin/i686-w64-mingw32-windres"
+        CC="$USRLOCAL/opt/cross_toolchain_32/bin/i686-w64-mingw32-gcc -static -g1 -mstackrealign -Wl,--dynamicbase -Wl,--nxcompat -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
+        WINDRES="$USRLOCAL/opt/cross_toolchain_32/bin/i686-w64-mingw32-windres"
         SDL_CONFIG="../../../${deps}/bin/sdl2-config"
         DP_LINK_CRYPTO=dlopen
         DP_LINK_CRYPTO_RIJNDAEL=dlopen
@@ -74,14 +77,15 @@ for os in "$@"; do
       outputs='darkplaces.exe:darkplaces-x86-wgl.exe darkplaces-sdl.exe:darkplaces-x86.exe darkplaces-dedicated.exe:darkplaces-x86-dedicated.exe'
       ;;
     win64)
+      export LD_LIBRARY_PATH="$USRLOCAL/opt/cross_toolchain_64/x86_64-slackware-linux/x86_64-w64-mingw32/lib:$USRLOCAL/opt/cross_toolchain_64/libexec/gcc/x86_64-w64-mingw32/4.8.3"
       chroot=
       makeflags='STRIP=:
         D3D=1
         DP_MAKE_TARGET=mingw
         UNAME=MINGW32
         WIN64RELEASE=1
-        CC="/opt/cross_toolchain_64/bin/x86_64-w64-mingw32-gcc -static -g1 -Wl,--dynamicbase -Wl,--nxcompat -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
-        WINDRES="/opt/cross_toolchain_64/bin/x86_64-w64-mingw32-windres"
+        CC="$USRLOCAL/opt/cross_toolchain_64/bin/x86_64-w64-mingw32-gcc -static -g1 -Wl,--dynamicbase -Wl,--nxcompat -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
+        WINDRES="$USRLOCAL/opt/cross_toolchain_64/bin/x86_64-w64-mingw32-windres"
         SDL_CONFIG="../../../${deps}/bin/sdl2-config"
         DP_LINK_CRYPTO=dlopen
         DP_LINK_CRYPTO_RIJNDAEL=dlopen
@@ -94,7 +98,7 @@ for os in "$@"; do
     osx)
       chroot=
       makeflags='STRIP=:
-        CC="gcc -g1 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.5 -Wl,-rpath -Wl,@loader_path/../Frameworks -Wl,-rpath -Wl,@loader_path -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
+        CC="gcc -g1 -arch x86_64 -mmacosx-version-min=10.5 -Wl,-rpath -Wl,@loader_path/../Frameworks -Wl,-rpath -Wl,@loader_path -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
         SDLCONFIG_MACOSXCFLAGS="-I${PWD}/SDL2.framework/Headers"
         SDLCONFIG_MACOSXLIBS="-F${PWD} -framework SDL2 -framework Cocoa -I${PWD}/SDL2.framework/Headers"
         SDLCONFIG_MACOSXSTATICLIBS="-F${PWD} -framework SDL2 -framework Cocoa -I${PWD}/SDL2.framework/Headers"
index e6dfe43..260c867 100644 (file)
@@ -4,15 +4,39 @@ matrix:
   - os: linux
     env: PROJECT=xonotic OS="linux32"
     compiler: gcc
+    sudo: false
+    addons:
+      apt:
+        packages:
+          - libxpm-dev:i386
+          - libsdl1.2-dev:i386
+          - libxxf86vm-dev:i386
+          - gcc-multilib
+          - g++-multilib
+          # Workaround packages to install to fix dependency hell.
+          - libglu1-mesa-dev:i386
+          - libcaca-dev:i386
+          - libxext-dev:i386
+          - libslang2-dev:i386
+          - libpng-dev:i386
   - os: linux
     env: PROJECT=xonotic OS="linux64"
     compiler: gcc
+    sudo: false
+    addons:
+      apt:
+        packages:
+          - libxpm-dev
+          - libsdl1.2-dev
+          - libxxf86vm-dev
   - os: linux
     env: PROJECT=xonotic OS="win32"
     compiler: gcc
+    sudo: false
   - os: linux
     env: PROJECT=xonotic OS="win64"
     compiler: gcc
+    sudo: false
   - os: osx
     env: PROJECT=xonotic OS="osx"
     compiler: gcc