From 3ec790f045ef0297403d66c7acfdfb6d351cbd10 Mon Sep 17 00:00:00 2001 From: "Andreas K. Hüttel" Date: Wed, 1 May 2024 03:02:20 +1100 Subject: sys-auth/elogind: Backport musl-1.2.5 (basename) build fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://bugs.gentoo.org/926339 Signed-off-by: Andreas K. Hüttel --- sys-auth/elogind/elogind-252.9.ebuild | 1 + .../elogind/files/elogind-252.9-musl-1.2.5.patch | 34 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 sys-auth/elogind/files/elogind-252.9-musl-1.2.5.patch (limited to 'sys-auth') diff --git a/sys-auth/elogind/elogind-252.9.ebuild b/sys-auth/elogind/elogind-252.9.ebuild index 8ca3fd96ae06..1da0c8672fff 100644 --- a/sys-auth/elogind/elogind-252.9.ebuild +++ b/sys-auth/elogind/elogind-252.9.ebuild @@ -55,6 +55,7 @@ DOCS=( README.md) PATCHES=( "${FILESDIR}/${P}-nodocs.patch" "${FILESDIR}/${PN}-252.9-musl-lfs.patch" + "${FILESDIR}/${PN}-252.9-musl-1.2.5.patch" ) python_check_deps() { diff --git a/sys-auth/elogind/files/elogind-252.9-musl-1.2.5.patch b/sys-auth/elogind/files/elogind-252.9-musl-1.2.5.patch new file mode 100644 index 000000000000..cfd979170795 --- /dev/null +++ b/sys-auth/elogind/files/elogind-252.9-musl-1.2.5.patch @@ -0,0 +1,34 @@ + +This is a backport from +https://github.com/elogind/elogind/commit/d8dc8f66d6e64dfb45fc55c430a31b08b27c5165?diff=split&w=0 +effectively squashing several commits. + +diff -ruN elogind-252.9.orig/meson.build elogind-252.9/meson.build +--- elogind-252.9.orig/meson.build 2024-05-01 02:51:35.602756227 +1100 ++++ elogind-252.9/meson.build 2024-05-01 02:53:31.763434742 +1100 +@@ -655,7 +655,8 @@ + # ['pivot_root', '''#include + # #include '''], # no known header declares pivot_root + #endif // 0 +-#if 1 /// elogind supports musl, but upstream refuses to add qsort_r ++#if 1 /// elogind supports musl, but upstream refuses to add qsort_r and has removed basename ++ ['basename', '''#include '''], # _GNU_SOURCE is defined, so test for GNU basename() + ['qsort_r', '''#include '''], + #endif // 1 + ['ioprio_get', '''#include '''], # no known header declares ioprio_get +diff -ruN elogind-252.9.orig/src/basic/musl_missing.h elogind-252.9/src/basic/musl_missing.h +--- elogind-252.9.orig/src/basic/musl_missing.h 2023-05-15 22:35:29.000000000 +1100 ++++ elogind-252.9/src/basic/musl_missing.h 2024-05-01 02:54:48.293885181 +1100 +@@ -44,6 +44,12 @@ + # define HAVE_SECURE_GETENV 1 + #endif // HAVE_[__]SECURE_GETENV + ++#if ! HAVE_BASENAME ++/* Poor man's basename */ ++# define basename(path) \ ++ (strrchr(path, '/') ? strrchr(path, '/')+1 : path) ++#endif // HAVE_BASENAME ++ + /* strndupa may already be defined in another compatibility header */ + #if !defined(strndupa) + #define strndupa(x_src, x_n) \ -- cgit v1.2.3-65-gdbad