Skip to content

Commit

Permalink
plan9port: update to 20190619.
Browse files Browse the repository at this point in the history
+ build with libucontext on musl
  • Loading branch information
huglovefan authored and Juan RP committed Oct 21, 2019
1 parent 7acadab commit 8d04054
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 14 deletions.
24 changes: 24 additions & 0 deletions srcpkgs/plan9port/patches/linux5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 81268c62d35f4b4bc226a4916a8354764b1f5853 Mon Sep 17 00:00:00 2001
From: Ivy Foster <iff@escondida.tk>
Date: Sat, 18 May 2019 14:25:01 -0500
Subject: [PATCH] 9l: Update and near-future-proof Linux version check

---
bin/9l | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git bin/9l bin/9l
index 6195815f7..d03b4760e 100755
--- bin/9l
+++ bin/9l
@@ -40,7 +40,9 @@ case "$tag" in
userpath=true
extralibs="$extralibs -lutil -lresolv"
case "${SYSVERSION:-`uname -r`}" in
- 2.6.* | 3.* | 4.*)
+ # Assuming that versions change more often than the name of
+ # the threading library, this should save some future updates.
+ 2.6.* | [3-9].* | [1-9][0-9].*)
extralibs="$extralibs -lpthread"
;;
esac
22 changes: 22 additions & 0 deletions srcpkgs/plan9port/patches/musl_getdents.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git src/lib9/dirread.c src/lib9/dirread.c
index 40fbe3c7..9e77eac8 100644
--- src/lib9/dirread.c
+++ src/lib9/dirread.c
@@ -10,6 +10,7 @@ extern int _p9dir(struct stat*, struct stat*, char*, Dir*, char**, char*);
static int
mygetdents(int fd, struct dirent *buf, int n)
{
+#if defined(__GLIBC__)
off_t off;
int nn;

@@ -17,6 +18,9 @@ mygetdents(int fd, struct dirent *buf, int n)
off = p9seek(fd, 0, 1);
nn = getdirentries(fd, (void*)buf, n, &off);
return nn;
+#else
+ return getdents(fd, (void*)buf, n);
+#endif
}
#elif defined(__APPLE__)
static int
36 changes: 22 additions & 14 deletions srcpkgs/plan9port/template
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
# Template file for 'plan9port'
pkgname=plan9port
version=20181112
version=20190619
revision=1
_githash=13ed1c423ecbd45d2ca982f2a7a433b785873629
archs="i686 x86_64 ppc64le" # swapcontext
_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="custom"
license="LPL-1.02"
homepage="https://9fans.github.io/plan9port/"
distfiles="https://github.com/9fans/plan9port/archive/${_githash}.tar.gz"
checksum=c86467b826331243db7814dcb1223d294c8ffaaaf5d9cb13d397c47a61e2ff39
checksum=639e0bb01728ffd7cc1751eeb1bfc7314615d88d6fa7f4cde21033ad97622624
nocross=yes

if [[ $XBPS_TARGET_MACHINE == *-musl ]]; then
makedepends+=" libucontext-devel"
fi

post_extract() {
# add missing LDFLAGS for some rules
sed -i '/prereq$/s/$/ $LDFLAGS/' \
src/cmd/auth/factotum/mkfile \
src/cmd/auth/secstore/mkfile \
src/cmd/devdraw/mkfile \
src/cmd/faces/mkfile \
src/cmd/mkfile
sed -i 's/-lX11$/& $LDFLAGS/g' src/cmd/rio/mkfile
sed -i '1i#include <sys/types.h>' lib/linux-isnptl.c
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
sed -i 's/-O2/$CFLAGS/' bin/9c
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
}
Expand Down

0 comments on commit 8d04054

Please sign in to comment.