SDL2 dropped i386 support, so stop compiling against that.
[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=:
25         CC="${CC} -m32 -march=i686 -g1 -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
26         SDL_CONFIG=sdl2-config
27         DP_LINK_CRYPTO=shared
28           LIB_CRYPTO="../../../${deps}/lib/libd0_blind_id.a ../../../${deps}/lib/libgmp.a"
29         DP_LINK_CRYPTO_RIJNDAEL=dlopen
30         DP_LINK_JPEG=shared
31           LIB_JPEG=../../../${deps}/lib/libjpeg.a
32         DP_LINK_ODE=shared
33           CFLAGS_ODE="-DUSEODE -DLINK_TO_LIBODE -DdDOUBLE"
34           LIB_ODE="../../../${deps}/lib/libode.a -lstdc++"
35         DP_LINK_ZLIB=shared'
36       maketargets='release'
37       outputs='darkplaces-glx:darkplaces-linux32-glx darkplaces-sdl:darkplaces-linux32-sdl darkplaces-dedicated:darkplaces-linux32-dedicated'
38       ;;
39     linux64)
40       chroot=
41       makeflags='STRIP=:
42         CC="${CC} -m64 -g1 -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
43         SDL_CONFIG=sdl2-config
44         DP_LINK_CRYPTO=shared
45           LIB_CRYPTO="../../../${deps}/lib/libd0_blind_id.a ../../../${deps}/lib/libgmp.a"
46         DP_LINK_CRYPTO_RIJNDAEL=dlopen
47         DP_LINK_JPEG=shared
48           LIB_JPEG="../../../${deps}/lib/libjpeg.a"
49         DP_LINK_ODE=shared
50           CFLAGS_ODE="-DUSEODE -DLINK_TO_LIBODE -DdDOUBLE"
51           LIB_ODE="../../../${deps}/lib/libode.a -lstdc++"
52         DP_LINK_ZLIB=shared'
53       maketargets='release'
54       outputs='darkplaces-glx:darkplaces-linux64-glx darkplaces-sdl:darkplaces-linux64-sdl darkplaces-dedicated:darkplaces-linux64-dedicated'
55       ;;
56     win32)
57       # Need to use -mstackrealign as nothing guarantees that callbacks from
58       # other Win32 DLLs - including SDL2 - retain 16 bytes alignment.
59       chroot=
60       makeflags='STRIP=:
61         D3D=1
62         DP_MAKE_TARGET=mingw
63         UNAME=MINGW32
64         WIN32RELEASE=1
65         CC="/opt/cross_toolchain_32/bin/i686-w64-mingw32-gcc -static -g1 -mstackrealign -Wl,--dynamicbase -Wl,--nxcompat -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
66         WINDRES="/opt/cross_toolchain_32/bin/i686-w64-mingw32-windres"
67         SDL_CONFIG="../../../${deps}/bin/sdl2-config"
68         DP_LINK_CRYPTO=dlopen
69         DP_LINK_CRYPTO_RIJNDAEL=dlopen
70         DP_LINK_JPEG=dlopen
71         DP_LINK_ODE=dlopen
72         DP_LINK_ZLIB=dlopen'
73       maketargets='release'
74       outputs='darkplaces.exe:darkplaces-x86-wgl.exe darkplaces-sdl.exe:darkplaces-x86.exe darkplaces-dedicated.exe:darkplaces-x86-dedicated.exe'
75       ;;
76     win64)
77       chroot=
78       makeflags='STRIP=:
79         D3D=1
80         DP_MAKE_TARGET=mingw
81         UNAME=MINGW32
82         WIN64RELEASE=1
83         CC="/opt/cross_toolchain_64/bin/x86_64-w64-mingw32-gcc -static -g1 -Wl,--dynamicbase -Wl,--nxcompat -I../../../${deps}/include -L../../../${deps}/lib -DSUPPORTIPV6"
84         WINDRES="/opt/cross_toolchain_64/bin/x86_64-w64-mingw32-windres"
85         SDL_CONFIG="../../../${deps}/bin/sdl2-config"
86         DP_LINK_CRYPTO=dlopen
87         DP_LINK_CRYPTO_RIJNDAEL=dlopen
88         DP_LINK_JPEG=dlopen
89         DP_LINK_ODE=dlopen
90         DP_LINK_ZLIB=dlopen'
91       maketargets='release'
92       outputs='darkplaces.exe:darkplaces-wgl.exe darkplaces-sdl.exe:darkplaces.exe darkplaces-dedicated.exe:darkplaces-dedicated.exe'
93       ;;
94     osx)
95       chroot=
96       makeflags='STRIP=:
97         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"
98         SDLCONFIG_MACOSXCFLAGS="-I${PWD}/SDL2.framework/Headers"
99         SDLCONFIG_MACOSXLIBS="-F${PWD} -framework SDL2 -framework Cocoa -I${PWD}/SDL2.framework/Headers"
100         SDLCONFIG_MACOSXSTATICLIBS="-F${PWD} -framework SDL2 -framework Cocoa -I${PWD}/SDL2.framework/Headers"
101         DP_LINK_CRYPTO=dlopen
102         DP_LINK_CRYPTO_RIJNDAEL=dlopen
103         DP_LINK_JPEG=dlopen
104         DP_LINK_ODE=dlopen
105         DP_LINK_ZLIB=shared'
106       maketargets='sv-release sdl-release'
107       outputs='darkplaces-sdl:darkplaces-osx-sdl-bin darkplaces-dedicated:darkplaces-osx-dedicated'
108       ;;
109   esac
110
111   # Condense whitespace in makeflags.
112   makeflags=$(
113     printf "%s\n" "$makeflags" | tr '\n' ' '
114   )
115
116   (
117     trap "${chroot} make -C ${PWD} ${makeflags} clean" EXIT
118     eval "${chroot} make -C ${PWD} ${makeflags} ${maketargets}"
119     for o in $outputs; do
120       src=${o%%:*}
121       dst=${o#*:}
122       sftp -oStrictHostKeyChecking=no -i id_rsa-xonotic -P 2222 -b - autobuild-bin-uploader@beta.xonotic.org <<EOF
123 put ${src} ${rev}/${dst}
124 EOF
125     done
126   )
127
128 done