]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/all/release.subr
Merge branch 'kiwixz/xonotic:master' into 'master'
[xonotic/xonotic.git] / misc / tools / all / release.subr
index ca05353cd35ea9fbc4634fc96758b9cacaad0d87..161dec265129f2ec18e97ca18903bfc10dbee12f 100644 (file)
@@ -2,6 +2,13 @@ release_common()
 {
        export LC_ALL=C
 
+       if [ -z "$MAKEFLAGS" ]; then
+               ncpus=`getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1`
+               if [ $ncpus -gt 1 ]; then
+                       export MAKEFLAGS=-j$ncpus
+               fi
+       fi
+
        release_args="$cmd $*"
        msg "*** $release_args: start"
        release_starttime=`date +%s`
@@ -143,7 +150,7 @@ case "$cmd" in
                                #   (YYYYMMDD)
                                exit 1
                                ;;
-                       release)
+                       release|RC*)
                                msg "Building a FINISHED RELEASE"
                                getversion data/xonotic-data.pk3dir
                                verbose "$SELF" each -k git tag -m "TEMP TAG" -f "xonotic-v$versionstr"
@@ -157,7 +164,7 @@ case "$cmd" in
                if [ -n "$RELEASEDATE" ]; then
                        verbose $ECHO "$RELEASEDATE" > Xonotic/stamp.txt
                        case "$RELEASETYPE" in
-                               release)
+                               release|RC*)
                                        verbose $ECHO "${RELEASEDATE%_*}" > Xonotic/pk3stamp.txt
                                        ;;
                                *)
@@ -194,13 +201,16 @@ case "$cmd" in
                rm -f Xonotic/key_15.d0pk
                (
                        verbose cd Xonotic/mapping
-                       verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20120301.tar.bz2
-                       verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20120301-win32-7z.exe
-                       for X in *-7z.exe; do
-                               7za x "$X"
-                               rm -f "$X"
-                       done
+                       # bones_was_here: don't ship 10 year old netradiant
+                       # also seems better to update netradiant independently of xonotic versions
+                       #verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20120301.tar.bz2
+                       #verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20120301-win32-7z.exe
+                       #for X in *-7z.exe; do
+                       #       7za x "$X"
+                       #       rm -f "$X"
+                       #done
                        # TODO possibly include other tools?
+                       printf "Please find links to NetRadiant builds at https://netradiant.gitlab.io or https://xonotic.org/download\nNetRadiant source available at https://gitlab.com/xonotic/netradiant\n" > NetRadiant\ links.txt
                )
                ./all each git rev-parse HEAD > Xonotic/misc/git-revisions.txt
                ;;
@@ -273,31 +283,26 @@ case "$cmd" in
                arch=$1
                buildpath=$2
                targetdir=$3
-               mkdir -p "$d0/$targetdir"
-               cd "$d0/misc/buildsrc"
-               verbose ./dlls.sh all "$buildpath" "$arch"
-               verbose cp -v $buildpath/out/$arch/* "$d0/$targetdir"
-               cd "$d0"
+               mkdir -p "$targetdir"
+               (
+                       cd "misc/buildsrc"
+                       verbose ./dlls.sh all "$buildpath" "$arch"
+               )
+               verbose cp -v $buildpath/out/$arch/* "$targetdir"
                ;;
-    release-dlls-win32)
+       release-dlls-win32)
                release_common
                verbose "$SELF" release-dlls-compile win32 /tmp/dlls Xonotic/bin32
                ;;
-    release-dlls-win64)
+       release-dlls-win64)
                release_common
                verbose "$SELF" release-dlls-compile win64 /tmp/dlls Xonotic/bin64
                ;;
-       release-dlls-clean)
-               release_common
-               verbose $d0/misc/buildsrc/dlls.sh clean /tmp/dlls
-               ;;
        release-dlls)
                release_common
-               good=false
                verbose "$SELF" release-dlls-win32
                verbose "$SELF" release-dlls-win64
-               verbose "$SELF" release-dlls-clean
-               $good
+               verbose rm -rf /tmp/dlls
                ;;
        release-engine-win32)
                release_common
@@ -306,7 +311,7 @@ case "$cmd" in
                #verbose "$SELF" release-getbinary Xonotic/xonotic-x86-dedicated.exe || good=false
                #$good
                verbose "$SELF" release-compile win32 \
-                       'STRIP=: D3D=1 DP_MAKE_TARGET=mingw WIN32RELEASE=1 CC="i686-w64-mingw32-gcc -static -g1 -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' \
+                       'STRIP=: 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'
                ;;
        release-engine-win64)
@@ -316,7 +321,7 @@ case "$cmd" in
                #verbose "$SELF" release-getbinary Xonotic/xonotic-dedicated.exe || good=false
                #$good
                verbose "$SELF" release-compile win64 \
-                       'STRIP=: D3D=1 DP_MAKE_TARGET=mingw WIN64RELEASE=1 CC="x86_64-w64-mingw32-gcc -static -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_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_ZLIB=dlopen' \
+                       'STRIP=: 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'
                ;;
        release-engine-osx)
@@ -327,7 +332,7 @@ case "$cmd" in
                #$good
                # Note: travis build script also had SDLCONFIG_MACOSX* flags; need to check if they're still needed with osxcross.
                verbose "$SELF" release-compile osx \
-                       'STRIP=: DP_MAKE_TARGET=macosx CC="$HOME/osxcross/out/bin/o64-clang -g1 -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 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' \
                        'sv-release sdl-release' 'darkplaces-sdl:Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-sdl-bin darkplaces-dedicated:Xonotic/xonotic-osx-dedicated'
                ;;
        release-engine-linux64)
@@ -338,7 +343,7 @@ case "$cmd" in
                #verbose "$SELF" release-getbinary Xonotic/xonotic-linux64-dedicated || good=false
                #$good
                verbose "$SELF" release-compile linux64 \
-                       'STRIP=: CC="gcc -m64 -g1 -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=dlopen 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' \
+                       'STRIP=: 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'
                ;;
        release-engine)
@@ -451,6 +456,9 @@ case "$cmd" in
                        case "$RELEASETYPE" in
                                release)
                                        ;;
+                               RC*)
+                                       versionstr="$versionstr $RELEASETYPE"
+                                       ;;
                                *)
                                        versionstr="$versionstr$RELEASETYPE"
                                        ;;
@@ -459,20 +467,22 @@ case "$cmd" in
                                # pre-1.0: compatible with any other pre-1.0
                                verbose sed "
                                        s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
-                                       s/^gameversion_min [0-9]*/gameversion_min     0/;
                                        s/^gameversion_max [0-9]*/gameversion_max  9999/;
                                " < xonotic-common.cfg > xonotic-common.cfg.new
+                               # Following line was included in sed above, ref https://gitlab.com/xonotic/xonotic-data.pk3dir/-/merge_requests/1034
+                               # s/^gameversion_min [0-9]*/gameversion_min     0/;
                        else
                                # >= 1.0
                                verbose sed "
                                        s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
-                                       s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
                                        s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/;
                                " < xonotic-common.cfg > xonotic-common.cfg.new
+                               # Following line was included in sed above, ref https://gitlab.com/xonotic/xonotic-data.pk3dir/-/merge_requests/1034
+                               # s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
                        fi
                        mv xonotic-common.cfg.new xonotic-common.cfg
                        case "$RELEASETYPE" in
-                               release)
+                               release|RC*)
                                        echo "" >> xonotic-common.cfg
                                        echo "// nicer menu" >> xonotic-common.cfg
                                        echo "set menu_watermark \"\"" >> xonotic-common.cfg
@@ -535,6 +545,7 @@ case "$cmd" in
                verbose "$SELF" release-buildpk3s data/xonotic-maps.pk3dir             normaldds '' mapping '-mapping' normal '-high'
                verbose "$SELF" release-buildpk3s data/xonotic-music.pk3dir     raw ''
                verbose "$SELF" release-buildpk3s data/xonotic-nexcompat.pk3dir        normaldds ''                    normal '-high'
+               verbose "$SELF" release-buildpk3s data/xonotic-xoncompat.pk3dir        normaldds ''                    normal '-high'
                ;;
        release-pack-needsx11)
                release_common
@@ -589,13 +600,15 @@ case "$cmd" in
                        Xonotic/data/xonotic-$pk3stamp-data.pk3 \
                        Xonotic/data/xonotic-$pk3stamp-maps.pk3 \
                        Xonotic/data/xonotic-$pk3stamp-music.pk3 \
-                       Xonotic/data/xonotic-$pk3stamp-nexcompat.pk3
+                       Xonotic/data/xonotic-$pk3stamp-nexcompat.pk3 \
+                       Xonotic/data/xonotic-$pk3stamp-xoncompat.pk3
                verbose mv Xonotic-$stamp-common.zip Xonotic-$stamp-high.zip
                verbose mkzip0 Xonotic-$stamp-high.zip \
                        Xonotic/data/xonotic-$pk3stamp-data-high.pk3 \
                        Xonotic/data/xonotic-$pk3stamp-maps-high.pk3 \
                        Xonotic/data/xonotic-$pk3stamp-music.pk3 \
-                       Xonotic/data/xonotic-$pk3stamp-nexcompat-high.pk3
+                       Xonotic/data/xonotic-$pk3stamp-nexcompat-high.pk3 \
+                       Xonotic/data/xonotic-$pk3stamp-xoncompat-high.pk3
                verbose mkzip Xonotic-$stamp-mappingsupport.zip \
                        Xonotic/mapping
                verbose mkzip0 Xonotic-$stamp-mappingsupport.zip \