commit:     1205600d6d0ee0d83a00c6068c93a38e7f05d07c
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 29 14:06:37 2021 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Mon Nov 29 14:55:51 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1205600d

app-forensics/zzuf: support musl in configure.ac

One, call AC_USE_SYSTEM_EXTENSIONS so that all compiler invocations have
the correct feature-set macros set. This is required so that configure
can include the musl version of aio.h without

error: field 'aio_sigevent' has incomplete type

Not quite sure WHY this is necessary given that according to musl
documentation, if no feature test macros are defined musl exposes the
equivalent of _BSD_SOURCE - but there you go.

Two, extend the test identifying the way of extracting raw position
index from the structure fpos64_t, so that it supports the musl layout
of this structure as well.

With these two fixes in place zzuf builds successfully against musl.
Tests (which currently have to be run manually because they like neither
the sandbox nor out-of-tree builds) fail but in the same way as against
glibc.

Closes: https://bugs.gentoo.org/714030
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../zzuf/files/zzuf-0.15_autoconf-musl.patch       | 24 ++++++++++++++++++++++
 app-forensics/zzuf/zzuf-0.15_p20190208.ebuild      |  4 ++++
 2 files changed, 28 insertions(+)

diff --git a/app-forensics/zzuf/files/zzuf-0.15_autoconf-musl.patch 
b/app-forensics/zzuf/files/zzuf-0.15_autoconf-musl.patch
new file mode 100644
index 000000000000..0a56a968e84d
--- /dev/null
+++ b/app-forensics/zzuf/files/zzuf-0.15_autoconf-musl.patch
@@ -0,0 +1,24 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -6,6 +6,8 @@
+ 
+ AC_PREREQ(2.50)
+ 
++AC_USE_SYSTEM_EXTENSIONS
++
+ AM_PROG_CC_C_O
+ AC_PROG_CPP
+ AC_PROG_LIBTOOL
+@@ -172,6 +174,12 @@
+ AC_TRY_COMPILE(
+  [#define _LARGEFILE64_SOURCE
+   #define _LARGEFILE_SOURCE
++  #include <stdio.h>],
++ [fpos64_t x; long long int y = x.__lldata;],
++ [ac_v_fpos64_t="(x).__lldata"])
++AC_TRY_COMPILE(
++ [#define _LARGEFILE64_SOURCE
++  #define _LARGEFILE_SOURCE
+   #include <stdio.h>],
+  [fpos64_t x; long long int y = (long long int)x;],
+  [ac_v_fpos64_t="(x)"])

diff --git a/app-forensics/zzuf/zzuf-0.15_p20190208.ebuild 
b/app-forensics/zzuf/zzuf-0.15_p20190208.ebuild
index 6b18d9b65c4d..e20563debda6 100644
--- a/app-forensics/zzuf/zzuf-0.15_p20190208.ebuild
+++ b/app-forensics/zzuf/zzuf-0.15_p20190208.ebuild
@@ -20,6 +20,10 @@ RESTRICT="test"
 
 DOCS=( AUTHORS COPYING TODO )
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.15_autoconf-musl.patch
+)
+
 S="${WORKDIR}"/${PN}-${EGIT_COMMIT}
 
 src_prepare() {

Reply via email to