X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mail-io0-f195.google.com (mail-io0-f195.google.com [209.85.223.195]) by lists.alpinelinux.org (Postfix) with ESMTP id E4F1A5C4C41 for ; Wed, 2 Aug 2017 03:53:39 +0000 (GMT) Received: by mail-io0-f195.google.com with SMTP id c74so2882900iod.4 for ; Tue, 01 Aug 2017 20:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=u8zHSBWTg+ZO/5veZeG9NODrtCuhp8/cfuKepaJt4Xc=; b=Yhle6Tmr6K5TvcsT+y1g4EgZ7FmNQ5O2gXBg0o97JlbwzUMvq9E9zGaozSTpH87z6K ldH9lF9sTs0rRkQ9to5fUCGaGW4Fvu9wnlyZgXdPb0M0t1UH0Q2C98T/rnd4FR1MZ6V2 /89qwSKfTiEJlkzJVVzXQk+1c5EnhN+WrkxWgy8faxMjyycw3Qum2j6z1yyFMLvSGg75 kSnEN//7LxUpUMHbB7XLy2hO+JbKpvpZSfuqfyyLc3oOhIGsTh7FeogDoLlTd5y27WIL QCXnzTH3yiIwyI4wIww/ReZRN5VoLbq17EegXyaW+q1CVMiVeFahwmor0tGnQxHgu3TV 2qGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=u8zHSBWTg+ZO/5veZeG9NODrtCuhp8/cfuKepaJt4Xc=; b=CND7/MH77BEg4D/PSUC2K7kyBTQDStNAz9JRGMnhGupNVHsKemcJKvWjBgeQ1z3jiC k5uYcsgfuVPguoScvEUKQEuiAg+933XfO2Ev0joOSg0guwAmJjlX63vuHz1DyjSKfe9g 6sR9PPoFJA2SZ8uaLNPwBz5kX+ZhK2Ulu93AUIDZG1Uh54b04tkv2AZ2j0c4qDf8euSQ kXe3l4BDInTPQsWt/2nDUeciG+ixluaXgLuqh+ULQlBQyhSAHoCZfLHvD1XnJICXVEVc 4cB9whaakswLtTh86vLpMoajlSaGcf319+HmnqAc05b5aSa56uXrdU96f44bdKPwh7J4 F5aw== X-Gm-Message-State: AHYfb5hRf7eg4F3PXsDdL/AN+ixD9xEJQfakaO/LsFYTeENVgtTmRzB3 9v0LZP7SupQwKIxUisQKww== X-Received: by 10.107.58.195 with SMTP id h186mr408592ioa.203.1501646019201; Tue, 01 Aug 2017 20:53:39 -0700 (PDT) Received: from alpine-dev.hrtc.net ([204.8.12.241]) by smtp.gmail.com with ESMTPSA id c11sm6644283iof.74.2017.08.01.20.53.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Aug 2017 20:53:38 -0700 (PDT) From: Aaron Vodney To: alpine-aports@lists.alpinelinux.org Cc: Aaron Vodney Subject: [alpine-aports] [PATCH] new aport Date: Wed, 2 Aug 2017 03:53:35 +0000 Message-Id: <20170802035335.21259-1-aavoddev@gmail.com> X-Mailer: git-send-email 2.13.3 X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: I had to duplicate and modify the default_doc function due to where 9base stores its manpages. I also moved it from /usr/local/plan9 to /usr/lib/plan9 to comply with fhs. --- testing/9base/APKBUILD | 119 +++++++++++++++++++++++++++++++++++++++++++++ testing/9base/config.patch | 11 +++++ testing/9base/musl.patch | 17 +++++++ 3 files changed, 147 insertions(+) create mode 100644 testing/9base/APKBUILD create mode 100644 testing/9base/config.patch create mode 100644 testing/9base/musl.patch diff --git a/testing/9base/APKBUILD b/testing/9base/APKBUILD new file mode 100644 index 0000000000..1221240331 --- /dev/null +++ b/testing/9base/APKBUILD @@ -0,0 +1,119 @@ +# Contributor: Aaron Vodney +# Maintainer: Aaron Vodney +pkgname=9base +pkgver=6 +pkgrel=0 +pkgdesc="Suckless' Plan9 utilities" +url="tools.suckless.org/9base" +arch="all" +license="custom:LPL MIT" +depends="musl" +makedepends="musl-dev linux-headers" +install="" +subpackages="$pkgname-doc" +options="" +source="http://dl.suckless.org/tools/${pkgname}-${pkgver}.tar.gz + musl.patch + config.patch" +builddir="$srcdir/${pkgname}-${pkgver}" + +doc() { + depends="$depends_doc" + pkgdesc="$pkgdesc (documentation)" + install_if="docs $pkgname=$pkgver-r$pkgrel" + docroot=/usr/lib/plan9 + + local i + for i in doc man info html sgml licenses gtk-doc ri help; do + if [ -d "${pkgdir}${docroot}/share/$i" ]; then + mkdir -p "${subpkgdir}${docroot}/share" + mv "${pkgdir}${docroot}/share/$i" "${subpkgdir}${docroot}/share/" + fi + done + + # compress man pages + local mandir="${subpkgdir}${docroot}"/share/man + [ -d "$mandir" ] && find "$mandir" -type l \ + -a \( -name \*.[0-8n] -o -name \*.[0-8][a-z]* \) \ + -a \! \( -name '*.gz' -o -name '*.bz2' -o -name '*.xz' \) \ + | while read symlink; do + + ln -s $(readlink $symlink).gz "$symlink".gz + rm -f "$symlink" + done + [ -d "$mandir" ] && find "$mandir" -type f \ + -a \( -name \*.[0-8n] -o -name \*.[0-8][a-z]* \) \ + -a \! \( -name '*.gz' -o -name '*.bz2' -o -name '*.xz' \) \ + -exec stat -c "%i %n" \{\} \+ | while read inode name; do + + # Skip hardlinks removed in last iteration. + [ -f "$name" ] || continue + + local islink=0 + find "$mandir" -type f -links +1 \ + -a \( -name \*.[0-8n] -o -name \*.[0-8][a-z]* \) \ + -a \! \( -name '*.gz' -o -name '*.bz2' -o -name '*.xz' \) \ + -exec stat -c "%i %n" \{\} \+ | while read linode lname; do + if [ "$linode" = "$inode" -a "$lname" != "$name" ]; then + islink=1 + rm -f "$lname" + ln -s "${name##*/}".gz "$lname".gz + fi + done + + [ $islink -eq 0 ] && gzip -9 "$name" + done + + rm -f "$subpkgdir/usr/share/info/dir" + + # remove if empty, ignore error (not empty) + rmdir "$pkgdir/usr/share" "$pkgdir/usr" 2>/dev/null || : +} + +dev(){ + local i= j= + depends="$depends_dev" + pkgdesc="$pkgdesc (development files)" + + cd "$pkgdir" || return 0 + local libdirs=usr/ + [ -d lib/ ] && libdirs="lib/ $libdirs" + for i in usr/include usr/lib/pkgconfig usr/share/aclocal\ + usr/share/gettext usr/bin/*-config \ + usr/share/vala/vapi usr/share/gir-[0-9]*\ + usr/share/qt*/mkspecs \ + usr/lib/qt*/mkspecs \ + usr/lib/cmake \ + $(find . -name include -type d) \ + $(find $libdirs -name '*.[acho]' \ + -o -name '*.prl' 2>/dev/null); do + if [ -e "$pkgdir/$i" ] || [ -L "$pkgdir/$i" ]; then + d="$subpkgdir/${i%/*}" # dirname $i + mkdir -p "$d" + mv "$pkgdir/$i" "$d" + rmdir "$pkgdir/${i%/*}" 2>/dev/null || : + fi + done + # move *.so links needed when linking the apps to -dev packages + for i in lib/*.so usr/lib/*.so; do + if [ -L "$i" ]; then + mkdir -p "$subpkgdir"/"${i%/*}" + mv "$i" "$subpkgdir/$i" || return 1 + fi + done + return 0 +} + +build() { + cd "$builddir" + make || return 1 +} + +package() { + cd "$builddir" + make DESTDIR="$pkgdir" install || return 1 +} + +sha512sums="38108a94118b56c6f3982e692beb1068c52f9aecd74447d6b552b77fae5e365eab72b4781bdf07d9696ac89d54371c1cae8cc0363de510b53988302acef50dba 9base-6.tar.gz +7365533289e4e64b0379099d2cea38926739afe7ad958b217d1130ddee367d086c9f3503d12018fff75e05bdafe62ab9e2117d6449cb1718bffac801993ca4e4 musl.patch +f888dc5d4dc5af6e953d9ca77310350389692fb1d6d50db09cdca1969583b80ac933ca7852f9c3e97bbc87eeb72c46004b95c4205bc5108915d337569e7adad4 config.patch" diff --git a/testing/9base/config.patch b/testing/9base/config.patch new file mode 100644 index 0000000000..30abcc1e4c --- /dev/null +++ b/testing/9base/config.patch @@ -0,0 +1,11 @@ +--- a/config.mk ++++ b/config.mk +@@ -1,7 +1,7 @@ + # Customize to fit your system + + # paths +-PREFIX = /usr/local/plan9 ++PREFIX = /usr/lib/plan9 + MANPREFIX = ${PREFIX}/share/man + + VERSION = 6 diff --git a/testing/9base/musl.patch b/testing/9base/musl.patch new file mode 100644 index 0000000000..9c2f24d740 --- /dev/null +++ b/testing/9base/musl.patch @@ -0,0 +1,17 @@ +--- a/lib9/dirread.c ++++ b/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, (void*)buf, n); + } + #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) + static int -- 2.13.3 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---