]> git.xonotic.org Git - xonotic/darkplaces.git/blob - .travis-script-xonotic.sh
Statically link to libjpeg again on Linux. Damn jpeg8 vs jpeg62 still...
[xonotic/darkplaces.git] / .travis-script-xonotic.sh
1 #!/bin/sh
2
3 set -e
4
5 openssl aes-256-cbc -K $encrypted_eeb6f7a14a8e_key -iv $encrypted_eeb6f7a14a8e_iv -in .travis-id_rsa-xonotic -out id_rsa-xonotic -d
6
7 set -x
8
9 chmod 0600 id_rsa-xonotic
10 # ssh-keygen -y -f id_rsa-xonotic
11
12 rev=`git rev-parse HEAD`
13
14 sftp -oStrictHostKeyChecking=no -i id_rsa-xonotic -P 2222 -b - autobuild-bin-uploader@beta.xonotic.org <<EOF || true
15 mkdir ${rev}
16 EOF
17
18 for os in "$@"; do
19
20   deps=".deps/${os}"
21   case "${os}" in
22     linux32)
23       chroot="sudo chroot ${PWD}/buildroot.i386"
24       makeflags='STRIP=: CC="${CC} -m32 -march=i686 -g1 -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6" SDL_CONFIG=sdl2-config LIB_JPEG=../../../${deps}/lib/libjpeg.a LIB_CRYPTO="../../../${deps}/lib/libd0_blind_id.a ../../../${deps}/lib/libgmp.a" LIB_ODE="../../../${deps}/lib/libode.a" DP_LINK_ZLIB=shared DP_LINK_JPEG=shared DP_LINK_ODE=shared DP_LINK_CRYPTO=shared DP_LINK_CRYPTO_RIJNDAEL=dlopen'
25       maketargets='release'
26       outputs='darkplaces-glx:darkplaces-linux32-glx darkplaces-sdl:darkplaces-linux32-sdl darkplaces-dedicated:darkplaces-linux32-dedicated'
27       ;;
28     linux64)
29       chroot=
30       makeflags='STRIP=: CC="${CC} -m64 -g1 -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6" SDL_CONFIG=sdl2-config LIB_JPEG=../../../${deps}/lib/libjpeg.a LIB_CRYPTO="../../../${deps}/lib/libd0_blind_id.a ../../../${deps}/lib/libgmp.a" LIB_ODE="../../../${deps}/lib/libode.a" DP_LINK_ZLIB=shared DP_LINK_JPEG=shared DP_LINK_ODE=shared DP_LINK_CRYPTO=shared DP_LINK_CRYPTO_RIJNDAEL=dlopen'
31       maketargets='release'
32       outputs='darkplaces-glx:darkplaces-linux64-glx darkplaces-sdl:darkplaces-linux64-sdl darkplaces-dedicated:darkplaces-linux64-dedicated'
33       ;;
34     win32)
35       chroot=
36       # -mstackrealign works around SDL2-2.0.3 issue that stack is not 16 bytes aligned, breaking SSE.
37       # Please kill once SDL comes to its senses.
38       makeflags='STRIP=: DP_MAKE_TARGET=mingw UNAME=MINGW32 CC="i686-w64-mingw32-gcc -g1 -Wl,--dynamicbase -Wl,--nxcompat -mstackrealign -I../../../${deps}/include -L../../../${deps}/lib -DUSE_WSPIAPI_H -DSUPPORTIPV6" WINDRES="i686-w64-mingw32-windres" SDL_CONFIG="../../../${deps}/bin/sdl2-config" DP_LINK_ZLIB=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen WIN32RELEASE=1 D3D=1'
39       maketargets='release'
40       outputs='darkplaces.exe:darkplaces-wgl.exe darkplaces-sdl.exe:darkplaces.exe darkplaces-dedicated.exe:darkplaces-dedicated.exe'
41       ;;
42     win64)
43       chroot=
44       makeflags='STRIP=: DP_MAKE_TARGET=mingw UNAME=MINGW32 CC="x86_64-w64-mingw32-gcc -g1 -Wl,--dynamicbase -Wl,--nxcompat -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6" WINDRES="x86_64-w64-mingw32-windres" SDL_CONFIG="../../../${deps}/bin/sdl2-config" DP_LINK_ZLIB=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen WIN64RELEASE=1 D3D=1'
45       maketargets='release'
46       outputs='darkplaces.exe:darkplaces-x64-wgl.exe darkplaces-sdl.exe:darkplaces-x64.exe darkplaces-dedicated.exe:darkplaces-x64-dedicated.exe'
47       ;;
48     osx)
49       chroot=
50       makeflags='STRIP=: CC="gcc -g1 -arch x86_64 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.5 -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" DP_LINK_ZLIB=shared DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen'
51       maketargets='sv-release sdl-release'
52       outputs='darkplaces-sdl:darkplaces-osx-sdl-bin darkplaces-dedicated:darkplaces-osx-dedicated'
53       ;;
54   esac
55
56   (
57   trap "${chroot} make -C ${PWD} ${makeflags} clean" EXIT
58   eval "${chroot} make -C ${PWD} ${makeflags} ${maketargets}"
59   for o in $outputs; do
60     src=${o%%:*}
61     dst=${o#*:}
62     sftp -oStrictHostKeyChecking=no -i id_rsa-xonotic -P 2222 -b - autobuild-bin-uploader@beta.xonotic.org <<EOF
63 put ${src} ${rev}/${dst}
64 EOF
65   done
66   )
67
68 done