commit:     578bd618a703044adb1cfc4f8bd1d114572848c6
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 17 23:27:28 2016 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun Apr 17 23:28:32 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=578bd618

app-arch/pax: add musl support, bug #580362

Package-Manager: portage-2.2.26

 .../pax/files/pax-20160306-glibc-to-linux.patch    | 38 ++++++++++++++++++++++
 app-arch/pax/pax-20160306.ebuild                   | 10 ++++--
 2 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/app-arch/pax/files/pax-20160306-glibc-to-linux.patch 
b/app-arch/pax/files/pax-20160306-glibc-to-linux.patch
new file mode 100644
index 0000000..f864729
--- /dev/null
+++ b/app-arch/pax/files/pax-20160306-glibc-to-linux.patch
@@ -0,0 +1,38 @@
+--- pax/cache.c.old    2016-03-06 08:12:52.000000000 -0600
++++ pax/cache.c        2016-04-17 13:01:26.461307830 -0500
+@@ -195,7 +195,7 @@
+        * No entry for this uid, we will add it
+        */
+       if (!pwopn) {
+-#if defined(__GLIBC__)
++#if defined(__GLIBC__) || defined(__linux__)
+               setpwent();
+ #elif !defined(__INTERIX)
+               setpassent(1);
+@@ -265,7 +265,7 @@
+        * No entry for this gid, we will add it
+        */
+       if (!gropn) {
+-#if defined(__GLIBC__)
++#if defined(__GLIBC__) || defined(__linux__)
+               setgrent();
+ #elif !defined(__INTERIX) && !defined(__CYGWIN__)
+               setgroupent(1);
+@@ -336,7 +336,7 @@
+       }
+ 
+       if (!pwopn) {
+-#if defined(__GLIBC__)
++#if defined(__GLIBC__) || defined(__linux__)
+               setpwent();
+ #elif !defined(__INTERIX)
+               setpassent(1);
+@@ -403,7 +403,7 @@
+       }
+ 
+       if (!gropn) {
+-#if defined(__GLIBC__)
++#if defined(__GLIBC__) || defined(__linux__)
+               setgrent();
+ #elif !defined(__INTERIX) && !defined(__CYGWIN__)
+               setgroupent(1);

diff --git a/app-arch/pax/pax-20160306.ebuild b/app-arch/pax/pax-20160306.ebuild
index 1cfdaa4..86a44b8 100644
--- a/app-arch/pax/pax-20160306.ebuild
+++ b/app-arch/pax/pax-20160306.ebuild
@@ -4,7 +4,7 @@
 
 EAPI="5"
 
-inherit unpacker toolchain-funcs
+inherit unpacker toolchain-funcs flag-o-matic
 
 DESCRIPTION="pax (Portable Archive eXchange) is the POSIX standard archive 
tool"
 HOMEPAGE="https://www.mirbsd.org/pax.htm";
@@ -15,15 +15,19 @@ SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc 
~x86"
 IUSE=""
 
-RDEPEND="dev-libs/libbsd"
+RDEPEND="dev-libs/libbsd
+       elibc_musl? ( sys-libs/fts-standalone )"
 DEPEND="${RDEPEND}
        $(unpacker_src_uri_depends)"
 
 S=${WORKDIR}/${PN}
 
+PATCHES=( "${FILESDIR}/${P}-glibc-to-linux.patch" )
+
 src_prepare() {
        # Newer C libraries omit this include from sys/types.h.
        sed -i '1i#include <sys/sysmacros.h>' extern.h || die
+       default
 }
 
 src_configure() {
@@ -31,6 +35,8 @@ src_configure() {
 }
 
 src_compile() {
+       use elibc_musl && append-ldflags "-lfts"
+
        # We can't rely on LFS flags as it uses the fts.h interface which lacks 
64-bit support.
        set -- \
                ${CC} ${CPPFLAGS} ${CFLAGS} \

Reply via email to