6 # I use this in EVERY shell script ;)
11 while ! [ -f ./all ]; do
12 if [ x"`pwd`" = x"/" ]; then
13 echo "Cannot find myself."
14 echo "Please run this script with the working directory inside a Xonotic checkout."
22 # If we are on WINDOWS:
27 # Windows hates users. So this script has to copy itself elsewhere first...
28 cp "$SELF" ../all.xonotic.sh
29 export WE_HATE_OUR_USERS=1
30 exec ../all.xonotic.sh "$@"
38 echo >&2 "
\e[1m$*
\e[m"
41 self=`git hash-object "$SELF"`
44 self_new=`git hash-object "$SELF"`
45 if [ x"$self" != x"$self_new" ]; then
46 msg "./all has changed."
47 if [ -z "$XONOTIC_FORBID_RERUN_ALL" ]; then
48 msg "Rerunning the requested operation to make sure."
49 export XONOTIC_FORBID_RERUN_ALL=1
52 msg "Please try $SELF update, and then retry your requested operation."
69 echo "the root directory"
79 if git ls-files -u | grep ' 1 '; then
81 echo "MERGE CONFLICT."
82 echo "change into the \"$1\" project directory, and then:"
83 echo "- edit the files mentioned above with your favorite editor,"
84 echo " and fix the conflicts (marked with <<<<<<< blocks)"
85 echo "- for binary files, you can select the files using"
86 echo " git checkout --ours or git checkout --theirs"
87 echo "- when done with a file, 'git add' the file"
88 echo "- when done, 'git commit'"
97 while [ x"$yesno" != x"y" -a x"$yesno" != x"n" ]; do
108 check_mergeconflict "$1"
113 data/xonotic-data.pk3dir | | master |
114 data/xonotic-maps.pk3dir | | master |
115 data/xonotic-music.pk3dir | | master |
116 data/xonotic-nexcompat.pk3dir | | master |
117 mediasource | | master |
118 darkplaces | | div0-stable | svn
119 fteqcc | git://github.com/Blub/qclib.git | master |
120 div0-gittools | | master |
121 netradiant | | master |
123 # todo: in darkplaces, change repobranch to div0-stable
125 repos=`echo "$repos_urls" | grep . | cut -d '|' -f 1 | tr -d ' '`
127 base=`git config remote.origin.url`
130 base=${base%xonotic.git}
133 echo "The main repo is not xonotic.git, what have you done?"
140 repo_t=`echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 2 | tr -d ' '`
141 if [ -n "$repo_t" ]; then
151 if [ x"$1" = x"." ]; then
152 echo "$base""xonotic.git"
154 echo "$base${1##*/}.git"
161 repo_t=`echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 3 | tr -d ' '`
162 if [ -n "$repo_t" ]; then
171 echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 4 | tr -d ' '
174 repos=`for d in $repos; do
176 if [ x"$p" = x"$d" ] || [ -d "$d" ] || ! { [ -f "$d.no" ] || [ -f "$p" ]; }; then
181 if [ "$#" = 0 ]; then
187 fix_upstream_rebase()
189 if [ -z "$r_me" ] || [ -z "$r_other" ]; then
192 r_base=`git merge-base "$r_me" "$r_other"`
194 # no merge-base? upstream did filter-branch
195 if [ -n "$r_base" ]; then
196 # otherwise, check if the two histories are "similar"
197 r_l_me=`git log --pretty="format:%s" "$r_other".."$r_me" | grep -v "^Merge" | sort -u`
198 r_l_other=`git log --pretty="format:%s" "$r_me".."$r_other" | grep -v "^Merge" | sort -u`
200 # heuristics: upstream rebase/filter-branch if more than 50% of the commits of one of the sides are in the other too
201 r_lc_me=`echo "$r_l_me" | wc -l`
202 r_lc_other=`echo "$r_l_other" | wc -l`
203 r_lc_together=`{ echo "$r_l_me"; echo "$r_l_other"; } | sort -u | wc -l`
204 r_lc_same=$(($r_lc_me + $r_lc_other - $r_lc_together))
206 if [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_me )) ] || [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_other )) ]; then
207 if yesno "Probable upstream rebase detected, automatically fix?" 'git log --oneline --graph --date-order --left-right "$r_other"..."$r_me"'; then
208 git reset --hard "$r_me"
218 fix_upstream_rebase_mergeok()
220 r_me=`git rev-parse --revs-only HEAD^1 2>/dev/null || true`
221 r_other=`git rev-parse --revs-only HEAD^2 2>/dev/null || true`
225 fix_upstream_rebase_mergefail()
227 r_me=`git rev-parse --revs-only HEAD 2>/dev/null || true`
228 r_other=`git rev-parse --revs-only MERGE_HEAD 2>/dev/null || true`
235 enter "$d0/$d" verbose
236 verbose fix_upstream_rebase_mergefail && verbose fix_upstream_rebase_mergeok
241 if [ x"$1" = x"-N" ]; then
246 branch=`repobranch "$d"`
247 if [ -d "$d0/$d" ]; then
249 enter "$d0/$d" verbose
250 verbose git config remote.origin.url "$url"
251 verbose git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
253 verbose git config core.autocrlf input
255 r=`git symbolic-ref HEAD`
257 if git config branch.$r.remote >/dev/null 2>&1; then
258 if ! verbose git pull; then
259 fix_upstream_rebase_mergefail || true
260 check_mergeconflict "$d"
261 echo "Pulling failed. Press ENTER to continue, or Ctrl-C to abort."
264 fix_upstream_rebase_mergeok || true
269 checkself "$cmd" "$@"
271 verbose git remote prune origin
275 verbose git clone "$url" "$d0/$d"
276 enter "$d0/$d" verbose
277 if [ "$branch" != "master" ]; then
278 verbose git checkout --track -b "$branch" origin/"$branch"
285 misc/tools/xonotic-map-compiler-autobuild download
289 if [ x"$1" = x"-f" ]; then
295 if [ -z "$branch" ]; then
298 branch=${remote#origin/}
309 enter "$d0/$d" verbose
311 if [ -n "$b" ] && git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
313 verbose git checkout $checkoutflags "$b"
314 elif [ -n "$b" ] && git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
316 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
319 if git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
321 verbose git checkout $checkoutflags "$b"
322 elif git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
324 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
326 echo "WTF? Not even branch $b doesn't exist in $d"
331 checkself "$cmd" "$@"
335 echo "The requested branch was not found in any repository."
343 if [ -z "$branch" ]; then
347 if [ -z "$branch" ]; then
350 r=`git symbolic-ref HEAD`
357 dv=`visible_repo_name "$d"`
358 enter "$d0/$d" verbose
359 if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
360 echo "Already having this branch in $dv."
362 if yesno "Branch in $dv?"; then
363 if [ -n "$srcbranch" ]; then
366 b=origin/"`repobranch "$d"`"
367 verbose git fetch origin || true
369 # TODO do this without pushing
370 verbose git checkout -b "$branch" "$b"
371 verbose git config "branch.$branch.remote" "$remote"
372 verbose git config "branch.$branch.merge" "refs/heads/$branch"
382 cd "$d0/$d" # am in a pipe, shouldn't use enter
383 git branch -a -v -v | cut -c 3- | sed "s/^(no branch)/(no_branch)/" | sed "s,^,$d ,"
388 while read -r d BRANCH REV UPSTREAM TEXT; do
389 if [ x"$BRANCH" = x"`repobranch "$d"`" ]; then
394 UPSTREAM=${UPSTREAM#\[}
395 UPSTREAM=${UPSTREAM%\]}
396 UPSTREAM=${UPSTREAM%:*}
399 TEXT="$UPSTREAM $TEXT"
403 if [ x"$REV" = x"->" ]; then
406 BRANCH=${BRANCH#remotes/}
407 ID=`echo "$BRANCH" | tr -c "A-Za-z0-9." "_"`
408 branches_list="$branches_list $BRANCH" # TEH SORT MAKEZ IT UNIEQ
409 eval "r=\$branches_repos_$ID"
418 eval "branches_repos_$ID=\$r"
420 echo -n "$branches_list" | xargs -n 1 echo | sort -u | while IFS= read -r BRANCH; do
421 ID=`echo "$BRANCH" | tr -c "A-Za-z0-9." "_"`
422 eval "r=\$branches_repos_$ID"
423 printf "%-60s %s\n" "$BRANCH" "$r"
430 dv=`visible_repo_name "$d"`
431 enter "$d0/$d" verbose
432 r=`git symbolic-ref HEAD`
434 if git log HEAD..origin/"`repobranch "$d"`" | grep .; then
435 # we have uncommitted changes
436 if yesno "Could merge from \"`repobranch "$d"`\" into \"$r\" in $dv. Do it?"; then
437 if ! verbose git merge origin/"`repobranch "$d"`"; then
438 check_mergeconflict "$d"
439 exit 1 # this should ALWAYS be fatal
449 dv=`visible_repo_name "$d"`
450 enter "$d0/$d" verbose
451 r=`git symbolic-ref HEAD`
453 diffdata=`git diff --color HEAD`
454 if [ -n "$diffdata" ]; then
455 # we have uncommitted changes
456 if yesno "Uncommitted changes in \"$r\" in $dv. Commit?" 'echo "$diffdata" | less -r'; then
457 verbose git commit -a
460 rem=`git config "branch.$r.remote" || echo origin`
461 bra=`git config "branch.$r.merge" || echo "$r"`
462 upstream="$rem/${bra#refs/heads/}"
463 if ! git rev-parse "$upstream" >/dev/null 2>&1; then
464 upstream="origin/`repobranch "$d"`"
466 logdata=`git log --color "$upstream".."$r"`
467 if [ -n "$logdata" ]; then
468 if yesno "Push \"$r\" in $dv?" 'echo "$logdata" | less -r'; then
469 verbose git push "$rem" HEAD
472 if [ x"$submit" = x"-s" ]; then
475 verbose git push "$rem" HEAD:"${bra%%/*}/finished/${bra#*/}"
483 if [ -n "$WE_HATE_OUR_USERS" ]; then
484 TARGETS="sv-debug cl-debug"
485 if [ -z "$CC" ]; then
488 elif [ x"`uname`" = x"Darwin" ]; then
491 TARGETS="sv-debug cl-debug sdl-debug"
494 # AGL cannot be compiled on systems with a kernel > 10.x (Snow Leopard)
495 TARGETS="sv-debug sdl-debug"
498 export CC="gcc -I$PWD/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks/SDL.framework/Headers -F$PWD/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks"
500 TARGETS="sv-debug cl-debug sdl-debug"
518 cleanqc=true # version info
521 if [ $# -gt 0 ] && [ x"$1" = x"" ]; then
522 # if we give the command make the arg "", it will surely fail (invalid filename),
523 # so better handle it as an empty client option
526 elif [ -n "$1" ]; then
528 TARGETS_SAVE=$TARGETS
533 TARGETS="$TARGETS sdl-debug"
536 TARGETS="$TARGETS cl-debug"
539 TARGETS="$TARGETS sv-debug"
542 BAD_TARGETS="$BAD_TARGETS $X"
546 if [ -n "$TARGETS" ]; then # at least a valid client
548 else # no valid client, let's assume this option is not meant to be a client then
549 TARGETS=$TARGETS_SAVE
553 if [ -z "$MAKEFLAGS" ]; then
554 if [ -f /proc/cpuinfo ]; then
555 ncpus=$((`grep -c '^processor :' /proc/cpuinfo`+0))
556 if [ $ncpus -gt 1 ]; then
562 MAKEFLAGS="$MAKEFLAGS DP_LINK_TO_LIBJPEG=1"
565 if [ -n "$WE_HATE_OUR_USERS" ]; then
566 MAKEFLAGS="$MAKEFLAGS DP_MAKE_TARGET=mingw"
570 enter "$d0/fteqcc" verbose
572 verbose make $MAKEFLAGS clean
574 verbose make $MAKEFLAGS
576 enter "$d0/data/xonotic-data.pk3dir" verbose
578 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" "$@" $MAKEFLAGS clean
580 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" "$@" $MAKEFLAGS
582 enter "$d0/darkplaces" verbose
583 if [ x"$BAD_TARGETS" = x" " ]; then
584 echo "Warning: invalid empty client, default clients will be used."
587 verbose make $MAKEFLAGS clean
589 for T in $TARGETS; do
590 verbose make $MAKEFLAGS "$@" "$T"
592 for T in $BAD_TARGETS; do
593 echo "Warning: discarded invalid client $T."
596 verbose "$SELF" update-maps
599 if [ -n "$WE_HATE_OUR_USERS" ]; then
601 export PATH="$d0/misc/buildfiles/win64:$d0/misc/buildfiles/win32:$PATH"
602 elif [ x"`uname`" = x"Darwin" ]; then
603 export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/MacOS"
604 export DYLD_FRAMEWORK_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks"
610 sdl|glx|agl|dedicated)
619 if ! [ -x "darkplaces/darkplaces$client" ]; then
620 if [ -x "darkplaces/darkplaces$client.exe" ]; then
623 echo "Client darkplaces/darkplaces$client not found, aborting"
627 set -- "darkplaces/darkplaces$client" -nexuiz -customgamename Xonotic -customgamedirname1 data -customgamedirname2 "" -customgamescreenshotname xonotic -customgameuserdirname xonotic -mygames "$@"
629 # if pulseaudio is running: USE IT
630 if [ -z "$SDL_AUDIODRIVER" ] && ! [ -n "$WE_HATE_OUR_USERS" ] && ! [ x"`uname`" = x"Darwin" ]; then
631 if ps -C pulseaudio >/dev/null; then
632 if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
633 export SDL_AUDIODRIVER=pulse
638 if [ -n "$USE_GDB" ]; then
639 set -- gdb --args "$@"
645 if [ x"$1" = x"-k" ]; then
650 if verbose cd "$d0/$d"; then
662 patchdir=`mktemp -d -t save-patches.XXXXXX`
664 enter "$d0/$d" verbose
665 git branch -v -v | cut -c 3- | {
667 while read -r BRANCH REV UPSTREAM TEXT; do
670 UPSTREAM=${UPSTREAM#\[}
671 UPSTREAM=${UPSTREAM%\]}
672 UPSTREAM=${UPSTREAM%:*}
676 UPSTREAM=origin/"`repobranch "$d"`"
680 if [ x"$REV" = x"->" ]; then
683 if git format-patch -o "$patchdir/$i" "$UPSTREAM".."$BRANCH"; then
684 echo "$d" > "$patchdir/$i/info.txt"
685 echo "$BRANCH" >> "$patchdir/$i/info.txt"
686 echo "$UPSTREAM" >> "$patchdir/$i/info.txt"
687 echo "$TRACK" >> "$patchdir/$i/info.txt"
690 rm -rf "$patchdir/$i"
695 ( cd "$patchdir" && tar cvzf - . ) > "$outfile"
700 patchdir=`mktemp -d -t restore-patches.XXXXXX`
701 ( cd "$patchdir" && tar xvzf - ) < "$infile"
703 for P in "$patchdir"/*/info.txt; do
710 verbose git checkout HEAD^0
711 verbose git branch -D "$BRANCH"
712 if [ x"$TRACK" = x"true" ]; then
713 verbose git checkout --track -b "$BRANCH" "$UPSTREAM"
715 verbose git branch -b "$BRANCH" "$UPSTREAM"
727 report=$report"$*$LF"
732 report=$report" $*$LF"
737 o=`"$@" | sed 's/^/ /' || true`
741 enter "$d0/$d" verbose
742 base="`repobranch "$d"`"
744 for ref in `git for-each-ref --format='%(refname)' refs/remotes/origin/`; do
745 case "${ref#refs/remotes/origin/}" in
758 if [ -n "$branch" ]; then
759 if [ x"$branch" != x"${ref#refs/remotes/origin/}" ]; then
768 l0=`git rev-list "$base".."$ref" | wc -l`
769 l1=`git rev-list master.."$ref" | wc -l`
770 if [ $l0 -gt $l1 ]; then
777 reportecho " Branch $ref:"
778 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
779 logdata=`git log --color "$realbase".."$ref"`
780 if [ -z "$logdata" ]; then
781 reportecho4 "--> not merging, no changes vs master"
782 if yesno "Branch \"$ref\" probably should get deleted. Do it?" ''; then
783 git push origin :"${ref#refs/remotes/origin/}"
784 reportecho4 "--> branch deleted"
787 diffdata=`git diff --color --find-copies-harder --ignore-space-change "$realbase"..."$ref"`
788 if [ -z "$diffdata" ]; then
789 reportecho4 "--> not merging, no changes vs master, branch contains redundant history"
790 if yesno "Branch \"$ref\" probably should get deleted. Do it?" '{ echo "$logdata"; } | less -r'; then
791 git push origin :"${ref#refs/remotes/origin/}"
792 reportecho4 "--> branch deleted"
794 elif [ -z "$branch" ] && [ -n "$note" ]; then
795 reportdo4 echo "$note"
796 reportecho4 "--> not merging, already had this one rejected before"
797 elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ echo "$logdata"; echo "$diffdata"; } | less -r'; then
798 git checkout "$realbase"
799 org=`git rev-parse HEAD`
800 if ! git merge --no-ff "$ref" 2>&1 | tee "$t" && ! { git ls-files -u | grep ' 1 ' >/dev/null; }; then
801 git reset --hard "$org"
802 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Merge failed:$LF`cat "$t"`" "$ref"
804 reportecho4 "--> merge failed"
805 elif ! "$SELF" compile -n 2>&1 | tee "$t"; then
806 git reset --hard "$org"
807 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Compile failed:$LF`cat "$t"`" "$ref"
809 reportecho4 "--> compile failed"
810 elif ! yesno "Still merge \"$ref\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
811 git reset --hard "$org"
812 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
813 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
814 if [ x"$note" = x"del" ]; then
815 git push origin :"${ref#refs/remotes/origin/}"
816 reportecho4 "--> test failed, branch deleted"
817 elif [ -n "$note" ]; then
818 reportdo4 echo "$note"
819 reportecho4 "--> test failed"
821 reportecho4 "--> test failed, postponed"
825 case ",`repoflags "$d"`," in
827 # we do quite a mess here... luckily we know $org
828 git fetch # svn needs to be current
829 git rebase -i --onto origin/master "$org"
830 git svn dcommit --add-author-from
831 git reset --hard "$org"
837 reportecho4 "--> MERGED"
838 if yesno "Delete original branch \"$ref\"?"; then
839 git push origin :"${ref#refs/remotes/origin/}"
840 reportecho4 "--> branch deleted"
844 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
845 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
846 if [ x"$note" = x"del" ]; then
847 git push origin :"${ref#refs/remotes/origin/}"
848 reportecho4 "--> branch deleted"
849 elif [ -n "$note" ]; then
850 reportdo4 echo "$note"
851 reportecho4 "--> rejected"
853 reportecho4 "--> postponed"
862 echo "$report" | ssh nexuiz@rm.endoftheinternet.org cat '>>' public_html/xonotic-merge-notes.txt
866 if [ x"$1" = x"-f" ]; then
870 enter "$d0/$d" verbose
872 verbose git checkout-index -fa
876 verbose git clean -df
879 verbose git clean -xdf
885 # release building goes here
887 #"$SELF" each git clean -fxd
888 case "$RELEASETYPE" in
890 msg "Building a BETA"
893 msg "Building a RELEASE"
896 msg "Must either set RELEASETYPE=beta or RELEASETYPE=release"
900 verbose rm -rf Xonotic Xonotic*.zip
901 verbose mkdir -p Xonotic
902 verbose date +%Y%m%d > Xonotic/stamp.txt
903 verbose git archive --format=tar HEAD -- Docs misc server xonotic-linux-glx.sh xonotic-linux-sdl.sh misc/buildfiles | {
905 verbose mkdir data fteqcc source source/darkplaces source/fteqcc
907 verbose rm -rf misc/builddeps
908 verbose mv misc/buildfiles/win32/* . || true
909 verbose mv misc/buildfiles/win64 bin64 || true
910 verbose mv misc/buildfiles/osx/* . || true
911 verbose rm -rf misc/buildfiles
914 verbose cd darkplaces
915 verbose git archive --format=tar HEAD
917 verbose cd Xonotic/source/darkplaces
922 verbose git archive --format=tar HEAD
924 verbose cd Xonotic/source/fteqcc
928 verbose cd data/xonotic-data.pk3dir
929 verbose git archive --format=tar HEAD -- qcsrc Makefile
931 verbose cd Xonotic/source
942 case " $HOSTS_THAT_ARE_MYSELF " in
944 verbose rsync --delete -zvaSHP "$srcdir"/ "$buildpath/"
945 verbose eval make -C "$buildpath" clean $maketargets $makeflags
946 for f in $targetfiles; do
947 verbose mv "$buildpath/${f%:*}" "${f##*:}" || true
951 verbose rsync --delete -zvaSHP "$srcdir"/ "$host:$buildpath/"
952 verbose ssh "$host" ". ~/.profile && cd $buildpath && make clean $maketargets $makeflags"
953 for f in $targetfiles; do
954 verbose rsync -zvaSHP "$host:$buildpath/${f%:*}" "${f##*:}" || true
958 # now rebrand the binaries...
959 for f in $targetfiles; do
960 verbose "$d0/misc/tools/rebrand-darkplaces-engine.sh" "$d0/misc/tools/xonotic.brand" "${f##*:}" || true
966 fteqcc_maketargets=$3
968 darkplaces_maketargets=$5
970 verbose "$SELF" release-compile-run "xonotic-build-$suffix" /tmp/fteqcc.build."$suffix" "$fteqcc_maketargets" "$makeflags" "Xonotic/source/fteqcc" "$fteqcc_files"
971 verbose "$SELF" release-compile-run "xonotic-build-$suffix" /tmp/Darkplaces.build."$suffix" "$darkplaces_maketargets" "$makeflags" "Xonotic/source/darkplaces" "$darkplaces_files"
973 release-engine-win32)
974 verbose "$SELF" release-compile win32 \
975 'STRIP=: DP_MAKE_TARGET=mingw CC="i586-mingw32msvc-gcc -g -Wl,--dynamicbase -Wl,--nxcompat -DSUPPORTDIRECTX -DUSE_WSPIAPI_H -I$HOME/dp.win32/include -L$HOME/dp.win32/lib" WINDRES="i586-mingw32msvc-windres" SDL_CONFIG="$HOME/dp.win32/bin/sdl-config"' \
976 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc.exe' \
977 release 'darkplaces.exe:Xonotic/xonotic.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe'
979 release-engine-win64)
980 verbose "$SELF" release-compile win64 \
981 'STRIP=: DP_MAKE_TARGET=mingw CC="amd64-mingw32msvc-gcc -g -Wl,--dynamicbase -Wl,--nxcompat -DSUPPORTDIRECTX -DUSE_WSPIAPI_H -I$HOME/dp.win64/include -L$HOME/dp.win64/lib" WINDRES="amd64-mingw32msvc-windres" SDL_CONFIG="$HOME/dp.win64/bin/sdl-config" LDFLAGS_WINCOMMON=""' \
982 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc-x64.exe' \
983 'sv-release cl-release' 'darkplaces.exe:Xonotic/xonotic-x64.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated-x64.exe'
984 # release 'darkplaces.exe:Xonotic/xonotic-x64.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl-x64.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated-x64.exe'
987 # gcc on OSX is buggy, needs -fno-reorder-blocks for a release build to succeed
988 verbose "$SELF" release-compile osx \
989 'STRIP=: CC="gcc -g -arch i386 -arch ppc -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.4 -I$HOME/dp.osx/include -L$HOME/dp.osx/lib -fno-reorder-blocks"' \
990 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.osx' \
991 'sv-release sdl-release' 'darkplaces-sdl:Xonotic/Xonotic-SDL.app/Contents/MacOS/xonotic-osx-sdl-bin' 'darkplaces-dedicated:xonotic-osx-dedicated'
993 release-engine-linux32)
994 verbose "$SELF" release-compile linux32 \
995 'STRIP=: CC="gcc -m32 -g -Wl,--hash-style=sysv -I$HOME/dp.linux32/include -L$HOME/dp.linux32/lib" DP_MODPLUG_STATIC_LIBDIR=$HOME/dp.linux32/lib DP_LINK_TO_LIBJPEG=1' \
996 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux32' \
997 release 'darkplaces-glx:Xonotic/xonotic-linux32-glx darkplaces-sdl:Xonotic/xonotic-linux32-sdl darkplaces-dedicated:Xonotic/xonotic-linux32-dedicated'
999 release-engine-linux64)
1000 verbose "$SELF" release-compile linux64 \
1001 'STRIP=: CC="gcc -m64 -g -Wl,--hash-style=sysv -I$HOME/dp.linux64/include -L$HOME/dp.linux64/lib" DP_MODPLUG_STATIC_LIBDIR=$HOME/dp.linux64/lib DP_LINK_TO_LIBJPEG=1' \
1002 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux64' \
1003 release 'darkplaces-glx:Xonotic/xonotic-linux64-glx darkplaces-sdl:Xonotic/xonotic-linux64-sdl darkplaces-dedicated:Xonotic/xonotic-linux64-dedicated'
1006 verbose "$SELF" release-engine-win64
1007 verbose "$SELF" release-engine-osx
1008 verbose "$SELF" release-engine-win32
1009 verbose "$SELF" release-engine-linux32
1010 verbose "$SELF" release-engine-linux64
1013 verbose "$SELF" update-maps
1016 case "$RELEASETYPE" in
1018 verbose make -C Xonotic/source FTEQCC="$d0/Xonotic/fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 clean all
1021 verbose make -C Xonotic/source FTEQCC="$d0/Xonotic/fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 FTEQCCFLAGS_WATERMARK= clean all
1024 verbose rm -f Xonotic/source/*/fteqcc.log
1026 release-buildpk3-transform-raw)
1029 release-buildpk3-transform-normal)
1032 # texture: convert to jpeg and dds
1033 verbose export do_jpeg=true
1034 verbose export jpeg_qual_rgb=95
1035 verbose export jpeg_qual_a=99
1036 verbose export do_dds=true
1037 verbose export dds_flags=
1038 verbose export do_ogg=false
1039 verbose export del_src=true
1040 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1042 release-buildpk3-transform-low)
1045 # texture: convert to jpeg and dds
1046 # music: reduce bitrate
1047 verbose export do_jpeg=true
1048 verbose export jpeg_qual_rgb=80
1049 verbose export jpeg_qual_a=95
1050 verbose export do_dds=false
1051 verbose export do_ogg=true
1052 verbose export ogg_qual=1
1053 verbose export del_src=true
1054 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1056 release-buildpk3-transform-lowdds)
1059 # texture: convert to jpeg and dds
1060 # music: reduce bitrate
1061 verbose export do_jpeg=false
1062 verbose export do_jpeg_if_not_dds=true
1063 verbose export jpeg_qual_rgb=80
1064 verbose export jpeg_qual_a=95
1065 verbose export do_dds=true
1066 verbose export dds_flags=
1067 verbose export do_ogg=true
1068 verbose export ogg_qual=1
1069 verbose export del_src=true
1070 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1083 verbose rm -rf Xonotic/temp
1084 verbose mkdir -p Xonotic/temp
1087 verbose git archive --format=tar HEAD
1089 verbose cd Xonotic/temp
1092 verbose cd Xonotic/temp
1093 if [ x"$src" = x"data/xonotic-data.pk3dir" ]; then
1094 verbose cp ../source/progs.dat .
1095 verbose cp ../source/csprogs.dat .
1096 verbose cp ../source/menu.dat .
1097 verbose rm -rf qcsrc
1098 gv=`grep "^gameversion " "defaultXonotic.cfg" | awk '{ print $2 }'`
1099 major=$(($gv / 10000))
1100 minor=$(($gv / 100 - $major * 100))
1101 patch=$(($gv - $major * 10000 - $minor * 100))
1103 s/^set g_xonoticversion [^ ]* /set g_xonoticversion $major.$minor.$patch /;
1104 s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
1105 s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/;
1106 " defaultXonotic.cfg
1108 if [ x"$src" = x"data/xonotic-maps.pk3dir" ]; then
1109 for X in ../../data/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
1110 if [ -f "$X" ]; then
1115 verbose "$SELF" release-buildpk3-transform-$transform "Xonotic/temp"
1116 verbose zip -9yr "../../$dst" .
1118 verbose rm -rf Xonotic/temp
1121 stamp=`cat Xonotic/stamp.txt`
1127 dst="data/xonotic-$stamp-${dst#data/xonotic-}"
1133 while [ "$#" -gt 1 ]; do
1134 verbose "$SELF" release-buildpk3 "$src" "Xonotic/$dst$2.pk3" "$1"
1140 verbose "$SELF" release-buildpk3s data/font-nimbussansl.pk3dir raw ''
1141 verbose "$SELF" release-buildpk3s data/xonotic-data.pk3dir normal '' raw '-raw' low '-low' lowdds '-lowdds'
1142 verbose "$SELF" release-buildpk3s data/xonotic-maps.pk3dir normal '' raw '-raw' low '-low' lowdds '-lowdds'
1143 verbose "$SELF" release-buildpk3s data/xonotic-music.pk3dir raw '' low '-low'
1144 verbose "$SELF" release-buildpk3s data/xonotic-nexcompat.pk3dir low ''
1146 release-pack-needsx11)
1149 verbose startx "$SELF" release-pack -- /usr/bin/Xvfb :7
1152 verbose "$SELF" release-pack
1157 stamp=`cat Xonotic/stamp.txt`
1158 verbose zip -9yr Xonotic-$stamp-common.zip \
1167 Xonotic/xonotic.exe \
1168 Xonotic/data/font-nimbussansl-$stamp.pk3
1169 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp.zip
1170 verbose zip -0yr Xonotic-$stamp.zip \
1171 Xonotic/data/xonotic-$stamp-data.pk3 \
1172 Xonotic/data/xonotic-$stamp-maps.pk3 \
1173 Xonotic/data/xonotic-$stamp-music.pk3 \
1174 Xonotic/data/xonotic-$stamp-nexcompat.pk3
1175 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-low.zip
1176 verbose zip -0yr Xonotic-$stamp-low.zip \
1177 Xonotic/data/xonotic-$stamp-data-low.pk3 \
1178 Xonotic/data/xonotic-$stamp-maps-low.pk3 \
1179 Xonotic/data/xonotic-$stamp-music-low.pk3
1180 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-lowdds.zip
1181 verbose zip -0yr Xonotic-$stamp-lowdds.zip \
1182 Xonotic/data/xonotic-$stamp-data-lowdds.pk3 \
1183 Xonotic/data/xonotic-$stamp-maps-lowdds.pk3 \
1184 Xonotic/data/xonotic-$stamp-music-low.pk3
1185 verbose mv Xonotic-$stamp-common.zip Xonotic-$stamp-high.zip
1186 verbose zip -0yr Xonotic-$stamp-high.zip \
1187 Xonotic/data/xonotic-$stamp-data-raw.pk3 \
1188 Xonotic/data/xonotic-$stamp-maps-raw.pk3 \
1189 Xonotic/data/xonotic-$stamp-music.pk3 \
1190 Xonotic/data/xonotic-$stamp-nexcompat.pk3
1193 verbose "$SELF" release-prepare
1194 verbose "$SELF" release-maps
1195 verbose "$SELF" release-engine
1196 verbose "$SELF" release-qc
1197 verbose "$SELF" release-pack-needsx11
1198 verbose "$SELF" release-zip
1205 echo " $SELF push [-s]"
1206 echo " $SELF branches"
1207 echo " $SELF branch [<remote>] <branchname>"
1208 echo " $SELF branch <remote> <branchname> <srcbranchname>"
1209 echo " $SELF checkout [<remote>] <branchname>"
1210 echo " $SELF compile [-c|-n] [<client>] <options>"
1211 echo " $SELF run [<client>] <options>"
1212 echo " $SELF each <command>"