]> de.git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/all/release.subr
Fix libd0 autobuild
[xonotic/xonotic.git] / misc / tools / all / release.subr
index 97ebb39e115eb5a89474d0905e953a17edbebb16..b46ec5dbd92c25672ba15afc2bebdc227aaace29 100644 (file)
@@ -174,12 +174,13 @@ case "$cmd" in
                        verbose date +%Y%m%d > Xonotic/stamp.txt
                        verbose date +%Y%m%d > Xonotic/pk3stamp.txt
                fi
-               release_git_extract_dir "." "Xonotic" Docs misc/buildfiles/osx misc/buildsrc misc/logos misc/tools server xonotic-linux-glx.sh xonotic-linux-sdl.sh xonotic-linux-dedicated.sh Makefile key_0.d0pk COPYING GPL-2 GPL-3
+               release_git_extract_dir "." "Xonotic" Docs misc/buildfiles/osx misc/logos misc/tools server xonotic-linux-sdl.sh xonotic-linux-dedicated.sh Makefile key_0.d0pk COPYING GPL-2 GPL-3
                (
                        verbose cd Xonotic
                        verbose mkdir data source source/darkplaces source/gmqcc source/d0_blind_id mapping
                        verbose mv misc/buildfiles/osx/* . || true
                        verbose rm -rf misc/buildfiles
+                       verbose rm -rf misc/tools/all
                )
                release_git_extract_dir "darkplaces" "Xonotic/source/darkplaces" .
                release_git_extract_dir "gmqcc" "Xonotic/source/gmqcc" .
@@ -276,18 +277,42 @@ case "$cmd" in
                                ;;
                esac
                ;;
+       release-libs-compile)
+               release_common
+               arch=$1
+               makeflags=$2
+               host=$3
+               (
+                       verbose cd "$d0/d0_blind_id"
+                       verbose ./autogen.sh
+                       verbose ./configure --enable-static --disable-shared \
+                                           --host="$host" \
+                                           --prefix="$d0/misc/builddeps/$arch/d0_blind_id"
+                       verbose make clean
+                       verbose eval make "$makeflags"
+                       verbose make install
+               )
+               ;;
+       release-libs-linux64)
+               release_common
+               verbose "$SELF" release-libs-compile linux64 \
+                       'CC="gcc -m64 -flto=auto"' \
+                       x86_64-pc-linux-gnu
+               ;;
        release-dlls-compile)
                release_common
                arch=$1
                buildpath=$2
                targetdir=$3
-               mkdir -p "$targetdir"
+               verbose mkdir -p "$targetdir"
                (
                        cd "misc/buildsrc"
                        verbose ./dlls.sh clean "$buildpath"
                        verbose ./dlls.sh all "$buildpath" "$arch"
                )
                verbose cp -v $buildpath/out/$arch/* "$targetdir"
+               verbose mkdir -p "$d0/misc/builddeps/$arch/"
+               verbose rsync --delete -avP "$buildpath/pkg/$arch/sdl" "$d0/misc/builddeps/$arch/"
                ;;
        release-dlls-win32)
                release_common
@@ -297,10 +322,31 @@ case "$cmd" in
                release_common
                verbose "$SELF" release-dlls-compile win64 /tmp/dlls Xonotic/bin64
                ;;
-       release-dlls)
+       release-libs-osx)
+               release_common
+               verbose mkdir -p "$d0/misc/builddeps/osx"
+               (
+                       verbose cd "$d0/misc/builddeps/osx"
+                       verbose rm -rf sdl SDL2
+                       verbose wget https://libsdl.org/release/SDL2-2.28.5.dmg
+                       verbose 7z x *.dmg
+                       # 7z still fails to extract working symlinks from any archive format, hackaround:
+                       verbose ln -sf $(cat SDL2/SDL2.framework/Versions/Current) SDL2/SDL2.framework/Versions/Current
+                       verbose ln -sf $(cat SDL2/SDL2.framework/Headers) SDL2/SDL2.framework/Headers
+                       verbose ln -sf $(cat SDL2/SDL2.framework/Resources) SDL2/SDL2.framework/Resources
+                       verbose ln -sf $(cat SDL2/SDL2.framework/SDL2) SDL2/SDL2.framework/SDL2
+                       # THE HEADERS ARE NOT IN A SUBDIRECTORY CALLED SDL2
+                       # YET SDL2/ WAS ADDED TO ALL THE INCLUDES, WHY?!?
+                       # OLD VERSIONS WITHOUT IT WORKED
+                       verbose sed -i "s/#include <SDL2\//#include </g" SDL2/SDL2.framework/Versions/Current/Headers/*.h
+               )
+               ;;
+       release-libs)
                release_common
+               verbose "$SELF" release-libs-linux64
                verbose "$SELF" release-dlls-win32
                verbose "$SELF" release-dlls-win64
+               verbose "$SELF" release-libs-osx
                verbose rm -rf /tmp/dlls
                ;;
        release-engine-win32)
@@ -310,8 +356,8 @@ case "$cmd" in
                #verbose "$SELF" release-getbinary Xonotic/xonotic-x86-dedicated.exe || good=false
                #$good
                verbose "$SELF" release-compile win32 \
-                       'D3D=1 DP_MAKE_TARGET=mingw WIN32RELEASE=1 CC="i686-w64-mingw32-gcc -static -flto=auto -mstackrealign -Wl,--dynamicbase -Wl,--nxcompat -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" WINDRES="i686-w64-mingw32-windres" SDL_CONFIG="../../../.deps/bin/sdl2-config" DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=dlopen' \
-                       release 'darkplaces.exe:Xonotic/xonotic-x86-wgl.exe darkplaces-sdl.exe:Xonotic/xonotic-x86.exe darkplaces-dedicated.exe:Xonotic/xonotic-x86-dedicated.exe'
+                       'DP_MAKE_TARGET=mingw WIN32RELEASE=1 CC="i686-w64-mingw32-gcc -static -flto=auto -mstackrealign -Wl,--dynamicbase -Wl,--nxcompat -I../../../.deps/include -L../../../.deps/lib" WINDRES="i686-w64-mingw32-windres" DP_LINK_SDL=static SDL_CONFIG="../../../.deps/bin/sdl2-config" DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=dlopen' \
+                       release 'darkplaces-sdl.exe:Xonotic/xonotic-x86.exe darkplaces-dedicated.exe:Xonotic/xonotic-x86-dedicated.exe'
                ;;
        release-engine-win64)
                release_common
@@ -320,8 +366,8 @@ case "$cmd" in
                #verbose "$SELF" release-getbinary Xonotic/xonotic-dedicated.exe || good=false
                #$good
                verbose "$SELF" release-compile win64 \
-                       'D3D=1 DP_MAKE_TARGET=mingw WIN64RELEASE=1 CC="x86_64-w64-mingw32-gcc -static -flto=auto -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_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=dlopen' \
-                       release 'darkplaces.exe:Xonotic/xonotic-wgl.exe darkplaces-sdl.exe:Xonotic/xonotic.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe'
+                       'DP_MAKE_TARGET=mingw WIN64RELEASE=1 CC="x86_64-w64-mingw32-gcc -static -flto=auto -Wl,--dynamicbase -Wl,--nxcompat -I../../../.deps/include -L../../../.deps/lib" WINDRES="x86_64-w64-mingw32-windres" DP_LINK_SDL=static SDL_CONFIG="../../../.deps/bin/sdl2-config" DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=dlopen' \
+                       release 'darkplaces-sdl.exe:Xonotic/xonotic.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe'
                ;;
        release-engine-osx)
                release_common
@@ -332,7 +378,7 @@ case "$cmd" in
                # Note: travis build script also had SDLCONFIG_MACOSX* flags; need to check if they're still needed with osxcross.
                # Note: Mac bins cannot be stripped by the standard tool.
                verbose "$SELF" release-compile osx \
-                       'STRIP=: DP_MAKE_TARGET=macosx PATH="$HOME/osxcross/out/bin:$PATH" CC="$HOME/osxcross/out/bin/o64-clang -flto -arch x86_64 -mmacosx-version-min=10.6 -Wl,-rpath -Wl,@loader_path/../Frameworks -Wl,-rpath -Wl,@loader_path -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" SDLCONFIG_MACOSXCFLAGS="-I../../../.deps/SDL2.framework/Headers" SDLCONFIG_MACOSXLIBS="-F../../../.deps -framework SDL2 -framework Cocoa -I../../../.deps/SDL2.framework/Headers" SDLCONFIG_MACOSXSTATICLIBS="-F../../../.deps -framework SDL2 -framework Cocoa -I../../../.deps/SDL2.framework/Headers" DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=shared' \
+                       'STRIP=: DP_MAKE_TARGET=macosx PATH="$HOME/osxcross/out/bin:$PATH" CC="$HOME/osxcross/out/bin/o64-clang -flto -arch x86_64 -mmacosx-version-min=10.7 -Wl,-rpath -Wl,@loader_path/../Frameworks -Wl,-rpath -Wl,@loader_path -I../../../.deps/include -L../../../.deps/lib" SDLCONFIG_MACOSXCFLAGS="-I../../../.deps/SDL2.framework/Headers" SDLCONFIG_MACOSXLIBS="-F../../../.deps -framework SDL2 -framework Cocoa -I../../../.deps/SDL2.framework/Headers" SDLCONFIG_MACOSXSTATICLIBS="-F../../../.deps -framework SDL2 -framework Cocoa -I../../../.deps/SDL2.framework/Headers" DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=shared' \
                        release 'darkplaces-sdl:Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-sdl-bin darkplaces-dedicated:Xonotic/xonotic-osx-dedicated'
                ;;
        release-engine-linux64)
@@ -343,8 +389,8 @@ case "$cmd" in
                #verbose "$SELF" release-getbinary Xonotic/xonotic-linux64-dedicated || good=false
                #$good
                verbose "$SELF" release-compile linux64 \
-                       'CC="gcc -m64 -flto=auto -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" DP_LINK_CRYPTO=shared LIB_CRYPTO="../../../.deps/lib/libd0_blind_id.a ../../../.deps/lib/libgmp.a" DP_LINK_CRYPTO_RIJNDAEL=shared DP_LINK_JPEG=shared LIB_JPEG=/usr/lib/x86_64-linux-gnu/libjpeg.a DP_LINK_ODE=shared CFLAGS_ODE="-DUSEODE -DLINK_TO_LIBODE -DdDOUBLE" LIB_ODE="../../../.deps/lib/libode.a -lstdc++ -pthread" DP_LINK_ZLIB=shared' \
-                       release 'darkplaces-glx:Xonotic/xonotic-linux64-glx darkplaces-sdl:Xonotic/xonotic-linux64-sdl darkplaces-dedicated:Xonotic/xonotic-linux64-dedicated'
+                       'CC="gcc -m64 -flto=auto -I../../../.deps/include -L../../../.deps/lib" DP_LINK_CRYPTO=static DP_LINK_CRYPTO_RIJNDAEL=static DP_LINK_JPEG=shared LIB_JPEG=/usr/lib/x86_64-linux-gnu/libjpeg.a DP_LINK_ODE=dlopen DP_LINK_ZLIB=shared' \
+                       release 'darkplaces-sdl:Xonotic/xonotic-linux64-sdl darkplaces-dedicated:Xonotic/xonotic-linux64-dedicated'
                ;;
        release-engine)
                release_common
@@ -623,7 +669,7 @@ case "$cmd" in
                release_common
                verbose "$SELF" release-prepare
                verbose "$SELF" release-maps
-               verbose "$SELF" release-dlls
+               verbose "$SELF" release-libs
                verbose "$SELF" release-engine
                verbose "$SELF" release-qc
                verbose "$SELF" release-pack