commit:     db59f2bc06cf445ea11088c033a179ab246ce726
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 16 13:58:34 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Oct 16 13:58:34 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db59f2bc

app-misc/srm: port to EAPI 8

Closes: https://bugs.gentoo.org/714026
Closes: https://bugs.gentoo.org/722320
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 app-misc/srm/files/srm-1.2.15-cflags.patch | 14 +++++++++++---
 app-misc/srm/files/srm-1.2.15-musl.patch   | 17 +++++++++++++++++
 app-misc/srm/srm-1.2.15.ebuild             | 19 +++++++++++--------
 3 files changed, 39 insertions(+), 11 deletions(-)

diff --git a/app-misc/srm/files/srm-1.2.15-cflags.patch 
b/app-misc/srm/files/srm-1.2.15-cflags.patch
index 0a45bdc1252..22710b8af38 100644
--- a/app-misc/srm/files/srm-1.2.15-cflags.patch
+++ b/app-misc/srm/files/srm-1.2.15-cflags.patch
@@ -1,6 +1,14 @@
---- srm-1.2.15/configure.ac
-+++ srm-1.2.15/configure.ac
-@@ -42,7 +42,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -9,6 +9,7 @@
+ 
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
++AM_PROG_AR
+ 
+ dnl enable 64bit file ops
+ AC_SYS_LARGEFILE
+@@ -42,7 +43,6 @@
  AC_ARG_ENABLE(debug, [  --enable-debug=[no/yes] turn on debugging
                         [default=$debug_default]],, 
enable_debug=$debug_default)
  if test "x$enable_debug" = "xyes"; then

diff --git a/app-misc/srm/files/srm-1.2.15-musl.patch 
b/app-misc/srm/files/srm-1.2.15-musl.patch
new file mode 100644
index 00000000000..e22c5efcc8b
--- /dev/null
+++ b/app-misc/srm/files/srm-1.2.15-musl.patch
@@ -0,0 +1,17 @@
+musl doesn't have an internal __sighandler_t type,
+and only makes sighandler_t visible if _GNU_SOURCE
+is defined.
+https://bugs.gentoo.org/714026
+
+--- a/src/sunlink.c
++++ b/src/sunlink.c
+@@ -102,9 +102,6 @@
+ static volatile int SIGINT_received = 0;
+ #if defined(__unix__)
+ #include <signal.h>
+-#if defined(__linux__) && !defined(__USE_GNU)
+-typedef __sighandler_t sighandler_t;
+-#endif
+ #if defined(__FreeBSD__) || defined(__OpenBSD__)
+ typedef sig_t sighandler_t;
+ #endif

diff --git a/app-misc/srm/srm-1.2.15.ebuild b/app-misc/srm/srm-1.2.15.ebuild
index a086636c204..cedaa944e3f 100644
--- a/app-misc/srm/srm-1.2.15.ebuild
+++ b/app-misc/srm/srm-1.2.15.ebuild
@@ -1,9 +1,9 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=8
 
-inherit autotools epatch
+inherit autotools flag-o-matic
 
 DESCRIPTION="A command-line compatible rm which destroys file contents before 
unlinking"
 HOMEPAGE="https://sourceforge.net/projects/srm/";
@@ -14,23 +14,26 @@ SLOT="0"
 KEYWORDS="amd64 ppc ~ppc64 x86"
 IUSE="debug"
 
-DEPEND="!app-misc/secure-delete
-               sys-kernel/linux-headers
-"
+DEPEND="sys-kernel/linux-headers"
 
-DOCS=( AUTHORS ChangeLog NEWS README TODO )
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.2.15-cflags.patch
+       "${FILESDIR}"/${PN}-1.2.15-musl.patch
+)
 
 src_prepare() {
-       epatch "${FILESDIR}/${PN}-1.2.15-cflags.patch"
+       default
        eautoreconf
 }
 
 src_configure() {
+       # enable the sighandler_t decl on glibc and musl
+       append-cppflags -D_GNU_SOURCE
        econf $(use_enable debug)
 }
 
 pkg_postinst() {
        ewarn "Please note that srm will not work as expected with any 
journaled file"
        ewarn "system (e.g., reiserfs, ext3)."
-       ewarn "See: ${EROOT%/}/usr/share/doc/${PF}/README"
+       ewarn "See: ${EROOT}/usr/share/doc/${PF}/README"
 }

Reply via email to