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 | no
117 mediasource | | master | no
118 darkplaces | | div0-stable | svn
119 fteqcc | git://github.com/Blub/qclib.git | master |
120 div0-gittools | | master | no
121 netradiant | | master |
122 d0_blind_id | http://github.com/divVerent/d0_blind_id.git | master |
124 # todo: in darkplaces, change repobranch to div0-stable
126 repos=`echo "$repos_urls" | grep . | cut -d '|' -f 1 | tr -d ' '`
128 base=`git config remote.origin.url`
131 base=${base%xonotic.git}
134 echo "The main repo is not xonotic.git, what have you done?"
141 repo_t=`echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 2 | tr -d ' '`
142 if [ -n "$repo_t" ]; then
152 if [ x"$1" = x"." ]; then
153 echo "$base""xonotic.git"
155 echo "$base${1##*/}.git"
162 repo_t=`echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 3 | tr -d ' '`
163 if [ -n "$repo_t" ]; then
172 echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 4 | tr -d ' '
180 # if we have the dir, always keep it
182 msg "Repository $d enabled because it already exists"
186 # if .yes file exists, always keep it
187 if [ -f "$d.yes" ]; then
188 msg "Repository $d enabled by a .yes file"
192 # if we have .no file, skip
193 if [ -f "$d.no" ]; then
194 msg "Repository $d disabled by a .no file, delete $p.no to enable"
197 # if we have matching pk3, skip
198 if [ x"$p" != x"$d" ] && [ -f "$p" ]; then
199 msg "Repository $d disabled by matching .pk3 file, delete $p or create $d.yes to enable"
202 # if "no" flag is set, skip
205 msg "Repository $d disabled by default, create $d.yes to enable"
210 msg "Repository $d enabled by default"
217 if [ "$#" = 0 ]; then
223 fix_upstream_rebase()
225 if [ -z "$r_me" ] || [ -z "$r_other" ]; then
228 r_base=`git merge-base "$r_me" "$r_other"`
230 # no merge-base? upstream did filter-branch
231 if [ -n "$r_base" ]; then
232 # otherwise, check if the two histories are "similar"
233 r_l_me=`git log --pretty="format:%s" "$r_other".."$r_me" | grep -v "^Merge" | sort -u`
234 r_l_other=`git log --pretty="format:%s" "$r_me".."$r_other" | grep -v "^Merge" | sort -u`
236 # heuristics: upstream rebase/filter-branch if more than 50% of the commits of one of the sides are in the other too
237 r_lc_me=`echo "$r_l_me" | wc -l`
238 r_lc_other=`echo "$r_l_other" | wc -l`
239 r_lc_together=`{ echo "$r_l_me"; echo "$r_l_other"; } | sort -u | wc -l`
240 r_lc_same=$(($r_lc_me + $r_lc_other - $r_lc_together))
242 if [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_me )) ] || [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_other )) ]; then
243 if yesno "Probable upstream rebase detected, automatically fix?" 'git log --oneline --graph --date-order --left-right "$r_other"..."$r_me"'; then
244 git reset --hard "$r_me"
254 fix_upstream_rebase_mergeok()
256 r_me=`git rev-parse --revs-only HEAD^1 2>/dev/null || true`
257 r_other=`git rev-parse --revs-only HEAD^2 2>/dev/null || true`
261 fix_upstream_rebase_mergefail()
263 r_me=`git rev-parse --revs-only HEAD 2>/dev/null || true`
264 r_other=`git rev-parse --revs-only MERGE_HEAD 2>/dev/null || true`
270 verbose git config core.autocrlf input
271 if [ -z "`git config push.default`" ]; then
272 verbose git config push.default current # or is tracking better?
279 enter "$d0/$d" verbose
280 verbose fix_upstream_rebase_mergefail && verbose fix_upstream_rebase_mergeok
285 if [ x"$1" = x"-N" ]; then
290 branch=`repobranch "$d"`
291 if [ -d "$d0/$d" ]; then
293 enter "$d0/$d" verbose
295 verbose git config remote.origin.url "$url"
296 verbose git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
297 r=`git symbolic-ref HEAD`
299 if git config branch.$r.remote >/dev/null 2>&1; then
300 if ! verbose git pull; then
301 fix_upstream_rebase_mergefail || true
302 check_mergeconflict "$d"
303 echo "Pulling failed. Press ENTER to continue, or Ctrl-C to abort."
306 fix_upstream_rebase_mergeok || true
311 checkself "$cmd" "$@"
313 verbose git remote prune origin
317 verbose git clone "$url" "$d0/$d"
318 enter "$d0/$d" verbose
320 if [ "$branch" != "master" ]; then
321 verbose git checkout --track -b "$branch" origin/"$branch"
328 misc/tools/xonotic-map-compiler-autobuild download
332 if [ x"$1" = x"-f" ]; then
338 if [ -z "$branch" ]; then
341 branch=${remote#origin/}
352 enter "$d0/$d" verbose
354 if [ -n "$b" ] && git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
356 verbose git checkout $checkoutflags "$b"
357 elif [ -n "$b" ] && git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
359 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
362 if git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
364 verbose git checkout $checkoutflags "$b"
365 elif git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
367 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
369 echo "WTF? Not even branch $b doesn't exist in $d"
374 checkself "$cmd" "$@"
378 echo "The requested branch was not found in any repository."
386 if [ -z "$branch" ]; then
390 if [ -z "$branch" ]; then
393 r=`git symbolic-ref HEAD`
400 dv=`visible_repo_name "$d"`
401 enter "$d0/$d" verbose
402 if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
403 echo "Already having this branch in $dv."
405 if yesno "Branch in $dv?"; then
406 if [ -n "$srcbranch" ]; then
409 b=origin/"`repobranch "$d"`"
410 verbose git fetch origin || true
412 # TODO do this without pushing
413 verbose git checkout -b "$branch" "$b"
414 verbose git config "branch.$branch.remote" "$remote"
415 verbose git config "branch.$branch.merge" "refs/heads/$branch"
425 cd "$d0/$d" # am in a pipe, shouldn't use enter
426 git branch -a -v -v | cut -c 3- | sed "s/^(no branch)/(no_branch)/" | sed "s,^,$d ,"
431 while read -r d BRANCH REV UPSTREAM TEXT; do
432 if [ x"$BRANCH" = x"`repobranch "$d"`" ]; then
437 UPSTREAM=${UPSTREAM#\[}
438 UPSTREAM=${UPSTREAM%\]}
439 UPSTREAM=${UPSTREAM%:*}
442 TEXT="$UPSTREAM $TEXT"
446 if [ x"$REV" = x"->" ]; then
449 BRANCH=${BRANCH#remotes/}
450 ID=`echo "$BRANCH" | tr -c "A-Za-z0-9." "_"`
451 branches_list="$branches_list $BRANCH" # TEH SORT MAKEZ IT UNIEQ
452 eval "r=\$branches_repos_$ID"
461 eval "branches_repos_$ID=\$r"
463 echo -n "$branches_list" | xargs -n 1 echo | sort -u | while IFS= read -r BRANCH; do
464 ID=`echo "$BRANCH" | tr -c "A-Za-z0-9." "_"`
465 eval "r=\$branches_repos_$ID"
466 printf "%-60s %s\n" "$BRANCH" "$r"
473 dv=`visible_repo_name "$d"`
474 enter "$d0/$d" verbose
475 r=`git symbolic-ref HEAD`
477 if git log HEAD..origin/"`repobranch "$d"`" | grep .; then
478 # we have uncommitted changes
479 if yesno "Could merge from \"`repobranch "$d"`\" into \"$r\" in $dv. Do it?"; then
480 if ! verbose git merge origin/"`repobranch "$d"`"; then
481 check_mergeconflict "$d"
482 exit 1 # this should ALWAYS be fatal
492 dv=`visible_repo_name "$d"`
493 enter "$d0/$d" verbose
494 r=`git symbolic-ref HEAD`
496 diffdata=`git diff --color HEAD`
497 if [ -n "$diffdata" ]; then
498 # we have uncommitted changes
499 if yesno "Uncommitted changes in \"$r\" in $dv. Commit?" 'echo "$diffdata" | less -r'; then
500 verbose git commit -a
503 rem=`git config "branch.$r.remote" || echo origin`
504 bra=`git config "branch.$r.merge" || echo "$r"`
505 upstream="$rem/${bra#refs/heads/}"
506 if ! git rev-parse "$upstream" >/dev/null 2>&1; then
507 upstream="origin/`repobranch "$d"`"
509 logdata=`git log --color "$upstream".."$r"`
510 if [ -n "$logdata" ]; then
511 if yesno "Push \"$r\" in $dv?" 'echo "$logdata" | less -r'; then
512 verbose git push "$rem" HEAD
515 if [ x"$submit" = x"-s" ]; then
518 verbose git push "$rem" HEAD:"${bra%%/*}/finished/${bra#*/}"
526 if [ -n "$WE_HATE_OUR_USERS" ]; then
527 TARGETS="sv-debug cl-debug"
528 if [ -z "$CC" ]; then
531 elif [ x"`uname`" = x"Darwin" ]; then
534 TARGETS="sv-debug cl-debug sdl-debug"
537 # AGL cannot be compiled on systems with a kernel > 10.x (Snow Leopard)
538 TARGETS="sv-debug sdl-debug"
541 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"
543 TARGETS="sv-debug cl-debug sdl-debug"
560 if [ $# -gt 0 ] && [ x"$1" = x"" ]; then
561 # if we give the command make the arg "", it will surely fail (invalid filename),
562 # so better handle it as an empty client option
565 elif [ -n "$1" ]; then
567 TARGETS_SAVE=$TARGETS
572 TARGETS="$TARGETS sdl-debug"
575 TARGETS="$TARGETS cl-debug"
578 TARGETS="$TARGETS sv-debug"
581 BAD_TARGETS="$BAD_TARGETS $X"
585 if [ -n "$TARGETS" ]; then # at least a valid client
587 else # no valid client, let's assume this option is not meant to be a client then
588 TARGETS=$TARGETS_SAVE
592 if [ -z "$MAKEFLAGS" ]; then
593 if [ -f /proc/cpuinfo ]; then
594 ncpus=$((`grep -c '^processor :' /proc/cpuinfo`+0))
595 if [ $ncpus -gt 1 ]; then
599 if [ -n "$WE_HATE_OUR_USERS" ]; then
600 MAKEFLAGS="$MAKEFLAGS DP_MAKE_TARGET=mingw LIB_JPEG= CFLAGS_LIBJPEG="
604 enter "$d0/d0_blind_id" verbose
605 if ! [ -f Makefile ]; then
606 verbose sh autogen.sh
610 verbose make $MAKEFLAGS clean
612 verbose make $MAKEFLAGS
614 enter "$d0/fteqcc" verbose
616 verbose make $MAKEFLAGS clean
618 verbose make $MAKEFLAGS
620 enter "$d0/data/xonotic-data.pk3dir" verbose
622 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" "$@" $MAKEFLAGS clean
624 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" "$@" $MAKEFLAGS
626 enter "$d0/darkplaces" verbose
627 if [ x"$BAD_TARGETS" = x" " ]; then
628 echo "Warning: invalid empty client, default clients will be used."
631 verbose make $MAKEFLAGS clean
633 for T in $TARGETS; do
634 verbose make $MAKEFLAGS "$@" "$T"
636 for T in $BAD_TARGETS; do
637 echo "Warning: discarded invalid client $T."
640 verbose "$SELF" update-maps
643 if [ -n "$WE_HATE_OUR_USERS" ]; then
645 export PATH="$d0/misc/buildfiles/win32:$d0/d0_blind_id/.libs:$PATH"
646 elif [ x"`uname`" = x"Darwin" ]; then
647 export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/MacOS:$d0/d0_blind_id/.libs"
648 export DYLD_FRAMEWORK_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks"
651 export LD_LIBRARY_PATH="$d0/d0_blind_id/.libs"
655 sdl|glx|agl|dedicated)
664 if ! [ -x "darkplaces/darkplaces$client" ]; then
665 if [ -x "darkplaces/darkplaces$client.exe" ]; then
668 echo "Client darkplaces/darkplaces$client not found, aborting"
672 set -- "darkplaces/darkplaces$client" -nexuiz -customgamename Xonotic -customgamedirname1 data -customgamedirname2 "" -customgamescreenshotname xonotic -customgameuserdirname xonotic -mygames "$@"
674 # if pulseaudio is running: USE IT
675 if [ -z "$SDL_AUDIODRIVER" ] && ! [ -n "$WE_HATE_OUR_USERS" ] && ! [ x"`uname`" = x"Darwin" ]; then
676 if ps -C pulseaudio >/dev/null; then
677 if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
678 export SDL_AUDIODRIVER=pulse
683 if [ -n "$USE_GDB" ]; then
684 set -- gdb --args "$@"
690 if [ x"$1" = x"-k" ]; then
695 if verbose cd "$d0/$d"; then
707 patchdir=`mktemp -d -t save-patches.XXXXXX`
709 enter "$d0/$d" verbose
710 git branch -v -v | cut -c 3- | {
712 while read -r BRANCH REV UPSTREAM TEXT; do
715 UPSTREAM=${UPSTREAM#\[}
716 UPSTREAM=${UPSTREAM%\]}
717 UPSTREAM=${UPSTREAM%:*}
721 UPSTREAM=origin/"`repobranch "$d"`"
725 if [ x"$REV" = x"->" ]; then
728 if git format-patch -o "$patchdir/$i" "$UPSTREAM".."$BRANCH"; then
729 echo "$d" > "$patchdir/$i/info.txt"
730 echo "$BRANCH" >> "$patchdir/$i/info.txt"
731 echo "$UPSTREAM" >> "$patchdir/$i/info.txt"
732 echo "$TRACK" >> "$patchdir/$i/info.txt"
735 rm -rf "$patchdir/$i"
740 ( cd "$patchdir" && tar cvzf - . ) > "$outfile"
745 patchdir=`mktemp -d -t restore-patches.XXXXXX`
746 ( cd "$patchdir" && tar xvzf - ) < "$infile"
748 for P in "$patchdir"/*/info.txt; do
755 verbose git checkout HEAD^0
756 verbose git branch -D "$BRANCH"
757 if [ x"$TRACK" = x"true" ]; then
758 verbose git checkout --track -b "$BRANCH" "$UPSTREAM"
760 verbose git branch -b "$BRANCH" "$UPSTREAM"
772 report=$report"$*$LF"
777 report=$report" $*$LF"
782 o=`"$@" | sed 's/^/ /' || true`
786 enter "$d0/$d" verbose
787 base="`repobranch "$d"`"
789 for ref in `git for-each-ref --format='%(refname)' refs/remotes/origin/`; do
790 case "${ref#refs/remotes/origin/}" in
803 if [ -n "$branch" ]; then
804 if [ x"$branch" != x"${ref#refs/remotes/origin/}" ]; then
813 l0=`git rev-list "$base".."$ref" | wc -l`
814 l1=`git rev-list master.."$ref" | wc -l`
815 if [ $l0 -gt $l1 ]; then
822 reportecho " Branch $ref:"
823 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
824 logdata=`git log --color "$realbase".."$ref"`
825 if [ -z "$logdata" ]; then
826 reportecho4 "--> not merging, no changes vs master"
827 if yesno "Branch \"$ref\" probably should get deleted. Do it?" ''; then
828 git push origin :"${ref#refs/remotes/origin/}"
829 reportecho4 "--> branch deleted"
832 diffdata=`git diff --color --find-copies-harder --ignore-space-change "$realbase"..."$ref"`
833 if [ -z "$diffdata" ]; then
834 reportecho4 "--> not merging, no changes vs master, branch contains redundant history"
835 if yesno "Branch \"$ref\" probably should get deleted. Do it?" '{ echo "$logdata"; } | less -r'; then
836 git push origin :"${ref#refs/remotes/origin/}"
837 reportecho4 "--> branch deleted"
839 elif [ -z "$branch" ] && [ -n "$note" ]; then
840 reportdo4 echo "$note"
841 reportecho4 "--> not merging, already had this one rejected before"
842 elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ echo "$logdata"; echo "$diffdata"; } | less -r'; then
843 git checkout "$realbase"
844 org=`git rev-parse HEAD`
845 if ! git merge --no-ff "$ref" 2>&1 | tee "$t" && ! { git ls-files -u | grep ' 1 ' >/dev/null; }; then
846 git reset --hard "$org"
847 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Merge failed:$LF`cat "$t"`" "$ref"
849 reportecho4 "--> merge failed"
850 elif ! "$SELF" compile -n 2>&1 | tee "$t"; then
851 git reset --hard "$org"
852 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Compile failed:$LF`cat "$t"`" "$ref"
854 reportecho4 "--> compile failed"
855 elif ! yesno "Still merge \"$ref\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
856 git reset --hard "$org"
857 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
858 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
859 if [ x"$note" = x"del" ]; then
860 git push origin :"${ref#refs/remotes/origin/}"
861 reportecho4 "--> test failed, branch deleted"
862 elif [ -n "$note" ]; then
863 reportdo4 echo "$note"
864 reportecho4 "--> test failed"
866 reportecho4 "--> test failed, postponed"
870 case ",`repoflags "$d"`," in
872 # we do quite a mess here... luckily we know $org
873 git fetch # svn needs to be current
874 git rebase -i --onto origin/master "$org"
875 git svn dcommit --add-author-from
876 git reset --hard "$org"
882 reportecho4 "--> MERGED"
883 if yesno "Delete original branch \"$ref\"?"; then
884 git push origin :"${ref#refs/remotes/origin/}"
885 reportecho4 "--> branch deleted"
889 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
890 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
891 if [ x"$note" = x"del" ]; then
892 git push origin :"${ref#refs/remotes/origin/}"
893 reportecho4 "--> branch deleted"
894 elif [ -n "$note" ]; then
895 reportdo4 echo "$note"
896 reportecho4 "--> rejected"
898 reportecho4 "--> postponed"
907 echo "$report" | ssh nexuiz@rm.endoftheinternet.org cat '>>' public_html/xonotic-merge-notes.txt
911 if [ x"$1" = x"-f" ]; then
917 verbose git reset --hard
918 #redundant# verbose git checkout-index -fa
922 verbose git clean -df
925 verbose git clean -xdf
931 # release building goes here
933 #"$SELF" each git clean -fxd
934 case "$RELEASETYPE" in
936 msg "Building a BETA"
939 msg "Building a RELEASE"
942 msg "Must either set RELEASETYPE=beta or RELEASETYPE=release"
946 verbose rm -rf Xonotic Xonotic*.zip
947 verbose mkdir -p Xonotic
948 verbose date +%Y%m%d > Xonotic/stamp.txt
949 verbose git archive --format=tar HEAD -- Docs misc server xonotic-linux-glx.sh xonotic-linux-sdl.sh misc/buildfiles key_0.d0pk | {
951 verbose mkdir data fteqcc source source/darkplaces source/fteqcc
953 verbose rm -rf misc/builddeps
954 verbose mv misc/buildfiles/win32/* . || true
955 verbose mv misc/buildfiles/win64 bin64 || true
956 verbose mv misc/buildfiles/osx/* . || true
957 verbose rm -rf misc/buildfiles
958 verbose rm -rf misc/pki
961 verbose cd darkplaces
962 verbose git archive --format=tar HEAD
964 verbose cd Xonotic/source/darkplaces
969 verbose git archive --format=tar HEAD
971 verbose cd Xonotic/source/fteqcc
975 verbose cd data/xonotic-data.pk3dir
976 verbose git archive --format=tar HEAD -- qcsrc Makefile
978 verbose cd Xonotic/source
981 rm -f Xonotic/key_15.d0pk
990 if [ -n "$targetfiles" ]; then
991 case " $HOSTS_THAT_ARE_MYSELF " in
993 verbose rsync --delete -zvaSHP "$srcdir"/ "$buildpath/"
994 verbose eval make -C "$buildpath" clean $maketargets $makeflags
995 for f in $targetfiles; do
996 verbose mv "$buildpath/${f%:*}" "${f##*:}" || true
1000 verbose rsync --delete -zvaSHP "$srcdir"/ "$host:$buildpath/"
1001 verbose ssh "$host" ". ~/.profile && cd $buildpath && make clean $maketargets $makeflags"
1002 for f in $targetfiles; do
1003 verbose rsync -zvaSHP "$host:$buildpath/${f%:*}" "${f##*:}" || true
1007 # now rebrand the binaries...
1008 for f in $targetfiles; do
1009 verbose "$d0/misc/tools/rebrand-darkplaces-engine.sh" "${XONOTIC_BRAND:-$d0/misc/tools/xonotic.brand}" "${f##*:}" || true
1016 fteqcc_maketargets=$3
1018 darkplaces_maketargets=$5
1020 verbose "$SELF" release-compile-run "xonotic-build-$suffix" /tmp/fteqcc.build."$suffix" "$fteqcc_maketargets" "$makeflags" "Xonotic/source/fteqcc" "$fteqcc_files"
1021 verbose "$SELF" release-compile-run "xonotic-build-$suffix" /tmp/Darkplaces.build."$suffix" "$darkplaces_maketargets" "$makeflags" "Xonotic/source/darkplaces" "$darkplaces_files"
1023 release-engine-win32)
1024 verbose "$SELF" release-compile win32 \
1025 'STRIP=: DP_MAKE_TARGET=mingw CC="i586-mingw32msvc-gcc -g -Wl,--dynamicbase -Wl,--nxcompat -I$HOME/dp.win32/include -L$HOME/dp.win32/lib" WINDRES="i586-mingw32msvc-windres" SDL_CONFIG="$HOME/dp.win32/bin/sdl-config" LIB_JPEG= CFLAGS_LIBJPEG= WIN32RELEASE=1 D3D=0' \
1026 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc.exe' \
1027 release 'darkplaces.exe:Xonotic/xonotic.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe'
1029 release-engine-win64)
1030 verbose "$SELF" release-compile win64 \
1031 'STRIP=: DP_MAKE_TARGET=mingw CC="amd64-mingw32msvc-gcc -g -Wl,--dynamicbase -Wl,--nxcompat -I$HOME/dp.win64/include -L$HOME/dp.win64/lib" WINDRES="amd64-mingw32msvc-windres" SDL_CONFIG="$HOME/dp.win64/bin/sdl-config" LIB_JPEG= CFLAGS_LIBJPEG= WIN64RELEASE=1 D3D=0' \
1032 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc-x64.exe' \
1033 'sv-release cl-release' 'darkplaces.exe:Xonotic/xonotic-x64.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated-x64.exe'
1034 # release 'darkplaces.exe:Xonotic/xonotic-x64.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl-x64.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated-x64.exe'
1036 release-engine-osx-sv-sdl)
1037 # gcc on OSX is buggy, needs -fno-reorder-blocks for a release build to succeed
1038 verbose "$SELF" release-compile osx \
1039 '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"' \
1040 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.osx' \
1041 'sv-release sdl-release' 'darkplaces-sdl:Xonotic/Xonotic-SDL.app/Contents/MacOS/xonotic-osx-sdl-bin darkplaces-dedicated:Xonotic/xonotic-osx-dedicated'
1043 release-engine-osx-agl)
1044 # gcc on OSX is buggy, needs -fno-reorder-blocks for a release build to succeed
1045 verbose "$SELF" release-compile osx \
1046 'STRIP=: CC="gcc -g -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.4 -I$HOME/dp.osx/include -L$HOME/dp.osx/lib -fno-reorder-blocks"' \
1048 'cl-release' 'darkplaces-agl:Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-agl-bin'
1051 verbose "$SELF" release-engine-osx-sv-sdl
1052 verbose "$SELF" release-engine-osx-agl
1054 release-engine-linux32)
1055 verbose "$SELF" release-compile linux32 \
1056 '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 LIB_JPEG=$HOME/dp.linux32/lib/libjpeg.a DP_CRYPTO_STATIC_LIBDIR=$HOME/dp.linux32/lib' \
1057 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux32' \
1058 release 'darkplaces-glx:Xonotic/xonotic-linux32-glx darkplaces-sdl:Xonotic/xonotic-linux32-sdl darkplaces-dedicated:Xonotic/xonotic-linux32-dedicated'
1060 release-engine-linux64)
1061 verbose "$SELF" release-compile linux64 \
1062 '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 LIB_JPEG=$HOME/dp.linux64/lib/libjpeg.a DP_CRYPTO_STATIC_LIBDIR=$HOME/dp.linux64/lib' \
1063 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux64' \
1064 release 'darkplaces-glx:Xonotic/xonotic-linux64-glx darkplaces-sdl:Xonotic/xonotic-linux64-sdl darkplaces-dedicated:Xonotic/xonotic-linux64-dedicated'
1067 verbose "$SELF" release-engine-win64
1068 verbose "$SELF" release-engine-osx
1069 verbose "$SELF" release-engine-win32
1070 verbose "$SELF" release-engine-linux32
1071 verbose "$SELF" release-engine-linux64
1074 verbose "$SELF" update-maps
1077 case "$RELEASETYPE" in
1079 verbose make -C Xonotic/source FTEQCC="$d0/Xonotic/fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 clean all
1082 verbose make -C Xonotic/source FTEQCC="$d0/Xonotic/fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 FTEQCCFLAGS_WATERMARK= clean all
1085 verbose rm -f Xonotic/source/*/fteqcc.log
1087 release-buildpk3-transform-raw)
1090 release-buildpk3-transform-normal)
1093 # texture: convert to jpeg and dds
1094 verbose export do_jpeg=true
1095 verbose export jpeg_qual_rgb=95
1096 verbose export jpeg_qual_a=99
1097 verbose export do_dds=true
1098 verbose export dds_flags=
1099 verbose export do_ogg=false
1100 verbose export del_src=true
1101 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1103 release-buildpk3-transform-low)
1106 # texture: convert to jpeg and dds
1107 # music: reduce bitrate
1108 verbose export do_jpeg=true
1109 verbose export jpeg_qual_rgb=80
1110 verbose export jpeg_qual_a=95
1111 verbose export do_dds=false
1112 verbose export do_ogg=true
1113 verbose export ogg_qual=1
1114 verbose export del_src=true
1115 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1117 release-buildpk3-transform-lowdds)
1120 # texture: convert to jpeg and dds
1121 # music: reduce bitrate
1122 verbose export do_jpeg=false
1123 verbose export do_jpeg_if_not_dds=true
1124 verbose export jpeg_qual_rgb=80
1125 verbose export jpeg_qual_a=95
1126 verbose export do_dds=true
1127 verbose export dds_flags=
1128 verbose export do_ogg=true
1129 verbose export ogg_qual=1
1130 verbose export del_src=true
1131 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1144 verbose rm -rf Xonotic/temp
1145 verbose mkdir -p Xonotic/temp
1148 verbose git archive --format=tar HEAD
1150 verbose cd Xonotic/temp
1153 verbose cd Xonotic/temp
1154 if [ x"$src" = x"data/xonotic-data.pk3dir" ]; then
1155 verbose cp ../source/progs.dat .
1156 verbose cp ../source/csprogs.dat .
1157 verbose cp ../source/menu.dat .
1158 verbose rm -rf qcsrc
1159 gv=`grep "^gameversion " "defaultXonotic.cfg" | awk '{ print $2 }'`
1160 major=$(($gv / 10000))
1161 minor=$(($gv / 100 - $major * 100))
1162 patch=$(($gv - $major * 10000 - $minor * 100))
1164 s/^set g_xonoticversion [^ ]* /set g_xonoticversion $major.$minor.$patch /;
1165 s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
1166 s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/;
1167 " defaultXonotic.cfg
1169 if [ x"$src" = x"data/xonotic-maps.pk3dir" ]; then
1170 for X in ../../data/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
1171 if [ -f "$X" ]; then
1176 verbose "$SELF" release-buildpk3-transform-$transform "Xonotic/temp"
1177 verbose zip -9yr "../../$dst" .
1179 verbose rm -rf Xonotic/temp
1182 stamp=`cat Xonotic/stamp.txt`
1188 dst="data/xonotic-$stamp-${dst#data/xonotic-}"
1194 while [ "$#" -gt 1 ]; do
1195 verbose "$SELF" release-buildpk3 "$src" "Xonotic/$dst$2.pk3" "$1"
1201 verbose "$SELF" release-buildpk3s data/font-nimbussansl.pk3dir raw ''
1202 verbose "$SELF" release-buildpk3s data/xonotic-data.pk3dir normal '' raw '-raw' low '-low' lowdds '-lowdds'
1203 verbose "$SELF" release-buildpk3s data/xonotic-maps.pk3dir normal '' raw '-raw' low '-low' lowdds '-lowdds'
1204 verbose "$SELF" release-buildpk3s data/xonotic-music.pk3dir raw '' low '-low'
1205 verbose "$SELF" release-buildpk3s data/xonotic-nexcompat.pk3dir low ''
1207 release-pack-needsx11)
1210 verbose startx "$SELF" release-pack -- /usr/bin/Xvfb :7
1213 verbose "$SELF" release-pack
1218 stamp=`cat Xonotic/stamp.txt`
1219 verbose zip -9yr Xonotic-$stamp-common.zip \
1228 Xonotic/xonotic.exe \
1229 Xonotic/data/font-nimbussansl-$stamp.pk3
1230 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp.zip
1231 verbose zip -0yr Xonotic-$stamp.zip \
1232 Xonotic/data/xonotic-$stamp-data.pk3 \
1233 Xonotic/data/xonotic-$stamp-maps.pk3 \
1234 Xonotic/data/xonotic-$stamp-music.pk3 \
1235 Xonotic/data/xonotic-$stamp-nexcompat.pk3
1236 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-low.zip
1237 verbose zip -0yr Xonotic-$stamp-low.zip \
1238 Xonotic/data/xonotic-$stamp-data-low.pk3 \
1239 Xonotic/data/xonotic-$stamp-maps-low.pk3 \
1240 Xonotic/data/xonotic-$stamp-music-low.pk3
1241 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-lowdds.zip
1242 verbose zip -0yr Xonotic-$stamp-lowdds.zip \
1243 Xonotic/data/xonotic-$stamp-data-lowdds.pk3 \
1244 Xonotic/data/xonotic-$stamp-maps-lowdds.pk3 \
1245 Xonotic/data/xonotic-$stamp-music-low.pk3
1246 verbose mv Xonotic-$stamp-common.zip Xonotic-$stamp-high.zip
1247 verbose zip -0yr Xonotic-$stamp-high.zip \
1248 Xonotic/data/xonotic-$stamp-data-raw.pk3 \
1249 Xonotic/data/xonotic-$stamp-maps-raw.pk3 \
1250 Xonotic/data/xonotic-$stamp-music.pk3 \
1251 Xonotic/data/xonotic-$stamp-nexcompat.pk3
1254 verbose "$SELF" release-prepare
1255 verbose "$SELF" release-maps
1256 verbose "$SELF" release-engine
1257 verbose "$SELF" release-qc
1258 verbose "$SELF" release-pack-needsx11
1259 verbose "$SELF" release-zip
1266 echo " $SELF push [-s]"
1267 echo " $SELF branches"
1268 echo " $SELF branch [<remote>] <branchname>"
1269 echo " $SELF branch <remote> <branchname> <srcbranchname>"
1270 echo " $SELF checkout [<remote>] <branchname>"
1271 echo " $SELF compile [-c|-n] [<client>] <options>"
1272 echo " $SELF run [<client>] <options>"
1273 echo " $SELF each <command>"