5 if [ -n "$ZSH_VERSION" ]; then
8 if [ -z "$ECHO" ]; then
9 if echo "\\\\" | grep .. >/dev/null; then
16 # I use this in EVERY shell script ;)
22 while ! [ -f ./all ]; do
23 if [ x"`pwd`" = x"/" ]; then
24 $ECHO "Cannot find myself."
25 $ECHO "Please run this script with the working directory inside a Xonotic checkout."
33 # If we are on WINDOWS:
38 # Windows hates users. So this script has to copy itself elsewhere first...
39 cp "$SELF" ../all.xonotic.sh
40 export WE_HATE_OUR_USERS=1
41 exec ../all.xonotic.sh "$@"
49 $ECHO >&2 "$ESC""[1m$*$ESC""[m"
52 self=`git hash-object "$SELF"`
55 self_new=`git hash-object "$SELF"`
56 if [ x"$self" != x"$self_new" ]; then
57 msg "./all has changed."
58 if [ -z "$XONOTIC_FORBID_RERUN_ALL" ]; then
59 msg "Rerunning the requested operation to make sure."
60 export XONOTIC_FORBID_RERUN_ALL=1
63 msg "Please try $SELF update, and then retry your requested operation."
80 $ECHO "the root directory"
90 if git ls-files -u | grep ' 1 '; then
92 $ECHO "MERGE CONFLICT."
93 $ECHO "change into the \"$1\" project directory, and then:"
94 $ECHO "- edit the files mentioned above with your favorite editor,"
95 $ECHO " and fix the conflicts (marked with <<<<<<< blocks)"
96 $ECHO "- for binary files, you can select the files using"
97 $ECHO " git checkout --ours or git checkout --theirs"
98 $ECHO "- when done with a file, 'git add' the file"
99 $ECHO "- when done, 'git commit'"
108 while [ x"$yesno" != x"y" -a x"$yesno" != x"n" ]; do
111 if ! IFS= read -r yesno; then
122 check_mergeconflict "$1"
127 data/xonotic-data.pk3dir | | master |
128 data/xonotic-music.pk3dir | | master |
129 data/xonotic-nexcompat.pk3dir | | master | no
130 darkplaces | | div0-stable | svn
131 netradiant | | master |
132 div0-gittools | | master | no
133 d0_blind_id | | master |
134 data/xonotic-maps.pk3dir | | master |
135 mediasource | | master | no
136 fteqcc | | xonotic-stable | noautocrlf
138 # todo: in darkplaces, change repobranch to div0-stable
140 repos=`$ECHO "$repos_urls" | grep . | cut -d '|' -f 1 | tr -d ' '`
142 base=`git config remote.origin.url`
145 base=${base%xonotic.git}
148 $ECHO "The main repo is not xonotic.git, what have you done?"
152 pushbase=`git config remote.origin.pushurl || true`
155 pushbase=${pushbase%xonotic.git}
160 $ECHO "The main repo is not xonotic.git, what have you done?"
167 repo_t=`$ECHO "$repos_urls" | grep "^$1 " | cut -d '|' -f 2 | tr -d ' '`
168 if [ -n "$repo_t" ]; then
178 if [ x"$1" = x"." ]; then
179 $ECHO "$base""xonotic.git"
181 $ECHO "$base${1##*/}.git"
188 [ -n "$pushbase" ] || return 0
189 repo_t=`$ECHO "$repos_urls" | grep "^$1 " | cut -d '|' -f 2 | tr -d ' '`
190 if [ -n "$repo_t" ]; then
195 $ECHO "$pushbase$repo_t"
199 if [ x"$1" = x"." ]; then
200 $ECHO "$pushbase""xonotic.git"
202 $ECHO "$pushbase${1##*/}.git"
209 repo_t=`$ECHO "$repos_urls" | grep "^$1 " | cut -d '|' -f 3 | tr -d ' '`
210 if [ -n "$repo_t" ]; then
219 $ECHO "$repos_urls" | grep "^$1 " | cut -d '|' -f 4 | tr -d ' '
227 # if we have .no file, skip
228 if [ -f "$d.no" ]; then
229 msg "Repository $d disabled by a .no file, delete $d.no to enable"
232 # if .yes file exists, always keep it
233 if [ -f "$d.yes" ]; then
234 msg "Repository $d enabled by a .yes file"
238 # remove broken clones so they don't mess up stuff
239 if [ x"$d" != x"." ] && [ -d "$d" ] && ! [ -d "$d/.git" ]; then
240 msg "$d exists but has no .git subdir. Probably a broken clone. Deleting."
244 # if we have the dir, always keep it
246 msg "Repository $d enabled because it already exists"
250 # if we have matching pk3, skip
251 if [ x"$p" != x"$d" ] && [ -f "$p" ]; then
252 msg "Repository $d disabled by matching .pk3 file, delete $p or create $d.yes to enable"
255 # if "no" flag is set, skip
258 msg "Repository $d disabled by default, create $d.yes to enable"
263 msg "Repository $d enabled by default"
270 if [ "$#" = 0 ]; then
280 release_args="$cmd $*"
281 msg "*** $release_args: start"
282 release_starttime=`date +%s`
285 release_endtime=`date +%s`
286 release_deltatime=$(($release_endtime - $release_starttime))
287 msg "*** $release_args: $release_deltatime seconds"
289 trap release_end EXIT
290 release_tempstarttime=$release_starttime
293 release_endtime=`date +%s` # RELEASE NOW!!!
295 release_deltatime=$(($release_endtime - $release_tempstarttime))
296 msg "**** $release_args: $*: $release_deltatime seconds"
298 release_tempstarttime=$release_endtime
300 release_git_extract_dir()
302 release_src=$1; shift
303 release_dst=$1; shift
304 # try to create a hardlink
305 if ln -f "$release_src/.git/HEAD" "$release_dst/.hardlink-test"; then
306 rm -f "$release_dst/.hardlink-test"
308 verbose cd "$release_src"
309 git ls-files HEAD -- "$@"
311 while IFS= read -r F; do
312 case "$F" in */*) mkdir -p "$release_dst/${F%/*}" ;; esac
313 verbose ln -f "$release_src/$F" "$release_dst/$F"
318 verbose cd "$release_src"
319 verbose git archive --format=tar HEAD -- "$@"
321 verbose cd "$release_dst"
329 fix_upstream_rebase()
331 if [ -z "$r_me" ] || [ -z "$r_other" ]; then
335 # one of the two sides of the merge should be remote upstream, or all is fine
336 r_r=`git symbolic-ref HEAD`
337 r_r=${r_r#refs/heads/}
338 r_rem=`git config "branch.$r_rem.remote" || $ECHO origin`
339 r_bra=`git config "branch.$r_bra.merge" || $ECHO "$r_r"`
340 r_bra=${r_bra#refs/heads/}
341 if [ x"$r_me" != x"`git rev-parse "$r_rem/$r_bra"`" ]; then
342 if [ x"$r_other" != x"`git rev-parse "$r_rem/$r_bra"`" ]; then
347 r_base=`git merge-base "$r_me" "$r_other"`
349 # no merge-base? upstream did filter-branch
350 if [ -n "$r_base" ]; then
351 # otherwise, check if the two histories are "similar"
352 r_l_me=`git log --pretty="format:%s" "$r_other".."$r_me" | grep -v "^Merge" | sort -u`
353 r_l_other=`git log --pretty="format:%s" "$r_me".."$r_other" | grep -v "^Merge" | sort -u`
355 # heuristics: upstream rebase/filter-branch if more than 50% of the commits of one of the sides are in the other too
356 r_lc_me=`$ECHO "$r_l_me" | wc -l`
357 r_lc_other=`$ECHO "$r_l_other" | wc -l`
358 r_lc_together=`{ $ECHO "$r_l_me"; $ECHO "$r_l_other"; } | sort -u | wc -l`
359 r_lc_same=$(($r_lc_me + $r_lc_other - $r_lc_together))
361 if [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_me )) ] || [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_other )) ]; then
362 if yesno "Probable upstream rebase detected, automatically fix?" 'git log --oneline --graph --date-order --left-right "$r_other"..."$r_me"'; then
363 git reset --hard "$r_me"
373 fix_upstream_rebase_mergeok()
375 r_me=`git rev-parse --revs-only HEAD^1 2>/dev/null || true`
376 r_other=`git rev-parse --revs-only HEAD^2 2>/dev/null || true`
380 fix_upstream_rebase_mergefail()
382 r_me=`git rev-parse --revs-only HEAD 2>/dev/null || true`
383 r_other=`git rev-parse --revs-only MERGE_HEAD 2>/dev/null || true`
389 if ! [ -f ".git/config" ]; then
390 $ECHO "Not a git repository. Bailing out to not cause damage."
393 verbose git config remote.origin.url "$1"
395 verbose git config remote.origin.pushurl "$2"
397 verbose git config --unset remote.origin.pushurl || true
399 verbose git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
400 case ",`repoflags "$d"`," in
402 verbose git config --unset core.autocrlf || true
405 verbose git config core.autocrlf input
408 if [ -z "`git config push.default || true`" ]; then
409 verbose git config push.default current # or is tracking better?
411 verbose git config filter.mapclean.clean "tr -d '\r' | grep '^[^/]'"
412 verbose git config filter.mapclean.smudge "cat"
418 case "$RELEASETYPE" in
428 find "$@" -exec touch -d "2001-01-01 01:01:01 +0000" {} \+ # ugly hack to make the pk3 files rsync-friendly
430 find "$@" -xtype f \( -executable -or -type l \) -print > "$ziplist"
431 7za a -tzip $sevenzipflags -x@"$ziplist" "$archive" "$@" || true
432 zip $zipflags -y -@<"$ziplist" "$archive" || true
439 case "$RELEASETYPE" in
450 find "$@" -xtype f \( -executable -or -type l \) -print > "$ziplist"
451 7za a -tzip $sevenzipflags -x@"$ziplist" "$archive" "$@" || true
452 zip $zipflags -y -@<"$ziplist" "$archive" || true
459 zip -0ry "$archive" "$@"
464 # first result is to be ignored, but we use it to check status
465 git ls-remote "$1" refs/heads/master >/dev/null 2>&1 || return 1
466 { time -p git ls-remote "$1" refs/heads/master; } 2>&1 >/dev/null | head -n 1 | cut -d ' ' -f 2 | tr -d . | sed 's,^0*,,'
467 # unit: clock ticks (depends on what "time" returns
475 if ! { time -p true; } >/dev/null 2>&1; then
476 msg "Cannot do timing in this shell"
494 if t=`mirrorspeed "$m"`; then
496 tt=$(($t$op)) # fudge factor
497 msg "$m -> $t$op = $tt ticks"
498 if [ -z "$bestt" ] || [ "$tt" -lt "$bestt" ]; then
509 if [ -n "$bestin" ]; then
510 msg "Best mirror seems to be $pre$bestin$suf"
520 enter "$d0/$d" verbose
521 verbose fix_upstream_rebase_mergefail && verbose fix_upstream_rebase_mergeok
527 pushurl=`repopushurl "$d"`
528 branch=`repobranch "$d"`
529 if [ -f "$d0/$d/.git/config" ]; then
531 fix_git_config "$url" "$pushurl"
537 # enable the ssh URL for pushing
540 if [ -f ~/.ssh/id_rsa.pub ]; then
542 msg "A key already exists and no new one will be generated. If you"
543 msg "already have done the procedure for getting your key approved, you"
544 msg "can skip the following paragraph and already use the repository."
546 msg "To get access, your key has to be approved first. For that, visit"
547 msg "http://dev.xonotic.org/, then log in, create a \"New Issue\" on"
548 msg "the \"Support\" tracker in the \"Repository\" category where you"
549 msg "apply for access and paste the following output into the issue:"
551 msg "`cat ~/.ssh/id_rsa.pub`"
553 msg "Note that you will only have write access to branches that start"
554 msg "with your user name."
555 elif [ -f ~/.ssh/id_dsa.pub ]; then
557 msg "A key already exists and no new one will be generated. If you"
558 msg "already have done the procedure for getting your key approved, you"
559 msg "can skip the following paragraph and already use the repository."
561 msg "To get access, your key has to be approved first. For that, visit"
562 msg "http://dev.xonotic.org/, then log in, create a \"New Issue\" on"
563 msg "the \"Support\" tracker in the \"Repository\" category where you"
564 msg "apply for access and paste the following output into the issue:"
566 msg "`cat ~/.ssh/id_dsa.pub`"
568 msg "Note that you will only have write access to branches that start"
569 msg "with your user name."
572 msg "No key has been generated yet. One will be generated now."
573 msg "If other people are using your computer, it is recommended"
574 msg "to specify a passphrase. Otherwise you can simply hit ENTER"
575 msg "when asked for a passphrase."
577 ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa
579 msg "To get access, your key has to be approved first. For that, visit"
580 msg "http://dev.xonotic.org/, then log in, create a \"New Issue\" on"
581 msg "the \"Support\" tracker in the \"Repository\" category where you"
582 msg "apply for access and paste the following output into the issue:"
584 msg "`cat ~/.ssh/id_rsa.pub`"
586 msg "Note that you will only have write access to branches that start"
587 msg "with your user name."
594 oldpushbase=$pushbase
595 # transition old URLs
596 if [ x"$base" = x"ssh://xonotic@git.xonotic.org/" ]; then
597 base=ssh://xonotic@push.git.xonotic.org/
599 if [ x"$pushbase" = x"ssh://xonotic@git.xonotic.org/" ]; then
600 pushbase=ssh://xonotic@push.git.xonotic.org/
603 if [ x"$1" = x"-N" ]; then
605 elif [ x"$1" = x"-p" ]; then
606 pushbase=ssh://xonotic@push.git.xonotic.org/
607 elif [ x"$1" = x"-ps" ]; then
608 pushbase=ssh://xonotic@push.git.xonotic.org/
609 elif [ x"$1" = x"-ph" ]; then
610 pushbase=http://push.git.xonotic.org/login/xonotic/
611 elif [ x"$1" = x"-s" ]; then
612 base=ssh://xonotic@push.git.xonotic.org/
613 elif [ x"$1" = x"-g" ]; then
614 base=git://git.xonotic.org/xonotic/
616 elif [ x"$1" = x"-h" ]; then
617 base=http://git.xonotic.org/xonotic/
619 elif [ x"$1" = x"-l" ]; then
627 msg "Invalid location!"
628 msg "Possible locations for the -l option:"
629 msg " nl (Netherlands, run by merlijn)"
630 msg " de (Germany, run by divVerent)"
631 msg " us (United States of America, run by detrate)"
632 msg " best (find automatically)"
633 msg " default (currently nl)"
646 if [ x"`git config xonotic.all.mirrorselection 2>/dev/null || true`" != x"done" ]; then
653 # if we fetched via ssh://, switch to git:// for fetching and keep using ssh:// for pushing
657 base=git://git.xonotic.org/xonotic/
660 newbase=`$ECHO "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,:// .git.xonotic.org/,"`
663 if location=`bestmirror $newbase"xonotic.git" de us nl:'*6/5'`; then # 20% malus to the NL server to not overload it too much
664 git config xonotic.all.mirrorselection done
681 *://*.git.xonotic.org/*)
682 location=${base%%.git.xonotic.org/*}
683 location=${location##*://}
691 if [ -n "$location" ]; then
692 base=`$ECHO "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,://$location.git.xonotic.org/,"`
694 base=`$ECHO "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,://git.xonotic.org/,"`
696 pushbase=`$ECHO "$pushbase" | sed "s,://\(.*\.\)\?git.xonotic.org/,://xonotic@push.git.xonotic.org/,"`
697 if [ x"$base" != x"$oldbase" ] || [ x"$pushbase" != x"$oldpushbase" ]; then
699 pushurl=`repopushurl .`
700 fix_git_config "$url" "$pushurl"
702 elif $allow_pull; then
707 pushurl=`repopushurl "$d"`
708 branch=`repobranch "$d"`
709 if [ -f "$d0/$d/.git/config" ]; then
710 # if we have .no file, skip
711 if [ -f "$d0/$d.no" ]; then
712 msg "Repository $d disabled by a .no file, delete $d.no to enable; thus, not updated"
716 enter "$d0/$d" verbose
717 r=`git symbolic-ref HEAD`
719 if git config branch.$r.remote >/dev/null 2>&1; then
720 if ! verbose git pull; then
721 fix_upstream_rebase_mergefail || true
722 check_mergeconflict "$d"
723 $ECHO "Pulling failed. Press ENTER to continue, or Ctrl-C to abort."
726 fix_upstream_rebase_mergeok || true
731 checkself "$cmd" "$@"
733 verbose git remote prune origin
737 if [ -d "$d0/$d" ]; then
738 if yesno "$d0/$d is in the way, get rid of it and reclone?"; then
739 verbose rm -rf "$d0/$d"
741 echo "Note: $d0/$d will stay broken."
745 verbose git clone "$url" "$d0/$d"
746 enter "$d0/$d" verbose
747 fix_git_config "$url" "$pushurl"
748 if [ "$branch" != "master" ]; then
749 verbose git checkout --track -b "$branch" origin/"$branch"
756 misc/tools/xonotic-map-compiler-autobuild download
760 if [ x"$1" = x"-f" ]; then
766 if [ -z "$branch" ]; then
769 branch=${remote#origin/}
778 if [ -n "$checkoutflags" ]; then
779 set -- -f "$@" # to make checkself work again
783 enter "$d0/$d" verbose
785 if [ -n "$b" ] && git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
787 verbose git checkout $checkoutflags "$b"
788 elif [ -n "$b" ] && git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
790 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
793 if git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
794 verbose git checkout $checkoutflags "$b"
795 elif git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
796 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
798 $ECHO "WTF? Not even branch $b doesn't exist in $d"
803 checkself "$cmd" "$@"
807 $ECHO "The requested branch was not found in any repository."
815 if [ -z "$branch" ]; then
819 if [ -z "$branch" ]; then
822 r=`git symbolic-ref HEAD`
829 dv=`visible_repo_name "$d"`
830 enter "$d0/$d" verbose
831 if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
832 $ECHO "Already having this branch in $dv."
834 if yesno "Branch in $dv?"; then
835 if [ -n "$srcbranch" ]; then
838 b=origin/"`repobranch "$d"`"
839 verbose git fetch origin || true
841 # TODO do this without pushing
842 verbose git checkout -b "$branch" "$b"
843 verbose git config "branch.$branch.remote" "$remote"
844 verbose git config "branch.$branch.merge" "refs/heads/$branch"
854 cd "$d0/$d" # am in a pipe, shouldn't use enter
855 git branch -r -v -v | cut -c 3- | sed "s/^(no branch)/(no_branch)/" | sed "s,^,$d ,"
860 while read -r d BRANCH REV TEXT; do
861 if [ x"$BRANCH" = x"`repobranch "$d"`" ]; then
864 if [ x"$REV" = x"->" ]; then
867 BRANCH=${BRANCH#remotes/}
868 ID=`$ECHO "$BRANCH" | tr -c "A-Za-z0-9." "_"`
869 branches_list="$branches_list $BRANCH" # TEH SORT MAKEZ IT UNIEQ
870 eval "r=\$branches_repos_$ID"
872 eval "branches_repos_$ID=\$r"
874 $ECHO -n "$branches_list" | xargs -n 1 $ECHO | sort -u | while IFS= read -r BRANCH; do
875 ID=`$ECHO "$BRANCH" | tr -c "A-Za-z0-9." "_"`
876 eval "r=\$branches_repos_$ID"
877 printf "%-60s %s\n" "$BRANCH" "$r"
884 dv=`visible_repo_name "$d"`
885 enter "$d0/$d" verbose
886 r=`git symbolic-ref HEAD`
888 if git log HEAD..origin/"`repobranch "$d"`" | grep .; then
889 # we have uncommitted changes
890 if yesno "Could merge from \"`repobranch "$d"`\" into \"$r\" in $dv. Do it?"; then
891 if ! verbose git merge origin/"`repobranch "$d"`"; then
892 check_mergeconflict "$d"
893 exit 1 # this should ALWAYS be fatal
903 dv=`visible_repo_name "$d"`
904 enter "$d0/$d" verbose
905 r=`git symbolic-ref HEAD`
907 diffdata=`git diff --color HEAD`
908 if [ -n "$diffdata" ]; then
909 # we have uncommitted changes
910 if yesno "Uncommitted changes in \"$r\" in $dv. Commit?" '$ECHO "$diffdata" | less -r'; then
911 verbose git commit -a
914 rem=`git config "branch.$r.remote" || $ECHO origin`
915 bra=`git config "branch.$r.merge" || $ECHO "$r"`
916 upstream="$rem/${bra#refs/heads/}"
917 if ! git rev-parse "$upstream" >/dev/null 2>&1; then
918 upstream="origin/`repobranch "$d"`"
920 logdata=`git log --color "$upstream".."$r"`
921 if [ -n "$logdata" ]; then
922 if yesno "Push \"$r\" in $dv?" '$ECHO "$logdata" | less -r'; then
923 verbose git push "$rem" HEAD
926 if [ x"$submit" = x"-s" ]; then
929 verbose git push "$rem" HEAD:"${bra%%/*}/finished/${bra#*/}"
943 snowleopardhack=false
944 if [ -z "$CC" ]; then
947 export CC="$CC -DSUPPORTIPV6"
971 case "`$CC -dumpversion`" in
972 [5-9]*|[1-9][0-9]*|4.[3-9]*|4.[1-9][0-9]*)
974 # -march=native is broken < 4.3
975 if $CC -mtune=native -march=native misc/tools/conftest.c -o conftest >/dev/null 2>&1; then
976 export CC="$CC -mtune=native -march=native"
980 if [ -n "$WE_HATE_OUR_USERS" ]; then
981 export CC="$CC -fno-common"
990 if [ -n "$WE_HATE_OUR_USERS" ]; then
991 TARGETS="sv-$debug cl-$debug"
992 elif [ x"`uname`" = x"Darwin" ]; then
995 TARGETS="sv-$debug cl-$debug sdl-$debug"
998 # AGL cannot be compiled on systems with a kernel > 10.x (Snow Leopard)
1000 TARGETS="sv-$debug sdl-$debug"
1003 export CC="$CC -fno-reorder-blocks -I$PWD/misc/buildfiles/osx/Xonotic.app/Contents/Frameworks/SDL.framework/Headers -F$PWD/misc/buildfiles/osx/Xonotic.app/Contents/Frameworks"
1005 TARGETS="sv-$debug cl-$debug sdl-$debug"
1007 if [ $# -gt 0 ] && [ x"$1" = x"" ]; then
1008 # if we give the command make the arg "", it will surely fail (invalid filename),
1009 # so better handle it as an empty client option
1012 elif [ -n "$1" ]; then
1014 TARGETS_SAVE=$TARGETS
1019 TARGETS="$TARGETS sdl-debug"
1022 TARGETS="$TARGETS cl-debug"
1023 if $snowleopardhack; then
1024 export CC="$CC -arch i386"
1028 TARGETS="$TARGETS cl-debug"
1031 TARGETS="$TARGETS sv-debug"
1034 BAD_TARGETS="$BAD_TARGETS $X"
1038 if [ -n "$TARGETS" ]; then # at least a valid client
1040 else # no valid client, let's assume this option is not meant to be a client then
1041 TARGETS=$TARGETS_SAVE
1045 if [ -z "$MAKEFLAGS" ]; then
1046 if [ -f /proc/cpuinfo ]; then
1047 ncpus=$((`grep -c '^processor :' /proc/cpuinfo || true`+0))
1048 if [ $ncpus -gt 1 ]; then
1052 if [ -n "$WE_HATE_OUR_USERS" ]; then
1053 MAKEFLAGS="$MAKEFLAGS DP_MAKE_TARGET=mingw LIB_JPEG= CFLAGS_LIBJPEG="
1058 if ! verbose $CC misc/tools/conftest.c -o conftest; then
1060 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
1061 msg "~~~~~~~~~~ COMPILER ~~~~~~~~~~"
1062 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
1063 msg "~~~~~~~~~~~~~~_...._~~~~~~~~~~"
1064 msg "~~~~~~~~~~~,-' \\\`-._~~~~~~"
1065 msg "~~~~~~~~~~/ --. >< \\~~~~~"
1066 msg "~~~~~~~~~/ (*)> -<: \\~~~~"
1067 msg "~~~~~~~~~( ^~-' (*) )~~~~"
1068 msg "~~~~~~~~~\\ ^+-_/ |~~~~"
1069 msg "~~~~~~~~~~\\ {vvv} |~~~~"
1070 msg "~~~~~~~~~~,\\ , {^^^},/~~~~~"
1071 msg "~~~~~~~~,/ \`---.....-'~~W~~~~"
1072 msg "~~~~~~,/ \\_____/_\\_W~~/~~~~~"
1073 msg "~~~~~/ /~~~\\__/~~~~~~"
1074 msg "~~~~/ /~~~~~~~~~~~~~~"
1075 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
1076 msg "~~~~~~~ Y U NO COMPILE ~~~~~~~"
1077 msg "~~~~~~~~~~~~ CODE ~~~~~~~~~~~~"
1078 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
1084 verbose cd "$d0/d0_blind_id"
1085 if ! $compiled0; then
1086 # compilation of crypto library failed
1087 # use binaries then, if we can...
1089 if [ -n "$WE_HATE_OUR_USERS" ]; then
1090 verbose cp "$d0/misc/buildfiles/win32/libd0_blind_id"-* .libs/
1091 verbose cp "$d0/misc/buildfiles/win32/libd0_rijndael"-* .libs/
1092 verbose cp "$d0/misc/buildfiles/win32/libgmp"-* .libs/
1098 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libd0_blind_id".* .libs/
1099 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libd0_rijndael".* .libs/
1100 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libgmp".* .libs/
1101 MAKEFLAGS="$MAKEFLAGS DP_CRYPTO_STATIC_LIBDIR=../misc/builddeps/dp.linux64/lib/ DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR=../misc/builddeps/dp.linux64/lib/"
1104 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libd0_blind_id".* .libs/
1105 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libd0_rijndael".* .libs/
1106 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libgmp".* .libs/
1107 MAKEFLAGS="$MAKEFLAGS DP_CRYPTO_STATIC_LIBDIR=../misc/builddeps/dp.linux32/lib/ DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR=../misc/builddeps/dp.linux32/lib/"
1115 verbose cp "$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS/libd0_blind_id".* .libs/
1116 verbose cp "$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS/libd0_rijndael".* .libs/
1126 if [ -f Makefile ]; then
1127 verbose make $MAKEFLAGS distclean
1130 if ! [ -f Makefile ]; then
1131 verbose sh autogen.sh
1134 verbose make $MAKEFLAGS
1137 verbose cd "$d0/fteqcc"
1139 verbose make $MAKEFLAGS clean
1141 verbose make $MAKEFLAGS
1143 verbose cd "$d0/data/xonotic-data.pk3dir"
1145 verbose make FTEQCC="../../../../fteqcc/fteqcc.bin" "$@" $MAKEFLAGS clean
1147 verbose make FTEQCC="../../../../fteqcc/fteqcc.bin" "$@" $MAKEFLAGS
1148 # 4 levels up: data, xonotic-data, qcsrc, server
1150 verbose cd "$d0/darkplaces"
1151 if [ x"$BAD_TARGETS" = x" " ]; then
1152 $ECHO "Warning: invalid empty client, default clients will be used."
1155 verbose make $MAKEFLAGS clean
1157 for T in $TARGETS; do
1158 verbose make $MAKEFLAGS STRIP=: "$@" "$T"
1160 for T in $BAD_TARGETS; do
1161 $ECHO "Warning: discarded invalid client $T."
1164 verbose "$SELF" update-maps
1167 if [ -n "$WE_HATE_OUR_USERS" ]; then
1169 export PATH="$d0/misc/buildfiles/win32:$d0/d0_blind_id/.libs:$PATH"
1170 elif [ x"`uname`" = x"Darwin" ]; then
1171 export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS:$d0/d0_blind_id/.libs"
1172 export DYLD_FRAMEWORK_PATH="$d0/misc/buildfiles/osx/Xonotic.app/Contents/Frameworks"
1175 export LD_LIBRARY_PATH="$d0/d0_blind_id/.libs"
1179 sdl|glx|agl|dedicated)
1188 if ! [ -x "darkplaces/darkplaces$client" ]; then
1189 if [ -x "darkplaces/darkplaces$client.exe" ]; then
1192 $ECHO "Client darkplaces/darkplaces$client not found, aborting"
1196 set -- "darkplaces/darkplaces$client" -xonotic "$@"
1198 # if pulseaudio is running: USE IT
1199 if [ -z "$SDL_AUDIODRIVER" ] && ! [ -n "$WE_HATE_OUR_USERS" ] && ! [ x"`uname`" = x"Darwin" ]; then
1200 if ps -C pulseaudio >/dev/null; then
1201 if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
1202 export SDL_AUDIODRIVER=pulse
1209 if [ x"$USE_GDB" = x"yes" ]; then
1210 set -- gdb --args "$@"
1211 elif [ x"$USE_GDB" = x"core" ] && which gdb >/dev/null 2>&1; then
1212 set -- gdb --batch -x savecore.gdb --args "$@"
1213 elif which catchsegv >/dev/null 2>&1; then
1214 set -- catchsegv "$@"
1218 if [ -f xonotic.core ]; then
1219 if yesno "The program has CRASHED. Do you want to examine the core dump?"; then
1220 gdb "$binary" xonotic.core
1221 #elif yesno "You did not want to examine the core dump. Do you want to provide it - including your DarkPlaces checkout - to the Xonotic developers?"; then
1222 # tar cvzf xonotic.core.tar.gz xonotic.core darkplaces/*.c darkplaces/*.h
1224 # rm -f xonotic.core.tar.gz
1226 $ECHO "The core dump can be examined later by"
1227 $ECHO " gdb $binary xonotic.core"
1234 if [ x"$1" = x"-k" ]; then
1239 if verbose cd "$d0/$d"; then
1240 if $keep_going; then
1241 verbose "$@" || true
1251 patchdir=`mktemp -d -t save-patches.XXXXXX`
1253 enter "$d0/$d" verbose
1254 git branch -v -v | cut -c 3- | {
1256 while read -r BRANCH REV UPSTREAM TEXT; do
1259 UPSTREAM=${UPSTREAM#\[}
1260 UPSTREAM=${UPSTREAM%\]}
1261 UPSTREAM=${UPSTREAM%:*}
1265 UPSTREAM=origin/"`repobranch "$d"`"
1269 if [ x"$REV" = x"->" ]; then
1272 if git format-patch -o "$patchdir/$i" "$UPSTREAM".."$BRANCH"; then
1273 $ECHO "$d" > "$patchdir/$i/info.txt"
1274 $ECHO "$BRANCH" >> "$patchdir/$i/info.txt"
1275 $ECHO "$UPSTREAM" >> "$patchdir/$i/info.txt"
1276 $ECHO "$TRACK" >> "$patchdir/$i/info.txt"
1279 rm -rf "$patchdir/$i"
1284 ( cd "$patchdir" && tar cvzf - . ) > "$outfile"
1289 patchdir=`mktemp -d -t restore-patches.XXXXXX`
1290 ( cd "$patchdir" && tar xvzf - ) < "$infile"
1292 for P in "$patchdir"/*/info.txt; do
1297 read -r UPSTREAM <&3
1299 verbose git checkout HEAD^0
1300 verbose git branch -D "$BRANCH"
1301 if [ x"$TRACK" = x"true" ]; then
1302 verbose git checkout --track -b "$BRANCH" "$UPSTREAM"
1304 verbose git branch -b "$BRANCH" "$UPSTREAM"
1323 report=$report"$*$LF"
1328 report=$report" $*$LF"
1333 o=`"$@" | sed 's/^/ /' || true`
1339 # sorry, fteqcc repo is managed manually
1343 enter "$d0/$d" verbose
1344 base="`repobranch "$d"`"
1346 for ref in `git for-each-ref --format='%(refname)' refs/remotes/origin/`; do
1347 case "${ref#refs/remotes/origin/}" in
1360 if [ -n "$branch" ]; then
1361 if [ x"$branch" != x"${ref#refs/remotes/origin/}" ]; then
1370 l0=`git rev-list "$base".."$ref" | wc -l`
1371 l1=`git rev-list master.."$ref" | wc -l`
1372 if [ $l0 -gt $l1 ]; then
1379 reportecho " Branch $ref:"
1380 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
1381 logdata=`git log --color "$realbase".."$ref"`
1382 if [ -z "$logdata" ]; then
1383 reportecho4 "--> not merging, no changes vs master"
1384 if yesno "Branch \"$ref\" probably should get deleted. Do it?" ''; then
1385 git push origin :"${ref#refs/remotes/origin/}"
1386 reportecho4 "--> branch deleted"
1389 diffdata=`git diff --color --find-copies-harder --ignore-space-change "$realbase"..."$ref"`
1390 if [ -z "$diffdata" ]; then
1391 reportecho4 "--> not merging, no changes vs master, branch contains redundant history"
1392 if yesno "Branch \"$ref\" probably should get deleted. Do it?" '{ $ECHO "$logdata"; } | less -r'; then
1393 git push origin :"${ref#refs/remotes/origin/}"
1394 reportecho4 "--> branch deleted"
1396 elif $only_delete; then
1397 reportecho4 "--> skipped in delete-only run"
1398 elif [ -z "$branch" ] && [ -n "$note" ]; then
1399 reportdo4 $ECHO "$note"
1400 reportecho4 "--> not merging, already had this one rejected before"
1401 elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ $ECHO "$logdata"; $ECHO "$diffdata"; } | less -r'; then
1402 git checkout "$realbase"
1403 org=`git rev-parse HEAD`
1404 if ! git merge --no-ff "$ref" 2>&1 | tee "$t" && ! { git ls-files -u | grep ' 1 ' >/dev/null; }; then
1405 git reset --hard "$org"
1406 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Merge failed:$LF`cat "$t"`" "$ref"
1408 reportecho4 "--> merge failed"
1409 elif ! "$SELF" compile 2>&1 | tee "$t"; then
1410 git reset --hard "$org"
1411 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Compile failed:$LF`cat "$t"`" "$ref"
1413 reportecho4 "--> compile failed"
1414 elif ! yesno "Still merge \"$ref\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
1415 git reset --hard "$org"
1416 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
1417 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
1418 if [ x"$note" = x"del" ]; then
1419 git push origin :"${ref#refs/remotes/origin/}"
1420 reportecho4 "--> test failed, branch deleted"
1421 elif [ -n "$note" ]; then
1422 reportdo4 $ECHO "$note"
1423 reportecho4 "--> test failed"
1425 reportecho4 "--> test failed, postponed"
1428 # apply crlf, or other cleanup filters (non-behavioural changes)
1430 find . -type f -exec touch {} \;
1431 git commit -a --amend -C HEAD || true # don't fail if nothing to commit
1434 case ",`repoflags "$d"`," in
1436 # we do quite a mess here... luckily we know $org
1437 git fetch # svn needs to be current
1438 git rebase -i --onto origin/master "$org"
1439 git svn dcommit --add-author-from
1440 git reset --hard "$org"
1443 git push origin HEAD
1446 reportecho4 "--> MERGED"
1447 if yesno "Delete original branch \"$ref\"?"; then
1448 git push origin :"${ref#refs/remotes/origin/}"
1449 reportecho4 "--> branch deleted"
1453 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
1454 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
1455 if [ x"$note" = x"del" ]; then
1456 git push origin :"${ref#refs/remotes/origin/}"
1457 reportecho4 "--> branch deleted"
1458 elif [ -n "$note" ]; then
1459 reportdo4 $ECHO "$note"
1460 reportecho4 "--> rejected"
1462 reportecho4 "--> postponed"
1471 $ECHO "$report" | ssh nexuiz@rm.endoftheinternet.org cat '>>' public_html/xonotic-merge-notes.txt
1483 # ./all clean [-m] [-f | -fu | -fU] [-r] [-D]
1484 # ./all clean --reclone
1487 if [ x"$X" = x"--reclone" ]; then
1494 elif [ x"$X" = x"-f" ]; then
1496 elif [ x"$X" = x"-u" ]; then
1498 elif [ x"$X" = x"-U" ]; then
1501 elif [ x"$X" = x"-fu" ]; then
1504 elif [ x"$X" = x"-fU" ]; then
1508 elif [ x"$X" = x"-m" ]; then
1510 elif [ x"$X" = x"-r" ]; then
1512 elif [ x"$X" = x"-D" ]; then
1514 elif $ECHO "$X" | grep '^-FFFF*UUUU*$' >/dev/null; then
1517 msg " ,--'-\\P/\`\\ FFFFFFF"
1518 msg " __/_ B/,-.\\ FFFFFFF"
1519 msg " / _\\ (// O\\\\ FFFFFF"
1520 msg "| (O \`) _\\._ _)\\ FFFUU"
1521 msg "| |___/.^d0~~\"\\ \\ UUUU"
1522 msg "| |\`~' \\ | UUUU"
1523 msg "| | __,C>|| UUUU"
1524 msg "\\ /_ ,-/,-' | UUUU"
1525 msg " \\\\_ \\_>~' / UUUU-"
1528 msg "Unknown arg: $X"
1537 if $gotoupstream; then
1539 msg "Must also use -f (delete local changes) when using -u"
1542 if $gotomaster; then
1543 if $fetchupstream; then
1544 verbose git fetch origin
1545 verbose git remote prune origin
1547 verbose git checkout -f "`repobranch "$d"`"
1548 verbose git reset --hard origin/"`repobranch "$d"`"
1550 r=`git symbolic-ref HEAD`
1552 rem=`git config "branch.$r.remote" || $ECHO origin`
1553 bra=`git config "branch.$r.merge" || $ECHO "$r"`
1554 upstream="$rem/${bra#refs/heads/}"
1555 if $fetchupstream; then
1556 verbose git fetch "$rem"
1557 verbose git remote prune "$rem"
1559 if ! git rev-parse "$upstream" >/dev/null 2>&1; then
1560 upstream="origin/`repobranch "$d"`"
1562 verbose git reset --hard "$upstream"
1564 elif $gotomaster; then
1566 verbose git checkout -f "`repobranch "$d"`"
1567 verbose git reset --hard
1569 verbose git checkout "`repobranch "$d"`"
1572 verbose git reset --hard
1574 if $rmuntracked; then
1577 verbose git clean -df || true
1580 verbose git clean -xdf || true
1584 if $killbranches; then
1585 git for-each-ref --format='%(refname)' refs/heads/ | while IFS= read -r B; do
1586 if [ x"$B" != x"`git symbolic-ref HEAD`" ]; then
1587 verbose git branch -D "${B#refs/heads/}"
1590 git rev-parse refs/heads/master >/dev/null 2>&1 || verbose git branch --track master origin/master || true
1591 git rev-parse "refs/heads/`repobranch "$d"`" >/dev/null 2>&1 || verbose git branch --track "`repobranch "$d"`" origin/"`repobranch "$d"`" || true
1593 checkself "$cmd" "$@"
1597 # release building goes here
1599 #"$SELF" each git clean -fxd
1600 case "$RELEASETYPE" in
1602 $ECHO >&2 -n "$ESC[2J$ESC[H"
1609 msg " +---------------------------------------------------------.---+"
1611 msg " +---------------------------------------------------------^---+"
1613 msg " | / \ This is the official release build system. |"
1614 msg " | | | If you are not a member of the Xonotic Core Team, |"
1615 msg " | | STOP | you are not supposed to use this script and should |"
1616 msg " | | | instead use ./all compile to compile the engine |"
1617 msg " | \____/ and game code. |"
1619 msg " | [ I understand ] |"
1620 msg " +-------------------------------------------------------------+"
1622 # A LOT of build infrastructure is required:
1625 # - .ssh/config must be configured so the following
1626 # host names are reachable and have a compile
1627 # infrastructure set up:
1628 # - xonotic-build-linux32 (with gcc on x86)
1629 # - xonotic-build-linux64 (with gcc on x86_64)
1630 # - xonotic-build-win32 (with i586-mingw32msvc-g++)
1631 # - xonotic-build-win64 (with amd64-mingw32msvc-g++
1632 # and x86_64-w64-mingw32-g++)
1633 # - xonotic-build-osx (with Xcode and SDL.framework)
1634 # - AMD Compressonator installed in WINE
1635 # - ResEdit installed in WINE
1636 # - a lot of other requirements you will figure out
1637 # while reading the error messages
1638 # - environment variable RELEASETYPE set
1639 # - optionally, environment variable RELEASEDATE set
1644 msg "Building a FINISHED RELEASE"
1647 msg "Building a $RELEASETYPE"
1650 verbose rm -rf Xonotic Xonotic*.zip
1651 verbose mkdir -p Xonotic
1652 if [ -n "$RELEASEDATE" ]; then
1653 verbose $ECHO "$RELEASEDATE" > Xonotic/stamp.txt
1655 verbose date +%Y%m%d > Xonotic/stamp.txt
1657 release_git_extract_dir "." "Xonotic" Docs misc server xonotic-linux-glx.sh xonotic-linux-sdl.sh misc/buildfiles key_0.d0pk COPYING GPL-2 GPL-3
1660 verbose mkdir data fteqcc source source/darkplaces source/fteqcc source/d0_blind_id mapping
1661 verbose rm -rf misc/builddeps
1662 verbose mv misc/buildfiles/win32 bin32 || true
1663 verbose mv bin32/SDL.dll . || true
1664 verbose mv misc/buildfiles/win64 bin64 || true
1665 verbose mv misc/buildfiles/osx/* . || true
1666 verbose rm -rf misc/buildfiles
1667 verbose rm -rf misc/pki
1669 release_git_extract_dir "darkplaces" "Xonotic/source/darkplaces" .
1670 release_git_extract_dir "fteqcc" "Xonotic/source/fteqcc" .
1671 release_git_extract_dir "data/xonotic-data.pk3dir" "Xonotic/source" qcsrc Makefile
1672 release_git_extract_dir "d0_blind_id" "Xonotic/source/d0_blind_id" .
1674 verbose cd Xonotic/source/d0_blind_id
1675 verbose sh autogen.sh
1677 rm -f Xonotic/key_15.d0pk
1679 verbose cd Xonotic/mapping
1680 verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20120114.tar.bz2
1681 verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20120114-win32-7z.exe
1682 for X in *-7z.exe; do
1686 # TODO possibly include other tools?
1689 release-compile-run)
1698 if [ -n "$targetfiles" ]; then
1699 case " $HOSTS_THAT_ARE_DISABLED " in
1704 case " $HOSTS_THAT_ARE_MYSELF " in
1706 verbose rsync --delete -zLvaSHP "$srcdir"/ "$buildpath/"
1707 verbose rsync --delete -zLvaSHP "$depsdir"/ "$buildpath.deps/"
1708 verbose ln -snf "$buildpath.deps" "$buildpath/.deps"
1709 verbose eval make -C "$buildpath" clean $maketargets $makeflags
1710 for f in $targetfiles; do
1711 verbose mv "$buildpath/${f%:*}" "${f##*:}" || true
1715 verbose rsync --delete -zLvaSHP "$srcdir"/ "$host:$buildpath/"
1716 verbose rsync --delete -zLvaSHP "$depsdir"/ "$host:$buildpath.deps/"
1717 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"
1718 for f in $targetfiles; do
1719 verbose rsync -zvaSHP "$host:$buildpath/${f%:*}" "${f##*:}" || true
1723 # now rebrand the binaries...
1724 for f in $targetfiles; do
1725 #verbose "$d0/misc/tools/rebrand-darkplaces-engine.sh" "${XONOTIC_BRAND:-$d0/misc/tools/xonotic.brand}" "${f##*:}" || true
1727 Xonotic/xonotic*.exe)
1728 verbose "$d0/misc/tools/change-icon-of-exe.sh" "$d0/misc/logos/icons_ico/xonotic.ico" "${f##*:}"
1737 fteqcc_maketargets=$3
1739 darkplaces_maketargets=$5
1741 host=xonotic-build-$suffix
1742 verbose "$SELF" release-compile-run "$host" /tmp/fteqcc.build."$suffix" "$fteqcc_maketargets" "$makeflags" "Xonotic/source/fteqcc" "$d0/misc/builddeps/dp.$suffix" "$fteqcc_files"
1743 verbose "$SELF" release-compile-run "$host" /tmp/Darkplaces.build."$suffix" "$darkplaces_maketargets" "$makeflags" "Xonotic/source/darkplaces" "$d0/misc/builddeps/dp.$suffix" "$darkplaces_files"
1745 release-engine-win32)
1746 verbose "$SELF" release-compile win32 \
1747 'STRIP=: DP_MAKE_TARGET=mingw CC="i586-mingw32msvc-gcc -march=i686 -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" LIB_JPEG= CFLAGS_LIBJPEG= WIN32RELEASE=1 D3D=0' \
1748 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc.exe' \
1750 verbose "$SELF" release-compile win32 \
1751 'STRIP=: DP_MAKE_TARGET=mingw CC="i586-mingw32msvc-g++ -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" LIB_JPEG= CFLAGS_LIBJPEG= WIN32RELEASE=1 D3D=1' \
1753 release 'darkplaces.exe:Xonotic/xonotic.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe'
1755 release-engine-win64)
1756 verbose "$SELF" release-compile win64 \
1757 'STRIP=: DP_MAKE_TARGET=mingw 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" LIB_JPEG= CFLAGS_LIBJPEG= WIN64RELEASE=1 D3D=0' \
1758 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc-x64.exe' \
1759 'sv-release sdl-release' 'darkplaces-sdl.exe:Xonotic/xonotic-x64-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-x64-dedicated.exe'
1760 verbose "$SELF" release-compile win64 \
1761 'STRIP=: DP_MAKE_TARGET=mingw CC="x86_64-w64-mingw32-g++ -g1 -Wl,--dynamicbase -Wl,--nxcompat -I.deps/include -L.deps/lib -DSUPPORTIPV6" WINDRES="x86_64-w64-mingw32-windres" SDL_CONFIG=".deps/bin/sdl-config" LIB_JPEG= CFLAGS_LIBJPEG= WIN64RELEASE=1 D3D=1' \
1763 cl-release 'darkplaces.exe:Xonotic/xonotic-x64.exe'
1766 # gcc on OSX is buggy, needs -fno-reorder-blocks for a release build to succeed
1767 verbose "$SELF" release-compile osx \
1768 '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"' \
1769 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.osx' \
1770 'sv-release sdl-release' 'darkplaces-sdl:Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-sdl-bin darkplaces-dedicated:Xonotic/xonotic-osx-dedicated'
1772 release-engine-linux32)
1773 verbose "$SELF" release-compile linux32 \
1774 'STRIP=: CC="gcc -m32 -march=i686 -g1 -I.deps/include -L.deps/lib -DSUPPORTIPV6" DP_MODPLUG_STATIC_LIBDIR=.deps/lib LIB_JPEG=.deps/lib/libjpeg.a DP_CRYPTO_STATIC_LIBDIR=.deps/lib' \
1775 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux32' \
1776 release 'darkplaces-glx:Xonotic/xonotic-linux32-glx darkplaces-sdl:Xonotic/xonotic-linux32-sdl darkplaces-dedicated:Xonotic/xonotic-linux32-dedicated'
1778 release-engine-linux64)
1779 verbose "$SELF" release-compile linux64 \
1780 'STRIP=: CC="gcc -m64 -g1 -I.deps/include -L.deps/lib -DSUPPORTIPV6" DP_MODPLUG_STATIC_LIBDIR=.deps/lib LIB_JPEG=.deps/lib/libjpeg.a DP_CRYPTO_STATIC_LIBDIR=.deps/lib' \
1781 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux64' \
1782 release 'darkplaces-glx:Xonotic/xonotic-linux64-glx darkplaces-sdl:Xonotic/xonotic-linux64-sdl darkplaces-dedicated:Xonotic/xonotic-linux64-dedicated'
1785 verbose "$SELF" release-engine-linux32 &
1786 verbose "$SELF" release-engine-linux64 &
1787 verbose "$SELF" release-engine-win32 &
1788 verbose "$SELF" release-engine-win64 &
1789 verbose "$SELF" release-engine-osx &
1798 verbose "$SELF" update-maps
1801 verbose env GIT_DIR="$d0/data/xonotic-data.pk3dir/.git" make -C Xonotic/source FTEQCC="$d0/Xonotic/fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 clean all
1802 verbose rm -f Xonotic/source/qcsrc/*/fteqcc.log
1804 release-buildpk3-transform-raw)
1807 release-buildpk3-transform-normal)
1810 # texture: convert to jpeg and dds
1811 verbose export do_jpeg=true
1812 verbose export jpeg_qual_rgb=97
1813 verbose export jpeg_qual_a=99
1814 verbose export do_dds=false
1815 verbose export do_ogg=true
1816 verbose export ogg_ogg=false
1817 verbose export del_src=true
1818 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1820 release-buildpk3-transform-normaldds)
1823 # texture: convert to jpeg and dds
1824 # music: reduce bitrate
1825 verbose export do_jpeg=false
1826 verbose export do_jpeg_if_not_dds=true
1827 verbose export jpeg_qual_rgb=95
1828 verbose export jpeg_qual_a=99
1829 verbose export do_dds=true
1830 verbose export dds_flags=
1831 verbose export do_ogg=true
1832 verbose export ogg_ogg=false
1833 verbose export del_src=true
1834 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1836 release-buildpk3-transform-low)
1839 # texture: convert to jpeg and dds
1840 # music: reduce bitrate
1841 verbose export do_jpeg=true
1842 verbose export jpeg_qual_rgb=80
1843 verbose export jpeg_qual_a=97
1844 verbose export do_dds=false
1845 verbose export do_ogg=true
1846 verbose export ogg_qual=1
1847 verbose export del_src=true
1848 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1850 release-buildpk3-transform-lowdds)
1853 # texture: convert to jpeg and dds
1854 # music: reduce bitrate
1855 verbose export do_jpeg=false
1856 verbose export do_jpeg_if_not_dds=true
1857 verbose export jpeg_qual_rgb=80
1858 verbose export jpeg_qual_a=99
1859 verbose export do_dds=true
1860 verbose export dds_flags=
1861 verbose export do_ogg=true
1862 verbose export ogg_qual=1
1863 verbose export del_src=true
1864 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1866 release-buildpk3-transform-mapping)
1869 # remove stuff radiant has no use for
1870 verbose find . -name \*_norm.\* -exec rm -f {} \;
1871 verbose find . -name \*_bump.\* -exec rm -f {} \;
1872 verbose find . -name \*_glow.\* -exec rm -f {} \;
1873 verbose find . -name \*_gloss.\* -exec rm -f {} \;
1874 verbose find . -name \*_pants.\* -exec rm -f {} \;
1875 verbose find . -name \*_shirt.\* -exec rm -f {} \;
1876 verbose find . -name \*_reflect.\* -exec rm -f {} \;
1877 verbose find . -not \( -name \*.tga -o -name \*.png -o -name \*.jpg \) -exec rm -f {} \;
1878 # texture: convert to jpeg and dds
1879 # music: reduce bitrate
1880 verbose export do_jpeg=true
1881 verbose export jpeg_qual_rgb=80
1882 verbose export jpeg_qual_a=97
1883 verbose export do_dds=false
1884 verbose export do_ogg=true
1885 verbose export ogg_qual=1
1886 verbose export del_src=true
1887 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1901 verbose rm -rf Xonotic/temp
1902 release_timereport "deleted temp directory"
1903 verbose mkdir -p Xonotic/temp
1904 release_git_extract_dir "$src" "Xonotic/temp" .
1905 release_timereport "extracted data"
1906 verbose cd Xonotic/temp
1907 if [ x"$src" = x"data/xonotic-data.pk3dir" ]; then
1908 verbose cp ../source/progs.dat .
1909 verbose cp ../source/csprogs.dat .
1910 verbose cp ../source/menu.dat .
1911 verbose rm -rf qcsrc
1912 gv=`grep "^gameversion " "defaultXonotic.cfg" | awk '{ print $2 }'`
1913 major=$(($gv / 10000))
1914 minor=$((($gv / 100) - ($major * 100)))
1915 patch=$(($gv - ($major * 10000) - ($minor * 100)))
1916 versionstr="$major.$minor.$patch"
1917 case "$RELEASETYPE" in
1921 versionstr="$versionstr$RELEASETYPE"
1924 if [ $gv -lt 9900 ]; then
1925 # pre-1.0: compatible with any other pre-1.0
1927 s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
1928 s/^gameversion_min [0-9]*/gameversion_min 0/;
1929 s/^gameversion_max [0-9]*/gameversion_max 9999/;
1930 " < defaultXonotic.cfg > defaultXonotic.cfg.new
1934 s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
1935 s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
1936 s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/;
1937 " < defaultXonotic.cfg > defaultXonotic.cfg.new
1939 mv defaultXonotic.cfg.new defaultXonotic.cfg
1940 case "$RELEASETYPE" in
1942 echo "" >> defaultXonotic.cfg
1943 echo "// nicer menu" >> defaultXonotic.cfg
1944 echo "set menu_watermark \"\"" >> defaultXonotic.cfg
1948 verbose cd gfx/menu/luminos
1949 verbose rm -f background_l2.tga background_ingame_l2.tga
1950 verbose cp "$d0"/mediasource/gfx/menu/luminos_versionbuilder/background_l2.svg .
1951 verbose "$d0"/mediasource/gfx/menu/luminos_versionbuilder/versionbuilder "$versionstr"
1952 verbose rm background_l2.svg
1955 if [ x"$src" = x"data/xonotic-maps.pk3dir" ]; then
1956 for X in ../../data/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
1957 if [ -f "$X" ]; then
1959 verbose rm -f maps/*.log maps/*.irc maps/*.lin
1963 verbose export git_src_repo="$d0/$src" # skip hash-object
1964 release_timereport "processed data"
1965 verbose "$SELF" release-buildpk3-transform-$transform "Xonotic/temp"
1966 release_timereport "transformed data"
1967 find . -type f -size +4k | verbose "$d0"/misc/tools/symlink-deduplicate.sh
1968 release_timereport "deduplicated data"
1969 verbose mkzipr "../../$dst" *
1970 release_timereport "zipped data"
1972 verbose rm -rf Xonotic/temp
1973 release_timereport "deleted temp directory again"
1976 stamp=`cat Xonotic/stamp.txt`
1982 dst="data/xonotic-$stamp-${dst#data/xonotic-}"
1988 while [ "$#" -gt 1 ]; do
1989 verbose "$SELF" release-buildpk3 "$src" "Xonotic/$dst$2.pk3" "$1"
1995 verbose "$SELF" release-buildpk3s data/font-nimbussansl.pk3dir raw ''
1996 verbose "$SELF" release-buildpk3s data/font-xolonium.pk3dir raw ''
1997 verbose "$SELF" release-buildpk3s data/xonotic-data.pk3dir normal '-high' low '-low' normaldds ''
1998 verbose "$SELF" release-buildpk3s data/xonotic-maps.pk3dir normal '-high' low '-low' normaldds '' mapping '-mapping'
1999 verbose "$SELF" release-buildpk3s data/xonotic-music.pk3dir raw '' low '-low'
2000 verbose "$SELF" release-buildpk3s data/xonotic-nexcompat.pk3dir normal '-high' normaldds ''
2002 release-pack-needsx11)
2005 verbose startx "$SELF" release-pack -- /usr/bin/Xvfb :7
2008 verbose "$SELF" release-pack
2013 stamp=`cat Xonotic/stamp.txt`
2014 # exe and dll files do not need +x, so this makes them eligible for 7zip compression too
2015 chmod a-x Xonotic/*.exe Xonotic/*.dll || true
2016 # let's pass crypto import laws of some nasty countries
2017 crypto_libs=`find Xonotic -name \*d0_rijndael\*.so -o -name \*d0_rijndael\*.dylib -o -name \*d0_rijndael\*.dll -o -name \*d0_rijndael\*.c`
2018 if [ -n "$crypto_libs" ]; then
2019 verbose mkzip Xonotic-$stamp-crypto.zip \
2021 Xonotic/COPYING Xonotic/GPL-2 Xonotic/GPL-3
2024 # build the archives
2025 verbose mkzip Xonotic-$stamp-enginesource.zip \
2026 Xonotic/source/darkplaces/ \
2027 Xonotic/COPYING Xonotic/GPL-2 Xonotic/GPL-3
2028 verbose cp Xonotic-$stamp-enginesource.zip Xonotic-$stamp-engine.zip
2029 verbose mkzip Xonotic-$stamp-engine.zip \
2031 Xonotic/bin32/*.dll \
2032 Xonotic/bin64/*.dll \
2036 verbose cp Xonotic-$stamp-engine.zip Xonotic-$stamp-common.zip
2037 verbose mkzip Xonotic-$stamp-common.zip \
2038 Xonotic/source/fteqcc/ \
2039 Xonotic/source/qcsrc/ \
2044 Xonotic/key_0.d0pk \
2045 Xonotic/data/font-nimbussansl-$stamp.pk3 \
2046 Xonotic/data/font-xolonium-$stamp.pk3
2047 verbose cp Xonotic-$stamp-enginesource.zip Xonotic-$stamp-source.zip
2048 verbose mkzip Xonotic-$stamp-source.zip \
2049 Xonotic/source/fteqcc/ \
2050 Xonotic/source/qcsrc/ \
2052 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp.zip
2053 verbose mkzip0 Xonotic-$stamp.zip \
2054 Xonotic/data/xonotic-$stamp-data.pk3 \
2055 Xonotic/data/xonotic-$stamp-maps.pk3 \
2056 Xonotic/data/xonotic-$stamp-music.pk3 \
2057 Xonotic/data/xonotic-$stamp-nexcompat.pk3
2058 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-low.zip
2059 verbose mkzip0 Xonotic-$stamp-low.zip \
2060 Xonotic/data/xonotic-$stamp-data-low.pk3 \
2061 Xonotic/data/xonotic-$stamp-maps-low.pk3 \
2062 Xonotic/data/xonotic-$stamp-music-low.pk3
2063 verbose mv Xonotic-$stamp-common.zip Xonotic-$stamp-high.zip
2064 verbose mkzip Xonotic-$stamp-high.zip \
2066 verbose mkzip0 Xonotic-$stamp-high.zip \
2067 Xonotic/data/xonotic-$stamp-data-high.pk3 \
2068 Xonotic/data/xonotic-$stamp-maps-high.pk3 \
2069 Xonotic/data/xonotic-$stamp-music.pk3 \
2070 Xonotic/data/xonotic-$stamp-nexcompat-high.pk3
2071 verbose mkzip Xonotic-$stamp-mappingsupport.zip \
2073 verbose mkzip0 Xonotic-$stamp-mappingsupport.zip \
2074 Xonotic/data/xonotic-$stamp-maps-mapping.pk3
2077 verbose "$SELF" release-prepare
2078 verbose "$SELF" release-maps
2079 verbose "$SELF" release-engine
2080 verbose "$SELF" release-qc
2081 verbose "$SELF" release-pack-needsx11
2082 verbose "$SELF" release-zip
2087 $ECHO " $SELF admin-merge [<branch>]"
2088 $ECHO " $SELF branch <branch>"
2089 $ECHO " $SELF branch <remote> <branch> [<srcbranch>]"
2090 $ECHO " $SELF branches"
2091 $ECHO " $SELF checkout|switch <branch>"
2092 $ECHO " $SELF checkout|switch <remote>/<branch>"
2093 $ECHO " $SELF clean [-m] [-f | -fu | -fU] [-r] [-D]"
2094 $ECHO " $SELF clean --reclone"
2095 $ECHO " $SELF compile [-c] [-r|-p] [-0] [sdl|glx|wgl|agl|dedicated]"
2096 $ECHO " $SELF each|foreach [-k] command..."
2097 $ECHO " $SELF fix_upstream_rebase"
2098 $ECHO " $SELF keygen"
2099 $ECHO " $SELF merge"
2100 $ECHO " $SELF push|commit [-s]"
2101 $ECHO " $SELF restore-patches"
2102 $ECHO " $SELF run [sdl|glx|wgl|agl|dedicated] options..."
2103 $ECHO " $SELF save-patches"
2104 $ECHO " $SELF update-maps"
2105 $ECHO " $SELF update|pull [-N] [-s | -h [-p] | -g [-p]] [-l de|nl|default]"