commit:     6cd7e5165b7750317d42a65b9bc20ce65eec8302
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 31 11:03:45 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sat Aug 31 13:18:30 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6cd7e516

sys-auth/oath-toolkit: fix the build on musl

Add an upstream patch to fix the build on musl, and then fix a new
problem introduced by the patch: the build system is extremely sensitive
to mtime changes in the source tree, in that patching triggers a
rebuild of some Makefile sources, which ultimately tries to invoke
automake. We have to fudge the mtime on the patched file to avoid this.

Bug: https://bugs.gentoo.org/936309
Closes: https://bugs.gentoo.org/933086
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 .../files/oath-toolkit-2.6.11-fix-musl-build.patch | 24 ++++++++++++++++++++++
 sys-auth/oath-toolkit/oath-toolkit-2.6.11.ebuild   | 12 +++++++++++
 2 files changed, 36 insertions(+)

diff --git 
a/sys-auth/oath-toolkit/files/oath-toolkit-2.6.11-fix-musl-build.patch 
b/sys-auth/oath-toolkit/files/oath-toolkit-2.6.11-fix-musl-build.patch
new file mode 100644
index 000000000000..5affd40c3111
--- /dev/null
+++ b/sys-auth/oath-toolkit/files/oath-toolkit-2.6.11-fix-musl-build.patch
@@ -0,0 +1,24 @@
+From 65f37d4deb6ac87dd64df1bb281588d300a1bf3e Mon Sep 17 00:00:00 2001
+From: orbea <[email protected]>
+Date: Mon, 12 Feb 2024 18:18:31 -0800
+Subject: [PATCH] libpskc: fix implicit declaration with musl
+
+---
+ libpskc/global.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libpskc/global.c b/libpskc/global.c
+index 1a514506..6082e11a 100644
+--- a/libpskc/global.c
++++ b/libpskc/global.c
+@@ -24,6 +24,7 @@
+ #include <pskc/pskc.h>
+ 
+ #include "internal.h"
++#include <stdlib.h>           /* free */
+ #include <string.h>           /* strverscmp */
+ #include <libxml/parser.h>    /* xmlInitParser */
+ #include <libxml/catalog.h>   /* xmlLoadCatalog */
+-- 
+GitLab
+

diff --git a/sys-auth/oath-toolkit/oath-toolkit-2.6.11.ebuild 
b/sys-auth/oath-toolkit/oath-toolkit-2.6.11.ebuild
index 03d2801fa64c..80f393cfd4d0 100644
--- a/sys-auth/oath-toolkit/oath-toolkit-2.6.11.ebuild
+++ b/sys-auth/oath-toolkit/oath-toolkit-2.6.11.ebuild
@@ -27,6 +27,8 @@ BDEPEND="
        test? ( dev-libs/libxml2 )
 "
 
+PATCHES=( "${FILESDIR}/${P}-fix-musl-build.patch" )
+
 QA_CONFIG_IMPL_DECL_SKIP=(
        MIN # glibc fp
        unreachable
@@ -34,6 +36,16 @@ QA_CONFIG_IMPL_DECL_SKIP=(
        static_assert
 )
 
+src_prepare() {
+       default
+
+       # After patching, we have to fix the mtime on libpskc/global.c so
+       # that it doesn't cause Makefile.gdoc to be rebuilt so that it
+       # doesn't cause Makefile.in to be rebuilt so that it doesn't try to
+       # run automake-1.16.5 for no reason. Bug 936309.
+       touch --reference=libpskc/errors.c libpskc/global.c || die
+}
+
 src_configure() {
        local myeconfargs=(
                --cache-file="${S}"/config.cache

Reply via email to