Revert "Update Windows 32 bit SDL build dependency to 2.0.10"
[xonotic/xonotic.git] / misc / buildsrc / sdl.sh
1 #!?bin/sh
2
3 set -ex
4
5 builddeps=$PWD/../builddeps
6 buildfiles=$PWD/../buildfiles
7
8 enter() {
9         rm -rf tmp
10         mkdir tmp
11         cd tmp
12 }
13
14 leave() {
15         cd ..
16 }
17
18 enter
19 curl -O http://libsdl.org/release/SDL2-2.0.10.dmg
20 7z x *.dmg
21 7z x *.hfs
22 rm -rf "$buildfiles/osx/Xonotic.app/Contents/Frameworks/SDL2.framework/Versions/A"
23 mv SDL2/SDL2.framework/Versions/A  "$buildfiles/osx/Xonotic.app/Contents/Frameworks/SDL2.framework/Versions/A"
24 git add "$buildfiles/osx/Xonotic.app/Contents/Frameworks/SDL2.framework/Versions/A"
25 leave
26
27 enter
28 curl -O http://libsdl.org/release/SDL2-2.0.10.tar.gz
29 tar xvf *.tar.gz
30 cd SDL2*/
31 LD_LIBRARY_PATH="$HOME/opt/cross_toolchain_32/x86_64-slackware-linux/i686-w64-mingw32/lib:$HOME/opt/cross_toolchain_32/libexec/gcc/i686-w64-mingw32/4.8.3" \
32 ./configure --host=i686-w64-mingw32 --prefix="$PWD/../32" --disable-shared --enable-static CC="$HOME/opt/cross_toolchain_32/bin/i686-w64-mingw32-gcc -g1 -mstackrealign -Wl,--dynamicbase -Wl,--nxcompat"
33 LD_LIBRARY_PATH="$HOME/opt/cross_toolchain_32/x86_64-slackware-linux/i686-w64-mingw32/lib:$HOME/opt/cross_toolchain_32/libexec/gcc/i686-w64-mingw32/4.8.3" \
34 make
35 make install
36 sed -i 's,^prefix=.*,prefix=${0%/bin/sdl2-config},' ../32/bin/sdl2-config
37 rm -rf "$builddeps/win32/sdl"
38 mv ../32 "$builddeps/win32/sdl"
39 git add "$buillddeps/win32/sdl"
40 make clean
41 LD_LIBRARY_PATH="$HOME/opt/cross_toolchain_64/x86_64-slackware-linux/x86_64-w64-mingw32/lib:$HOME/opt/cross_toolchain_64/libexec/gcc/x86_64-w64-mingw32/4.8.3" \
42 ./configure --host=i686-w64-mingw32 --prefix="$PWD/../64" --disable-shared --enable-static CC="$HOME/opt/cross_toolchain_64/bin/x86_64-w64-mingw32-gcc -g1 -Wl,--dynamicbase -Wl,--nxcompat"
43 LD_LIBRARY_PATH="$HOME/opt/cross_toolchain_64/x86_64-slackware-linux/x86_64-w64-mingw32/lib:$HOME/opt/cross_toolchain_64/libexec/gcc/x86_64-w64-mingw32/4.8.3" \
44 make
45 make install
46 sed -i 's,^prefix=.*,prefix=${0%/bin/sdl2-config},' ../64/bin/sdl2-config
47 rm -rf "$builddeps/win64/sdl"
48 mv ../64 "$builddeps/win64/sdl"
49 git add "$buillddeps/win64/sdl"
50 make clean
51 leave