void-packages/srcpkgs/plan9port/template
2021-03-30 16:53:29 +02:00

59 lines
1.9 KiB
Bash

# Template file for 'plan9port'
pkgname=plan9port
version=20210324
revision=1
_githash=88a87fadae6629932d9c160f53ad5d79775f8f94
wrksrc="${pkgname}-${_githash}"
hostmakedepends="perl which"
makedepends="libX11-devel libXt-devel libXext-devel freetype-devel fontconfig-devel"
short_desc="Port of many Plan 9 programs to Unix-like operating systems"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="MIT, bzip2-1.0.6, Public Domain, custom:Bigelow & Holmes,
custom:Bigelow & Holmes Inc and URW++ GmbH, custom:Bitstream Vera Fonts"
homepage="https://9fans.github.io/plan9port/"
distfiles="https://github.com/9fans/plan9port/archive/${_githash}.tar.gz"
checksum=d4b873a094035024fe54282a7fdd652255b73b51c4fd78ae7701746d1e3e8f38
nocross=yes
CFLAGS="-fcommon"
post_extract() {
# add missing LDFLAGS for some rules
vsed -e '/prereq$/s/$/ $LDFLAGS/' \
-i src/cmd/auth/factotum/mkfile \
-i src/cmd/auth/secstore/mkfile \
-i src/cmd/devdraw/mkfile \
-i src/cmd/faces/mkfile \
-i src/cmd/mkfile
vsed -e 's/-lX11$/& $LDFLAGS/g' -i src/cmd/rio/mkfile
sed -i "s,/usr/local/plan9,/usr/lib/plan9,g" \
$(grep -lr /usr/local/plan9)
}
do_build() {
CFLAGS+=' -D_DEFAULT_SOURCE'
echo "CFLAGS='$CFLAGS'" >LOCAL.config
echo "LDFLAGS='$LDFLAGS'" >>LOCAL.config
vsed -e 's/-O2/$CFLAGS/' -i bin/9c
NPROC=$XBPS_MAKEJOBS ./INSTALL
}
do_install() {
xargs -a lib/moveplan9.files -d'\n' sed -i "s#$wrksrc#/usr/lib/plan9#"
vinstall $FILESDIR/plan9.sh 644 etc/profile.d
vlicense LICENSE
vlicense src/cmd/bzip2/LICENSE LICENSE.bzip2
vlicense postscript/font/dejavu/LICENSE.dejavu
vlicense postscript/font/luxi/COPYRIGHT.BH
sed '1d' font/luc/NOTICE > NOTICE.BH
vlicense NOTICE.BH
vmkdir usr/lib
cp -a $wrksrc $DESTDIR/usr/lib/plan9
cd $DESTDIR/usr/lib/plan9
rm -f install.{log,sum}
sed -i -e "s|\(-specs=.*hardened-ld\)||g" -e "s|\(-specs=.*hardened-cc1\)||g" $DESTDIR/usr/lib/plan9/config $DESTDIR/usr/lib/plan9/LOCAL.config
}