void-packages/srcpkgs/plan9port/template

55 lines
1.7 KiB
Bash

# Template file for 'plan9port'
pkgname=plan9port
version=20220813
revision=1
_githash=93f814360076ccf28d33c9cb909fca7200ba4a7d
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, Bitstream-Vera"
homepage="https://9fans.github.io/plan9port/"
distfiles="https://github.com/9fans/plan9port/archive/${_githash}.tar.gz"
checksum=b89174eff5aa5034b6c1cf4e7839ab13a388d90810c64e9b59fc94cf07766c07
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
}
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 -r /usr/lib/plan9
}
do_install() {
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
}