5769f150de
```sh git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" | while read template; do for p in ${template%/template}/patches/*; do sed -i ' \,^[+-][+-][+-] /dev/null,b /^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b s,^[*][*][*] ,&a/, /^--- /{ s,\(^--- \)\(./\)*,\1a/, s,[.-][Oo][Rr][Ii][Gg]\([ /]\),\1, s/[.-][Oo][Rr][Ii][Gg]$// s/[.]patched[.]\([^.]\)/.\1/ h } /^+++ -/{ g s/^--- a/+++ b/ b } s,\(^+++ \)\(./\)*,\1b/, ' "$p" done sed -i '/^patch_args=/d' $template done ```
83 lines
2.3 KiB
Bash
83 lines
2.3 KiB
Bash
# Template file for 'ufoai'
|
|
pkgname=ufoai
|
|
version=2.5
|
|
revision=3
|
|
create_wrksrc=yes
|
|
build_style=gnu-makefile
|
|
hostmakedepends="pkg-config gettext"
|
|
makedepends="MesaLib-devel glu-devel libjpeg-turbo-devel
|
|
libvorbis-devel libopenal-devel xvidcore-devel libtheora-devel
|
|
SDL2_image-devel SDL2_mixer-devel SDL2_ttf-devel libcurl-devel
|
|
gtkglext-devel gtksourceview2-devel"
|
|
depends="ca-certificates"
|
|
short_desc="UFO Alien Invasion"
|
|
maintainer="Orphaned <orphan@voidlinux.org>"
|
|
license="GPL-2.0-or-later"
|
|
homepage="http://ufoai.org/"
|
|
distfiles="
|
|
${SOURCEFORGE_SITE}/${pkgname}/UFO_AI%202.x/${version}/${pkgname}-${version}-source.tar.bz2
|
|
${SOURCEFORGE_SITE}/${pkgname}/UFO_AI%202.x/${version}/${pkgname}-${version}-data.tar"
|
|
checksum="0c7cc3bc9efeb276f71cbe6ee8ff7c76f98d183de79f1a069fa63059cf182a8f
|
|
5e706a424aff6a2ea30a4c798129d6304e897387eadf808528129b512b7dcdb0"
|
|
replaces="ufoai-data>=0"
|
|
ignore_elf_dirs="/usr/share/ufoai"
|
|
broken="game doesn't work"
|
|
|
|
# suppress a lot of warnings
|
|
CXXFLAGS="-Wno-cast-align -Wno-cast-qual -Wno-inline"
|
|
LDFLAGS="-lX11"
|
|
|
|
post_extract() {
|
|
cd ${wrksrc}
|
|
mv ufoai-${version}-source/* .
|
|
}
|
|
do_configure() {
|
|
# Further reduce amount of warnings
|
|
sed -i build/platforms/linux.mk \
|
|
-e"s;_BSD_SOURCE;_DEFAULT_SOURCE;g"
|
|
|
|
# Disable building of maps and models
|
|
sed -i Makefile \
|
|
-e "s;include build/maps.mk;#&;" \
|
|
-e "s;include build/models.mk;#&;"
|
|
|
|
./configure --prefix=/usr \
|
|
--bindir=/usr/bin \
|
|
--datadir=/usr/share/ufoai \
|
|
--localedir=/usr/share/ufoai/base/i18n \
|
|
--enable-uforadiant \
|
|
--enable-release
|
|
}
|
|
do_build() {
|
|
make ${makejobs}
|
|
make ${makejobs} lang
|
|
make ${makejobs} uforadiant
|
|
}
|
|
post_install() {
|
|
local f
|
|
for f in ufo ufoai ufoai-safe ufoded uforadiant; do
|
|
if [ -f debian/$f.desktop ]; then
|
|
vinstall debian/$f.desktop 644 usr/share/applications
|
|
fi
|
|
if [ -f debian/$f.xpm ]; then
|
|
vinstall debian/$f.xpm 644 usr/share/pixmaps
|
|
fi
|
|
if [ -f debian/$f.6 ]; then
|
|
vman debian/$f.6
|
|
fi
|
|
done
|
|
# adjust desktop files
|
|
sed -i ${DESTDIR}/usr/share/applications/* -e "s;/usr/games/;;"
|
|
}
|
|
|
|
ufoai-radiant_package() {
|
|
short_desc+=" - map editor"
|
|
depends="${sourcepkg}>=${version}_${revision}"
|
|
pkg_install() {
|
|
vmove usr/bin/uforadiant
|
|
vmove usr/share/ufoai/radiant
|
|
vmove usr/share/applications/uforadiant.desktop
|
|
vmove usr/share/man/man6/uforadiant.6
|
|
vmove usr/share/pixmaps/uforadiant.xpm
|
|
}
|
|
}
|