1 # Maintainer: MrBougo <bougospam at gmail dot com>
2 # Contributor: wido <widomaker2k7@gmail.com>
3 # Contributor: Alexander Suhoverhov <cy at ngs dot ru>
8 pkgdesc="A free, fast-paced crossplatform first-person shooter"
10 url="http://xonotic.org"
25 makedepends=('git' 'p7zip' 'zip' 'unzip' 'vorbis-tools' 'sdl' 'mesa' 'imagemagick')
27 'libtheora: recording in ogv'
28 #'d0_blind_id-git: crypto libraries for player authentification'
33 _gitroot="git://git.xonotic.org/xonotic/xonotic.git"
35 _releasename="git-AUR"
38 # the jpeg and ogg variables can be modified, the function may also be skipped for raw data
39 # the values here are also used in the official -low builds
41 find $1 -type f -print0 |
43 CACHEDIR="$srcdir"/datacache \
51 xargs -0 "$srcdir"/$_gitname/misc/tools/cached-converter.sh
58 { cd "$_from"; git archive --format=tar HEAD -- "$@"; } \
65 # 7z compresses nicely but can't deal with flags and symlinks
70 find "$@" -xtype f \( -executable -or -type l \) -print > "$_ziplist"
71 7za a -tzip -mx=$_compression -x@"$_ziplist" "$_archive" "$@" || true
72 zip -$_compression -y -@<"$_ziplist" "$_archive" || true
76 #credit goes to omgwizard for the shallow clone idea
78 cd "$srcdir"/$_gitname
79 sed 's/git clone/git clone --depth 1/g' --in-place=".PKGBUILD_BU" ./all
81 mv -f ./all.PKGBUILD_BU ./all
87 msg "Connecting to GIT server...."
89 if [ -d $_gitname ] ; then
90 #future updates might introduce new subrepos, use shallow cloning anyway
91 cd $_gitname && _update
92 msg "The local files are updated."
94 git clone --depth 1 $_gitroot $_gitname
101 msg "GIT checkout done or server timeout"
105 msg "Copying sources..."
108 mkdir -p "$srcdir"/src/darkplaces "$srcdir"/src/fteqcc
109 _git_extract "$srcdir"/$_gitname/fteqcc "$srcdir"/src/fteqcc
110 _git_extract "$srcdir"/$_gitname/darkplaces "$srcdir"/src/darkplaces
111 _git_extract "$srcdir"/$_gitname/data/xonotic-data.pk3dir "$srcdir"/src \
112 qcsrc Makefile update-cvarcount.sh
114 msg "Fetching map binaries..."
115 cd "$srcdir"/$_gitname
118 msg "Compiling the engine..."
119 cd "$srcdir"/src/darkplaces
120 CC="${CC:-gcc} -g -DSUPPORTIPV6" make release
122 msg "Compiling fteqcc..."
123 cd "$srcdir"/src/fteqcc
126 msg "Compiling the game code"
128 make FTEQCC="../../fteqcc/fteqcc.bin" # relative to the directories containing progs.src
130 msg "Building data pk3's..."
131 rm -rf "$srcdir"/temp # just in case it was interrupted previously
134 for _subrepo in font-nimbussansl font-xolonium xonotic-data xonotic-music xonotic-maps; do
136 _git_extract "$srcdir"/$_gitname/data/$_subrepo.pk3dir "$srcdir"/temp/$_subrepo
139 rm -rf "$srcdir"/temp/xonotic-data/qcsrc
140 mv "$srcdir"/src/progs.dat "$srcdir"/src/csprogs.dat "$srcdir"/src/menu.dat "$srcdir"/temp/xonotic-data
142 cd "$srcdir"/temp/xonotic-maps
143 #2x40 question marks. That's as many as eight tens. And that's terrible.
144 for X in "$srcdir"/$_gitname/data/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
147 rm -f maps/*.log maps/*.irc maps/*.lin
151 msg "Compressing data..."
153 # don't compress the font files
154 for _subrepo in xonotic-data xonotic-music xonotic-maps; do
155 _compress $_subrepo "$srcdir"/$_gitname/data/$_subrepo.pk3dir
158 msg "Packing data..."
159 for _subrepo in font-nimbussansl font-xolonium xonotic-data xonotic-music xonotic-maps; do
160 cd "$srcdir"/temp/$_subrepo
161 _mkzip "$srcdir"/$_subrepo.pk3 * # this wildcard excludes dot files
164 msg "Removing temporary files..."
165 rm -rf "$srcdir"/temp
170 mkdir -p "$pkgdir"/opt/$pkgname/
171 _git_extract "$srcdir"/$_gitname/ "$pkgdir"/opt/$pkgname \
174 xonotic-linux-glx.sh xonotic-linux-sdl.sh \
176 chmod 755 "$pkgdir"/opt/$pkgname/xonotic-linux-glx.sh \
177 "$pkgdir"/opt/$pkgname/xonotic-linux-sdl.sh
179 # Binaries -- those names are needed by the launcher script
181 x86_64) _arch="linux64" ;;
182 *) _arch="linux32" ;;
184 install -m755 "$srcdir"/src/darkplaces/darkplaces-glx "$pkgdir"/opt/$pkgname/xonotic-$_arch-glx
185 install -m755 "$srcdir"/src/darkplaces/darkplaces-glx "$pkgdir"/opt/$pkgname/xonotic-$_arch-sdl
186 install -m755 "$srcdir"/src/darkplaces/darkplaces-dedicated "$pkgdir"/opt/$pkgname/xonotic-$_arch-dedicated
188 mkdir -p "$pkgdir"/opt/$pkgname/data/
189 mv -f "$srcdir"/*.pk3 "$pkgdir"/opt/$pkgname/data || true # those files are too big to be copied
192 mkdir -p "$pkgdir"/usr/bin
193 mv -f "$pkgdir"/opt/$pkgname/server/server_linux.sh "$pkgdir"/opt/$pkgname/
194 ln -sf /opt/$pkgname/xonotic-linux-glx.sh "$pkgdir"/usr/bin/xonotic-glx
195 ln -sf /opt/$pkgname/xonotic-linux-sdl.sh "$pkgdir"/usr/bin/xonotic-sdl
196 ln -sf /opt/$pkgname/server_linux.sh "$pkgdir"/usr/bin/xonotic-dedicated