Received: from vps892.directvps.nl (ikke.info [178.21.113.177]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 27E64781AC9 for ; Sun, 6 Oct 2019 07:19:08 +0000 (UTC) Received: by vps892.directvps.nl (Postfix, from userid 1008) id 3AE144400C5; Sun, 6 Oct 2019 09:19:07 +0200 (CEST) Date: Sun, 6 Oct 2019 09:19:07 +0200 From: Kevin Daudt To: Joshua Haase Cc: alpine-aports@lists.alpinelinux.org Subject: Re: [PATCH] testing/9base: new aport Message-ID: <20191006071907.GH160327@alpha> References: <20191006063956.23935-1-hahj87@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191006063956.23935-1-hahj87@gmail.com> User-Agent: Mutt/1.12.1 (2019-06-15) On Sun, Oct 06, 2019 at 01:39:56AM -0500, Joshua Haase wrote: > Closes #10855 > --- > testing/9base/APKBUILD | 50 ++++++++++++++++++++++++++++++++++ > testing/9base/config.mk.x86 | 24 ++++++++++++++++ > testing/9base/config.mk.x86_64 | 24 ++++++++++++++++ > testing/9base/dirread.patch | 17 ++++++++++++ > 4 files changed, 115 insertions(+) > create mode 100644 testing/9base/APKBUILD > create mode 100644 testing/9base/config.mk.x86 > create mode 100644 testing/9base/config.mk.x86_64 > create mode 100644 testing/9base/dirread.patch > > diff --git a/testing/9base/APKBUILD b/testing/9base/APKBUILD > new file mode 100644 > index 0000000000..525dae7bc6 > --- /dev/null > +++ b/testing/9base/APKBUILD > @@ -0,0 +1,50 @@ > +# Contributor: Joshua Haase > +# Maintainer: Joshua Haase > +pkgname="9base" > +pkgver="6" > +pkgrel=0 > +pkgdesc="A port of various Plan 9 tools for Unix." > +url="https://tools.suckless.org/9base/" > +arch="all" > +license="MIT" > +depends="" > +makedepends="libucontext-dev linux-headers" > +install="" > +subpackages="$pkgname-doc $pkgname-troff" > +source="https://dl.suckless.org/tools/$pkgname-$pkgver.tar.gz config.mk.x86_64 config.mk.x86 dirread.patch" > +builddir="$srcdir/$pkgname-$pkgver" > + > +prepare() { > + default_prepare > + cp "$srcdir/config.mk.$(uname -m)" "$builddir/config.mk" > +} > + > +build() { > + cd "$builddir" > + make DESTDIR="$pkgdir" all > +} > + > +package() { > + cd "$builddir" > + install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE > + make DESTDIR="$pkgdir" install > +} > + > +doc() { > + default_doc > + mkdir -p "$subpkgdir/usr/lib/9base/share" > + mv "$pkgdir/usr/lib/9base/share/man" "$subpkgdir/usr/lib/9base/share" > +} > + > +troff() { > + cd "$pkgdir" > + mkdir -p "$subpkgdir/usr/lib/9base/bin" > + mv "$pkgdir/usr/lib/9base/bin/troff" "$subpkgdir/usr/lib/9base/bin/troff" > + mkdir -p "$subpkgdir/usr/lib/9base/lib/troff" > + mv "$pkgdir/usr/lib/9base/lib/troff" "$subpkgdir/usr/lib/9base/lib/troff" > +} > + > +sha512sums="38108a94118b56c6f3982e692beb1068c52f9aecd74447d6b552b77fae5e365eab72b4781bdf07d9696ac89d54371c1cae8cc0363de510b53988302acef50dba 9base-6.tar.gz > +3a30955d59ad78c1bc4e2fbd0f511eb85624ed48b0aeceef436e3456f685690e064eb1f171a2080a34a0fcb40d874277a282864c720c9e612eca3ad848dec35e config.mk.x86_64 > +7a58d4762c5ec9a0191f2cce15b23b2e60ec9445c357dc2e3925a5b4d5dec1c5eed6fb3565be07a25616c0c2b0768c21737b2d35082deb17bfc7a7f5f0c0d2a6 config.mk.x86 > +5b47647245366e786059a28747fe9a36fd87d9df2e1a7f68e9a41f4adb7ec96f230a9abe94acbe5f82d62f4f85b061ff7ab7356d32072dd9ef7f677379f456f5 dirread.patch" > diff --git a/testing/9base/config.mk.x86 b/testing/9base/config.mk.x86 > new file mode 100644 > index 0000000000..9279f21262 > --- /dev/null > +++ b/testing/9base/config.mk.x86 > @@ -0,0 +1,24 @@ > +# Customize to fit your system > + > +# paths > +PREFIX = /usr/lib/9base > +MANPREFIX = ${PREFIX}/share/man > + > +VERSION = 6 > +OBJTYPE = 386 > +#OBJTYPE = arm > +#OBJTYPE = x86_64 > + > +# Linux/BSD > +#CFLAGS += -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -c -I. -DPREFIX="\"${PREFIX}\"" > +CFLAGS += -c -I. -DPREFIX="\"${PREFIX}\"" > +LDFLAGS += -static > + > +# Solaris > +#CFLAGS = -fast -xtarget=ultra -D__sun__ -c -I. -DPREFIX="\"${PREFIX}\"" > +#LDFLAGS = -dn > + > +# compiler > +AR = ar rc > +CC = cc > +YACC = ../yacc/9yacc > diff --git a/testing/9base/config.mk.x86_64 b/testing/9base/config.mk.x86_64 > new file mode 100644 > index 0000000000..51ce200eb0 > --- /dev/null > +++ b/testing/9base/config.mk.x86_64 > @@ -0,0 +1,24 @@ > +# Customize to fit your system > + > +# paths > +PREFIX = /usr/lib/9base > +MANPREFIX = ${PREFIX}/share/man > + > +VERSION = 6 > +#OBJTYPE = 386 > +#OBJTYPE = arm > +OBJTYPE = x86_64 > + > +# Linux/BSD > +#CFLAGS += -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -c -I. -DPREFIX="\"${PREFIX}\"" > +CFLAGS += -c -I. -DPREFIX="\"${PREFIX}\"" > +LDFLAGS += -static > + > +# Solaris > +#CFLAGS = -fast -xtarget=ultra -D__sun__ -c -I. -DPREFIX="\"${PREFIX}\"" > +#LDFLAGS = -dn > + > +# compiler > +AR = ar rc > +CC = cc > +YACC = ../yacc/9yacc > diff --git a/testing/9base/dirread.patch b/testing/9base/dirread.patch > new file mode 100644 > index 0000000000..daf60c6311 > --- /dev/null > +++ b/testing/9base/dirread.patch > @@ -0,0 +1,17 @@ > +--- 9base-6/lib9/dirread.c > ++++ 9base-6/lib9/dirread.c > +@@ -10,13 +10,7 @@ > + static int > + mygetdents(int fd, struct dirent *buf, int n) > + { > +- off_t off; > +- int nn; > +- > +- /* This doesn't match the man page, but it works in Debian with a 2.2 kernel */ > +- off = p9seek(fd, 0, 1); > +- nn = getdirentries(fd, (void*)buf, n, &off); > +- return nn; > ++ return getdents(fd, buf, n); > + } > + #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) > + static int Hello Joshua, Thanks for your contribution. I ran this APKBUILD in our CI pipeline[0] and there are some issues. Firstly, the build fails on everything except x86_64 due to trying to patch an arch related file which does not exist: > patching file lib9/dirread.c > cp: can't stat '/builds/kdaudt/aports/testing/9base/src/config.mk.i686': > No such file or directory Secondly, there are some styling issues, which you can find listed here: https://gitlab.alpinelinux.org/kdaudt/aports/-/jobs/2243 Thanks, Kevin. [0]:https://gitlab.alpinelinux.org/kdaudt/aports/pipelines/579