sys-apps/heirloom-tools: fix building with glibc 2.30
authorStephan Hartmann <stha09@googlemail.com>
Tue, 18 Feb 2020 15:31:45 +0000 (16:31 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Tue, 10 Mar 2020 19:35:44 +0000 (19:35 +0000)
While at it, fix patching with fuzz.

Closes: https://bugs.gentoo.org/692770
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Stephan Hartmann <stha09@googlemail.com>
Closes: https://github.com/gentoo/gentoo/pull/14693
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
sys-apps/heirloom-tools/files/heirloom-tools-070715-glibc-2.30.patch [new file with mode: 0644]
sys-apps/heirloom-tools/files/heirloom-tools-070715-major.patch
sys-apps/heirloom-tools/heirloom-tools-070715-r1.ebuild

diff --git a/sys-apps/heirloom-tools/files/heirloom-tools-070715-glibc-2.30.patch b/sys-apps/heirloom-tools/files/heirloom-tools-070715-glibc-2.30.patch
new file mode 100644 (file)
index 0000000..19b90ce
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/shl/shl.c b/shl/shl.c
+index 6f5c2df..30d296c 100644
+--- a/shl/shl.c
++++ b/shl/shl.c
+@@ -86,7 +86,7 @@ extern int   sysv3;
+ #include      <libgen.h>
+ #include      <limits.h>
+ #include      <stdarg.h>
+-#if !defined (__dietlibc__) && !defined (__UCLIBC__)
++#if !defined (__dietlibc__) && !defined (__UCLIBC__) && !defined(__linux__)
+ #include      <stropts.h>
+ #endif
+ #include      <poll.h>
index 82d32315d819578f3e5d0aaf06565d41449ed374..81e6755e7e323c6b2c00d34333ab47c73a954191 100644 (file)
@@ -1,6 +1,8 @@
+diff --git a/cpio/cpio.c b/cpio/cpio.c
+index 89c5cbc..210287b 100644
 --- a/cpio/cpio.c
 +++ b/cpio/cpio.c
-@@ -91,9 +91,9 @@
+@@ -91,11 +91,12 @@
  #include <sfile.h>
  #include <atoll.h>
  
 -#endif        /* _AIX */
 +#endif        /* _AIX || __GLIBC__ */
  
- #ifndef       major
+-#ifndef       major
++#include <sys/sysmacros.h>
++#if 0
  #include <sys/mkdev.h>
+ #endif        /* !major */
+diff --git a/file/file.c b/file/file.c
+index 6609734..d90af86 100644
+--- a/file/file.c
++++ b/file/file.c
+@@ -66,7 +66,8 @@ static const char sccsid[] USED = "@(#)file.sl       1.33 (gritter) 4/14/06";
+ #include <fcntl.h>
+ #include <libgen.h>
+ #include <inttypes.h>
+-#ifndef       major
++#include <sys/sysmacros.h>
++#if 0
+ #include <sys/mkdev.h>
+ #endif
+ #include "iblok.h"
+diff --git a/find/find.c b/find/find.c
+index fac70f0..28e1b7f 100644
+--- a/find/find.c
++++ b/find/find.c
+@@ -83,7 +83,8 @@ static const char sccsid[] USED = "@(#)find.sl       1.45 (gritter) 5/8/06";
+ #ifdef        _AIX
+ #include <sys/sysmacros.h>
+ #endif
+-#ifndef       major
++#include <sys/sysmacros.h>
++#if 0
+ #include <sys/mkdev.h>
+ #endif
+ #if __NetBSD_Version__>= 300000000
+diff --git a/ls/ls.c b/ls/ls.c
+index e4480d0..17186ba 100644
 --- a/ls/ls.c
 +++ b/ls/ls.c
-@@ -119,7 +119,7 @@
+@@ -119,7 +119,7 @@ static char ifmt_c[] = "-pc-d-b--nl-SD--";
  #include <termcap.h>
  #endif        /* USE_TERMCAP */
  
  #include <sys/sysmacros.h>
  #endif
  
+diff --git a/mknod/mknod.c b/mknod/mknod.c
+index b772b88..f465883 100644
+--- a/mknod/mknod.c
++++ b/mknod/mknod.c
+@@ -45,7 +45,8 @@ static const char sccsid[] USED = "@(#)mknod.sl      1.8 (gritter) 5/29/05";
+ #include      <string.h>
+ #include      <limits.h>
+ #include      <unistd.h>
+-#ifndef       major
++#include <sys/sysmacros.h>
++#if 0
+ #include      <sys/mkdev.h>
+ #endif        /* !major */
+diff --git a/tar/tar.c b/tar/tar.c
+index 2d3dada..a8f1ccb 100644
+--- a/tar/tar.c
++++ b/tar/tar.c
+@@ -98,7 +98,8 @@ static const char sccsid[] USED = "@(#)tar.sl        1.177 (gritter) 4/14/07";
+ #include <sys/sysmacros.h>
+ #endif
+-#ifndef       major
++#include <sys/sysmacros.h>
++#if 0
+ #include <sys/mkdev.h>
+ #endif        /* !major */
index 9d55edab0b497f228d35a07223b0d08d7ac95b29..80d2232221aafeeb48545c6f1d901182eb7f43be 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -23,16 +23,12 @@ DEPEND="
 S="${WORKDIR}/heirloom-${PV}"
 PATCHES=(
        "${FILESDIR}"/${P}-major.patch
+       "${FILESDIR}"/${P}-glibc-2.30.patch
 )
 
 # slightly broken
 RESTRICT="test"
 
-src_prepare() {
-       find . -name '*.c' -exec sed -i -e 's|#ifndef[[:space:]]*major|#include <sys/sysmacros.h>\n#if 0|g' {} + || die
-
-       default
-}
 src_compile() {
        append-cppflags -D_GNU_SOURCE
        emake -j1 \