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 \
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 \
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
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
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
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
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
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"