mirror of
https://gitlab.com/xonotic/xonotic
synced 2025-02-02 19:51:45 +00:00
625 lines
22 KiB
Plaintext
625 lines
22 KiB
Plaintext
release_common()
|
|
{
|
|
export LC_ALL=C
|
|
|
|
release_args="$cmd $*"
|
|
msg "*** $release_args: start"
|
|
release_starttime=`date +%s`
|
|
release_end()
|
|
{
|
|
release_endtime=`date +%s`
|
|
release_deltatime=$(($release_endtime - $release_starttime))
|
|
msg "*** $release_args: $release_deltatime seconds"
|
|
}
|
|
trap release_end EXIT
|
|
release_tempstarttime=$release_starttime
|
|
release_timereport()
|
|
{
|
|
release_endtime=`date +%s` # RELEASE NOW!!!
|
|
if [ -n "$*" ]; then
|
|
release_deltatime=$(($release_endtime - $release_tempstarttime))
|
|
msg "**** $release_args: $*: $release_deltatime seconds"
|
|
fi
|
|
release_tempstarttime=$release_endtime
|
|
}
|
|
release_git_extract_dir()
|
|
{
|
|
release_src=$1; shift
|
|
release_dst=$1; shift
|
|
# try to create a hardlink
|
|
if ln -f "$release_src/.git/HEAD" "$release_dst/.hardlink-test"; then
|
|
rm -f "$release_dst/.hardlink-test"
|
|
{
|
|
verbose cd "$release_src"
|
|
git ls-files HEAD -- "$@"
|
|
} | {
|
|
while IFS= read -r F; do
|
|
case "$F" in */*) mkdir -p "$release_dst/${F%/*}" ;; esac
|
|
verbose ln -f "$release_src/$F" "$release_dst/$F"
|
|
done
|
|
}
|
|
else
|
|
{
|
|
verbose cd "$release_src"
|
|
verbose git archive --format=tar HEAD -- "$@"
|
|
} | {
|
|
verbose cd "$release_dst"
|
|
verbose tar xvf -
|
|
}
|
|
fi
|
|
}
|
|
|
|
mkzipr()
|
|
{
|
|
archive=$1; shift
|
|
|
|
# get rid of this hack once we have done large enough changes
|
|
# to be no longer rsync compatible (and then enable the below
|
|
# code)
|
|
sevenzipflags=-mx=9
|
|
zipflags=-9
|
|
find "$@" -exec touch -d "2001-01-01 01:01:01 +0000" {} \+ # ugly hack to make the pk3 files rsync-friendly
|
|
ziplist=`mktemp`
|
|
find "$@" -xtype f \( -executable -or -type l \) -print | sed 's,\([./][^./]*$\),\1 \1,' | sort -k2 | cut -d\ -f1 > "$ziplist"
|
|
7za a -tzip $sevenzipflags -x@"$ziplist" "$archive" "$@" || true
|
|
zip $zipflags -y -@<"$ziplist" "$archive" || true
|
|
rm -f "$ziplist"
|
|
|
|
#zipflags=-1r
|
|
#find "$@" -exec touch -d "2001-01-01 01:01:01 +0000" {} \+ # ugly hack to make the pk3 files rsync-friendly
|
|
#zip $zipflags -y "$archive" "$@" || true
|
|
#advzip -4 "$archive"
|
|
}
|
|
|
|
mkzip()
|
|
{
|
|
archive=$1; shift
|
|
zipflags=-1ry
|
|
zip $zipflags "$archive" "$@" || true
|
|
advzip -z -4 "$archive"
|
|
}
|
|
|
|
mkzip0()
|
|
{
|
|
archive=$1; shift
|
|
zipflags=-0ry
|
|
zip $zipflags "$archive" "$@" || true
|
|
}
|
|
|
|
getversion()
|
|
{
|
|
gv=`grep "^gameversion " "$1/defaultXonotic.cfg" | awk '{ print $2 }'`
|
|
major=$(($gv / 10000))
|
|
minor=$((($gv / 100) - ($major * 100)))
|
|
patch=$(($gv - ($major * 10000) - ($minor * 100)))
|
|
versionstr="$major.$minor.$patch"
|
|
}
|
|
}
|
|
|
|
handled=true
|
|
case "$cmd" in
|
|
# release building goes here
|
|
release-prepare)
|
|
release_common
|
|
#"$SELF" each git clean -fxd
|
|
case "$RELEASETYPE" in
|
|
'')
|
|
$ECHO >&2 -n "$ESC[2J$ESC[H"
|
|
msg ""
|
|
msg ""
|
|
msg ""
|
|
msg ""
|
|
msg ""
|
|
msg ""
|
|
msg " +---------------------------------------------------------.---+"
|
|
msg " | NOTE | X |"
|
|
msg " +---------------------------------------------------------^---+"
|
|
msg " | ____ |"
|
|
msg " | / \ This is the official release build system. |"
|
|
msg " | | | If you are not a member of the Xonotic Core Team, |"
|
|
msg " | | STOP | you are not supposed to use this script and should |"
|
|
msg " | | | instead use ./all compile to compile the engine |"
|
|
msg " | \____/ and game code. |"
|
|
msg " | |"
|
|
msg " | [ I understand ] |"
|
|
msg " +-------------------------------------------------------------+"
|
|
sleep 10
|
|
# A LOT of build infrastructure is required:
|
|
# - vorbis-tools
|
|
# - ImageMagick
|
|
# - .ssh/config must be configured so the following
|
|
# host names are reachable and have a compile
|
|
# infrastructure set up:
|
|
# - xonotic-build-linux32 (with gcc on x86)
|
|
# - xonotic-build-linux64 (with gcc on x86_64)
|
|
# - xonotic-build-win32 (with i586-mingw32msvc-g++)
|
|
# - xonotic-build-win64 (with amd64-mingw32msvc-g++
|
|
# and amd64-mingw32msvc-g++)
|
|
# - xonotic-build-osx (with Xcode and SDL.framework)
|
|
# - AMD Compressonator installed in WINE
|
|
# - ResEdit installed in WINE
|
|
# - a lot of other requirements you will figure out
|
|
# while reading the error messages
|
|
# - environment variable RELEASETYPE set
|
|
# - optionally, environment variable RELEASEDATE set
|
|
# (YYYYMMDD)
|
|
exit 1
|
|
;;
|
|
release)
|
|
msg "Building a FINISHED RELEASE"
|
|
getversion data/xonotic-data.pk3dir
|
|
verbose "$SELF" each -k git tag -m "TEMP TAG" -f "xonotic-v$versionstr"
|
|
;;
|
|
*)
|
|
msg "Building a $RELEASETYPE"
|
|
;;
|
|
esac
|
|
verbose rm -rf Xonotic Xonotic*.zip
|
|
verbose mkdir -p Xonotic
|
|
if [ -n "$RELEASEDATE" ]; then
|
|
verbose $ECHO "$RELEASEDATE" > Xonotic/stamp.txt
|
|
case "$RELEASETYPE" in
|
|
release)
|
|
verbose $ECHO "${RELEASEDATE%_*}" > Xonotic/pk3stamp.txt
|
|
;;
|
|
*)
|
|
verbose $ECHO "$RELEASEDATE" > Xonotic/pk3stamp.txt
|
|
;;
|
|
esac
|
|
else
|
|
verbose date +%Y%m%d > Xonotic/stamp.txt
|
|
verbose date +%Y%m%d > Xonotic/pk3stamp.txt
|
|
fi
|
|
release_git_extract_dir "." "Xonotic" Docs misc server xonotic-linux-glx.sh xonotic-linux-sdl.sh xonotic-linux-dedicated.sh Makefile misc/buildfiles key_0.d0pk COPYING GPL-2 GPL-3
|
|
(
|
|
verbose cd Xonotic
|
|
verbose mkdir data gmqcc source source/darkplaces source/gmqcc source/d0_blind_id mapping
|
|
verbose rm -rf misc/builddeps
|
|
verbose mv misc/buildfiles/win32 bin32 || true
|
|
verbose mv bin32/SDL.dll . || true
|
|
verbose mv misc/buildfiles/win64 bin64 || true
|
|
verbose mv misc/buildfiles/osx/* . || true
|
|
verbose rm -rf misc/buildfiles
|
|
verbose rm -rf misc/pki
|
|
)
|
|
release_git_extract_dir "darkplaces" "Xonotic/source/darkplaces" .
|
|
release_git_extract_dir "gmqcc" "Xonotic/source/gmqcc" .
|
|
release_git_extract_dir "data/xonotic-data.pk3dir" "Xonotic/source" qcsrc Makefile
|
|
release_git_extract_dir "d0_blind_id" "Xonotic/source/d0_blind_id" .
|
|
(
|
|
verbose cd Xonotic/source/d0_blind_id
|
|
verbose sh autogen.sh
|
|
)
|
|
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
|
|
# TODO possibly include other tools?
|
|
)
|
|
./all each git rev-parse HEAD > Xonotic/misc/git-revisions.txt
|
|
;;
|
|
release-compile-run)
|
|
release_common
|
|
host=$1
|
|
buildpath=$2
|
|
maketargets=$3
|
|
makeflags=$4
|
|
srcdir=$5
|
|
depsdir=$6
|
|
targetfiles=$7
|
|
set -x
|
|
if [ -n "$targetfiles" ]; then
|
|
case " $HOSTS_THAT_ARE_DISABLED " in
|
|
*\ $host\ *)
|
|
exit
|
|
;;
|
|
esac
|
|
case " $HOSTS_THAT_ARE_MYSELF " in
|
|
*\ $host\ *)
|
|
verbose rsync --delete -zLvaSHP "$srcdir"/ "$buildpath/"
|
|
verbose rsync --delete -zLvaSHP "$depsdir"/*/ "$buildpath.deps/"
|
|
verbose ln -snf "$buildpath.deps" "$buildpath/.deps"
|
|
verbose eval make -C "$buildpath" clean $maketargets $makeflags
|
|
for f in $targetfiles; do
|
|
verbose mv "$buildpath/${f%:*}" "${f##*:}" || true
|
|
done
|
|
;;
|
|
*)
|
|
verbose rsync --delete -zLvaSHP "$srcdir"/ "$host:$buildpath/"
|
|
verbose rsync --delete -zLvaSHP "$depsdir"/*/ "$host:$buildpath.deps/"
|
|
verbose ssh "$host" "[ -f /etc/profile ] && . /etc/profile; [ -f ~/.profile ] && . ~/.profile; export LC_ALL=C; ln -snf $buildpath.deps $buildpath/.deps && cd $buildpath && nice -`nice` make clean $maketargets $makeflags"
|
|
for f in $targetfiles; do
|
|
verbose rsync -zvaSHP "$host:$buildpath/${f%:*}" "${f##*:}" || true
|
|
done
|
|
;;
|
|
esac
|
|
# now rebrand the binaries...
|
|
for f in $targetfiles; do
|
|
#verbose "$d0/misc/tools/rebrand-darkplaces-engine.sh" "${XONOTIC_BRAND:-$d0/misc/tools/xonotic.brand}" "${f##*:}" || true
|
|
case "${f##*:}" in
|
|
Xonotic/xonotic*.exe)
|
|
verbose "$d0/misc/tools/change-icon-of-exe.sh" "$d0/misc/logos/icons_ico/xonotic.ico" "${f##*:}"
|
|
;;
|
|
esac
|
|
done
|
|
fi
|
|
;;
|
|
release-compile)
|
|
release_common
|
|
suffix=$1
|
|
makeflags=$2
|
|
gmqcc_maketargets=$3
|
|
gmqcc_files=$4
|
|
darkplaces_maketargets=$5
|
|
darkplaces_files=$6
|
|
host=xonotic-build-$suffix
|
|
verbose "$SELF" release-compile-run "$host" /tmp/gmqcc.build."$suffix" "$gmqcc_maketargets" "$makeflags" "Xonotic/source/gmqcc" "$d0/misc/builddeps/$suffix" "$gmqcc_files"
|
|
verbose "$SELF" release-compile-run "$host" /tmp/Darkplaces.build."$suffix" "$darkplaces_maketargets" "$makeflags" "Xonotic/source/darkplaces" "$d0/misc/builddeps/$suffix" "$darkplaces_files"
|
|
;;
|
|
release-engine-win32)
|
|
release_common
|
|
verbose "$SELF" release-compile win32 \
|
|
'STRIP=: DP_MAKE_TARGET=mingw UNAME=MINGW32 CC="i586-mingw32msvc-gcc -g1 -Wl,--dynamicbase -Wl,--nxcompat -I../../../.deps/include -L../../../.deps/lib -DUSE_WSPIAPI_H -DSUPPORTIPV6" WINDRES="i586-mingw32msvc-windres" SDL_CONFIG="../../../.deps/bin/sdl-config" DP_LINK_ZLIB=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen WIN32RELEASE=1 D3D=1' \
|
|
gmqcc.exe 'gmqcc.exe:Xonotic/gmqcc/gmqcc.exe' \
|
|
release 'darkplaces.exe:Xonotic/xonotic.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe'
|
|
;;
|
|
release-engine-win64)
|
|
release_common
|
|
verbose "$SELF" release-compile win64 \
|
|
'STRIP=: DP_MAKE_TARGET=mingw UNAME=MINGW32 CC="amd64-mingw32msvc-gcc -g1 -Wl,--dynamicbase -Wl,--nxcompat -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" WINDRES="amd64-mingw32msvc-windres" SDL_CONFIG="../../../.deps/bin/sdl-config" DP_LINK_ZLIB=dlopen DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen WIN64RELEASE=1 D3D=1' \
|
|
gmqcc.exe 'gmqcc.exe:Xonotic/gmqcc/gmqcc-x64.exe' \
|
|
release 'darkplaces.exe:Xonotic/xonotic-x64.exe darkplaces-sdl.exe:Xonotic/xonotic-x64-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-x64-dedicated.exe'
|
|
;;
|
|
release-engine-osx)
|
|
release_common
|
|
# gcc on OSX is buggy, needs -fno-reorder-blocks for a release build to succeed
|
|
verbose "$SELF" release-compile osx \
|
|
'STRIP=: CC="gcc -g1 -arch i386 -arch ppc -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.4 -I../../../.deps/include -L../../../.deps/lib -fno-reorder-blocks -DSUPPORTIPV6" DP_LINK_ZLIB=shared DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_CRYPTO=dlopen DP_LINK_CRYPTO_RIJNDAEL=dlopen' \
|
|
gmqcc 'gmqcc:Xonotic/gmqcc/gmqcc.osx' \
|
|
'sv-release sdl-release' 'darkplaces-sdl:Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-sdl-bin darkplaces-dedicated:Xonotic/xonotic-osx-dedicated'
|
|
;;
|
|
release-engine-linux32)
|
|
release_common
|
|
verbose "$SELF" release-compile linux32 \
|
|
'STRIP=: CC="gcc -m32 -march=i686 -g1 -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" LIB_JPEG=../../../.deps/lib/libjpeg.a LIB_CRYPTO="../../../.deps/lib/libd0_blind_id.a ../../../.deps/lib/libgmp.a" DP_LINK_ZLIB=shared DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_CRYPTO=shared DP_LINK_CRYPTO_RIJNDAEL=dlopen' \
|
|
gmqcc 'gmqcc:Xonotic/gmqcc/gmqcc.linux32' \
|
|
release 'darkplaces-glx:Xonotic/xonotic-linux32-glx darkplaces-sdl:Xonotic/xonotic-linux32-sdl darkplaces-dedicated:Xonotic/xonotic-linux32-dedicated'
|
|
;;
|
|
release-engine-linux64)
|
|
release_common
|
|
verbose "$SELF" release-compile linux64 \
|
|
'STRIP=: CC="gcc -m64 -g1 -I../../../.deps/include -L../../../.deps/lib -DSUPPORTIPV6" LIB_JPEG=../../../.deps/lib/libjpeg.a LIB_CRYPTO="../../../.deps/lib/libd0_blind_id.a ../../../.deps/lib/libgmp.a" DP_LINK_ZLIB=shared DP_LINK_JPEG=dlopen DP_LINK_ODE=dlopen DP_LINK_CRYPTO=shared DP_LINK_CRYPTO_RIJNDAEL=dlopen' \
|
|
gmqcc 'gmqcc:Xonotic/gmqcc/gmqcc.linux64' \
|
|
release 'darkplaces-glx:Xonotic/xonotic-linux64-glx darkplaces-sdl:Xonotic/xonotic-linux64-sdl darkplaces-dedicated:Xonotic/xonotic-linux64-dedicated'
|
|
;;
|
|
release-engine)
|
|
release_common
|
|
verbose "$SELF" release-engine-linux32 &
|
|
verbose "$SELF" release-engine-linux64 &
|
|
verbose "$SELF" release-engine-win32 &
|
|
verbose "$SELF" release-engine-win64 &
|
|
verbose "$SELF" release-engine-osx &
|
|
wait %1
|
|
wait %2
|
|
wait %3
|
|
wait %4
|
|
wait %5
|
|
wait
|
|
;;
|
|
release-maps)
|
|
release_common
|
|
verbose "$SELF" update-maps
|
|
;;
|
|
release-qc)
|
|
release_common
|
|
verbose env GIT_DIR="$d0/data/xonotic-data.pk3dir/.git" make -C Xonotic/source QCC="$d0/Xonotic/gmqcc/gmqcc.linux64" XON_BUILDSYSTEM=1 clean all
|
|
;;
|
|
release-buildpk3-transform-raw)
|
|
release_common
|
|
dir=$1
|
|
;;
|
|
release-buildpk3-transform-normal)
|
|
release_common
|
|
dir=$1
|
|
verbose cd "$dir"
|
|
# texture: convert to jpeg and dds
|
|
verbose export do_jpeg=true
|
|
verbose export jpeg_qual_rgb=97
|
|
verbose export jpeg_qual_a=99
|
|
verbose export do_dds=false
|
|
verbose export do_ogg=true
|
|
verbose export ogg_ogg=false
|
|
verbose export del_src=true
|
|
find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
|
|
;;
|
|
release-buildpk3-transform-normaldds)
|
|
release_common
|
|
dir=$1
|
|
verbose cd "$dir"
|
|
# texture: convert to jpeg and dds
|
|
# music: reduce bitrate
|
|
verbose export do_jpeg=false
|
|
verbose export do_jpeg_if_not_dds=true
|
|
verbose export jpeg_qual_rgb=95
|
|
verbose export jpeg_qual_a=99
|
|
verbose export do_dds=true
|
|
verbose export dds_flags=
|
|
verbose export do_ogg=true
|
|
verbose export ogg_ogg=false
|
|
verbose export del_src=true
|
|
find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
|
|
;;
|
|
release-buildpk3-transform-low)
|
|
release_common
|
|
dir=$1
|
|
verbose cd "$dir"
|
|
# texture: convert to jpeg and dds
|
|
# music: reduce bitrate
|
|
verbose export do_jpeg=true
|
|
verbose export jpeg_qual_rgb=80
|
|
verbose export jpeg_qual_a=97
|
|
verbose export do_dds=false
|
|
verbose export do_ogg=true
|
|
verbose export ogg_qual=1
|
|
verbose export del_src=true
|
|
find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
|
|
;;
|
|
release-buildpk3-transform-webp)
|
|
release_common
|
|
dir=$1
|
|
verbose cd "$dir"
|
|
# texture: convert to jpeg and dds
|
|
verbose export do_jpeg=false
|
|
verbose export do_webp=true
|
|
verbose export do_dds=false
|
|
verbose export do_ogg=false
|
|
verbose export ogg_ogg=false
|
|
verbose export del_src=true
|
|
find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
|
|
;;
|
|
release-buildpk3-transform-lowdds)
|
|
release_common
|
|
dir=$1
|
|
verbose cd "$dir"
|
|
# texture: convert to jpeg and dds
|
|
# music: reduce bitrate
|
|
verbose export do_jpeg=false
|
|
verbose export do_jpeg_if_not_dds=true
|
|
verbose export jpeg_qual_rgb=80
|
|
verbose export jpeg_qual_a=99
|
|
verbose export do_dds=true
|
|
verbose export dds_flags=
|
|
verbose export do_ogg=true
|
|
verbose export ogg_qual=1
|
|
verbose export del_src=true
|
|
find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
|
|
;;
|
|
release-buildpk3-transform-mapping)
|
|
release_common
|
|
dir=$1
|
|
verbose cd "$dir"
|
|
# remove stuff radiant has no use for
|
|
verbose find . -name \*_norm.\* -exec rm -f {} \;
|
|
verbose find . -name \*_bump.\* -exec rm -f {} \;
|
|
verbose find . -name \*_glow.\* -exec rm -f {} \;
|
|
verbose find . -name \*_gloss.\* -exec rm -f {} \;
|
|
verbose find . -name \*_pants.\* -exec rm -f {} \;
|
|
verbose find . -name \*_shirt.\* -exec rm -f {} \;
|
|
verbose find . -name \*_reflect.\* -exec rm -f {} \;
|
|
verbose find . -not \( -name \*.tga -o -name \*.png -o -name \*.jpg \) -exec rm -f {} \;
|
|
# texture: convert to jpeg and dds
|
|
# music: reduce bitrate
|
|
verbose export do_jpeg=true
|
|
verbose export jpeg_qual_rgb=80
|
|
verbose export jpeg_qual_a=97
|
|
verbose export do_dds=false
|
|
verbose export do_ogg=true
|
|
verbose export ogg_qual=1
|
|
verbose export del_src=true
|
|
find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
|
|
;;
|
|
release-buildpk3)
|
|
release_common
|
|
src=$1
|
|
dst=$2
|
|
transform=$3
|
|
case "$dst" in
|
|
/*)
|
|
;;
|
|
*/)
|
|
dst="$PWD/$dst"
|
|
;;
|
|
esac
|
|
release_timereport
|
|
verbose rm -rf Xonotic/temp
|
|
release_timereport "deleted temp directory"
|
|
verbose mkdir -p Xonotic/temp
|
|
release_git_extract_dir "$src" "Xonotic/temp" .
|
|
release_timereport "extracted data"
|
|
verbose cd Xonotic/temp
|
|
if [ x"$src" = x"data/xonotic-data.pk3dir" ]; then
|
|
verbose cp ../source/progs.dat .
|
|
verbose cp ../source/csprogs.dat .
|
|
verbose cp ../source/menu.dat .
|
|
verbose rm -rf qcsrc
|
|
getversion .
|
|
case "$RELEASETYPE" in
|
|
release)
|
|
;;
|
|
*)
|
|
versionstr="$versionstr$RELEASETYPE"
|
|
;;
|
|
esac
|
|
if [ $gv -lt 9900 ]; then
|
|
# 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/;
|
|
" < defaultXonotic.cfg > defaultXonotic.cfg.new
|
|
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 ))/;
|
|
" < defaultXonotic.cfg > defaultXonotic.cfg.new
|
|
fi
|
|
mv defaultXonotic.cfg.new defaultXonotic.cfg
|
|
case "$RELEASETYPE" in
|
|
release)
|
|
echo "" >> defaultXonotic.cfg
|
|
echo "// nicer menu" >> defaultXonotic.cfg
|
|
echo "set menu_watermark \"\"" >> defaultXonotic.cfg
|
|
;;
|
|
esac
|
|
(
|
|
verbose cd gfx/menu/luminos
|
|
verbose rm -f background_l2.tga background_ingame_l2.tga
|
|
verbose cp "$d0"/mediasource/gfx/menu/luminos_versionbuilder/background_l2.svg .
|
|
verbose "$d0"/mediasource/gfx/menu/luminos_versionbuilder/versionbuilder "$versionstr"
|
|
verbose rm background_l2.svg
|
|
)
|
|
fi
|
|
if [ x"$src" = x"data/xonotic-maps.pk3dir" ]; then
|
|
for X in ../../data/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
|
|
if [ -f "$X" ]; then
|
|
verbose unzip "$X"
|
|
verbose rm -f maps/*.log maps/*.irc maps/*.lin
|
|
fi
|
|
done
|
|
fi
|
|
verbose export git_src_repo="$d0/$src" # skip hash-object
|
|
release_timereport "processed data"
|
|
verbose "$SELF" release-buildpk3-transform-$transform "Xonotic/temp"
|
|
release_timereport "transformed data"
|
|
find . -type f -size +4k | verbose "$d0"/misc/tools/symlink-deduplicate.sh
|
|
release_timereport "deduplicated data"
|
|
verbose mkzipr "../../$dst" *
|
|
release_timereport "zipped data"
|
|
verbose cd ../..
|
|
verbose rm -rf Xonotic/temp
|
|
release_timereport "deleted temp directory again"
|
|
;;
|
|
release-buildpk3s)
|
|
release_common
|
|
pk3stamp=`cat Xonotic/pk3stamp.txt`
|
|
src=$1
|
|
shift
|
|
dst=${src%.pk3dir}
|
|
case "$dst" in
|
|
data/xonotic-*)
|
|
dst="data/xonotic-$pk3stamp-${dst#data/xonotic-}"
|
|
;;
|
|
*)
|
|
dst="$dst-$pk3stamp"
|
|
;;
|
|
esac
|
|
while [ "$#" -gt 1 ]; do
|
|
verbose "$SELF" release-buildpk3 "$src" "Xonotic/$dst$2.pk3" "$1"
|
|
shift
|
|
shift
|
|
done
|
|
;;
|
|
release-pack)
|
|
release_common
|
|
verbose "$SELF" release-buildpk3s data/font-xolonium.pk3dir raw ''
|
|
verbose "$SELF" release-buildpk3s data/xonotic-data.pk3dir low '-low' normaldds '' webp '-high'
|
|
verbose "$SELF" release-buildpk3s data/xonotic-maps.pk3dir low '-low' normaldds '' mapping '-mapping' webp '-high'
|
|
verbose "$SELF" release-buildpk3s data/xonotic-music.pk3dir raw '' low '-low'
|
|
verbose "$SELF" release-buildpk3s data/xonotic-nexcompat.pk3dir normaldds ''
|
|
;;
|
|
release-pack-needsx11)
|
|
release_common
|
|
case "$DISPLAY" in
|
|
'')
|
|
verbose startx "$SELF" release-pack -- /usr/bin/Xvfb :7
|
|
;;
|
|
*)
|
|
verbose "$SELF" release-pack
|
|
;;
|
|
esac
|
|
;;
|
|
release-zip)
|
|
release_common
|
|
stamp=`cat Xonotic/stamp.txt`
|
|
pk3stamp=`cat Xonotic/pk3stamp.txt`
|
|
# exe and dll files do not need +x, so this makes them eligible for 7zip compression too
|
|
chmod a-x Xonotic/*.exe Xonotic/*.dll || true
|
|
for suffix in '' '-noaes'; do
|
|
# build the archives
|
|
verbose mkzip Xonotic-$stamp-enginesource$suffix.zip \
|
|
Xonotic/Makefile \
|
|
Xonotic/source/darkplaces/ \
|
|
Xonotic/COPYING Xonotic/GPL-2 Xonotic/GPL-3
|
|
verbose cp Xonotic-$stamp-enginesource$suffix.zip Xonotic-$stamp-engine$suffix.zip
|
|
verbose mkzip Xonotic-$stamp-engine$suffix.zip \
|
|
Xonotic/*.dll \
|
|
Xonotic/bin32/*.dll \
|
|
Xonotic/bin64/*.dll \
|
|
Xonotic/*.app \
|
|
Xonotic/xonotic-* \
|
|
Xonotic/xonotic.exe
|
|
verbose cp Xonotic-$stamp-engine$suffix.zip Xonotic-$stamp-common$suffix.zip
|
|
verbose mkzip Xonotic-$stamp-common$suffix.zip \
|
|
Xonotic/source/d0_blind_id/ \
|
|
Xonotic/source/gmqcc/ \
|
|
Xonotic/source/qcsrc/ \
|
|
Xonotic/Docs \
|
|
Xonotic/misc \
|
|
Xonotic/gmqcc \
|
|
Xonotic/server \
|
|
Xonotic/key_0.d0pk \
|
|
Xonotic/data/font-xolonium-$pk3stamp.pk3
|
|
verbose cp Xonotic-$stamp-enginesource$suffix.zip Xonotic-$stamp-source$suffix.zip
|
|
verbose mkzip Xonotic-$stamp-source$suffix.zip \
|
|
Xonotic/source/d0_blind_id/ \
|
|
Xonotic/source/gmqcc/ \
|
|
Xonotic/source/qcsrc/ \
|
|
Xonotic/misc/logos
|
|
verbose cp Xonotic-$stamp-common$suffix.zip Xonotic-$stamp$suffix.zip
|
|
verbose mkzip0 Xonotic-$stamp$suffix.zip \
|
|
Xonotic/data/xonotic-$pk3stamp-data.pk3 \
|
|
Xonotic/data/xonotic-$pk3stamp-maps.pk3 \
|
|
Xonotic/data/xonotic-$pk3stamp-music.pk3 \
|
|
Xonotic/data/xonotic-$pk3stamp-nexcompat.pk3
|
|
verbose cp Xonotic-$stamp-common$suffix.zip Xonotic-$stamp-low$suffix.zip
|
|
verbose mkzip0 Xonotic-$stamp-low$suffix.zip \
|
|
Xonotic/data/xonotic-$pk3stamp-data-low.pk3 \
|
|
Xonotic/data/xonotic-$pk3stamp-maps-low.pk3 \
|
|
Xonotic/data/xonotic-$pk3stamp-music-low.pk3
|
|
verbose mv Xonotic-$stamp-common$suffix.zip Xonotic-$stamp-high$suffix.zip
|
|
verbose mkzip0 Xonotic-$stamp-high$suffix.zip \
|
|
Xonotic/data/xonotic-$pk3stamp-data-high.pk3 \
|
|
Xonotic/data/xonotic-$pk3stamp-maps-high.pk3 \
|
|
Xonotic/data/xonotic-$pk3stamp-music.pk3
|
|
# let's pass crypto import laws of some nasty countries
|
|
find Xonotic -name \*d0_rijndael\*.so -o -name \*d0_rijndael\*.dylib -o -name \*d0_rijndael\*.dll -o -name \*d0_rijndael\*.c -delete
|
|
done
|
|
verbose mkzip Xonotic-$stamp-mappingsupport.zip \
|
|
Xonotic/mapping
|
|
verbose mkzip0 Xonotic-$stamp-mappingsupport.zip \
|
|
Xonotic/data/xonotic-$pk3stamp-maps-mapping.pk3
|
|
verbose mkzip gmqcc-$stamp.zip \
|
|
Xonotic/gmqcc \
|
|
Xonotic/source/gmqcc
|
|
;;
|
|
release)
|
|
release_common
|
|
verbose "$SELF" release-prepare
|
|
verbose "$SELF" release-maps
|
|
verbose "$SELF" release-engine
|
|
verbose "$SELF" release-qc
|
|
verbose "$SELF" release-pack-needsx11
|
|
verbose "$SELF" release-zip
|
|
;;
|
|
*)
|
|
handled=false
|
|
;;
|
|
esac
|