void-packages/srcpkgs/plan9port/template

58 lines
1.8 KiB
Bash

# Template file for 'plan9port'
pkgname=plan9port
version=20190619
revision=1
_githash=e995a0c101863688d5f14649ae3de45a7c43789c
archs="i686* x86_64* ppc64le*"
wrksrc="${pkgname}-${_githash}"
hostmakedepends="perl"
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="LPL-1.02"
homepage="https://9fans.github.io/plan9port/"
distfiles="https://github.com/9fans/plan9port/archive/${_githash}.tar.gz"
checksum=639e0bb01728ffd7cc1751eeb1bfc7314615d88d6fa7f4cde21033ad97622624
nocross=yes
if [[ $XBPS_TARGET_MACHINE == *-musl ]]; then
makedepends+=" libucontext-devel"
fi
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
vsed -e '1i#include <sys/types.h>' -i lib/linux-isnptl.c
}
do_build() {
CFLAGS+=' -D_DEFAULT_SOURCE'
echo "CFLAGS='$CFLAGS'" >LOCAL.config
echo "LDFLAGS='$LDFLAGS'" >>LOCAL.config
vsed -e 's/-O2/$CFLAGS/' -i bin/9c
if [[ $XBPS_TARGET_MACHINE == *-musl ]]; then
# add libucontext to extralibs under linux
vsed -e '/^\textralibs=.*-lresolv"$/s/"$/ -lucontext"/' -i bin/9l
fi
./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
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
}