* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libdex/files/, dev-libs/libdex/
@ 2025-02-20 23:21 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2025-02-20 23:21 UTC (permalink / raw
  To: gentoo-commits
commit:     1f277d7199e615b2da44c12355734e40a685fc8c
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Wed Jan 29 05:29:40 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Feb 20 23:21:20 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f277d71
dev-libs/libdex: use libucontext on musl
No revbump because musl could never be built
Bug: https://bugs.gentoo.org/928892
Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/40357
Signed-off-by: Sam James <sam <AT> gentoo.org>
 .../files/libdex-0.8.1-libucontext-musl.patch      | 61 ++++++++++++++++++++++
 dev-libs/libdex/libdex-0.8.1.ebuild                |  5 ++
 2 files changed, 66 insertions(+)
diff --git a/dev-libs/libdex/files/libdex-0.8.1-libucontext-musl.patch b/dev-libs/libdex/files/libdex-0.8.1-libucontext-musl.patch
new file mode 100644
index 000000000000..38eb2be9a828
--- /dev/null
+++ b/dev-libs/libdex/files/libdex-0.8.1-libucontext-musl.patch
@@ -0,0 +1,61 @@
+https://bugs.gentoo.org/928892
+https://gitlab.gnome.org/GNOME/libdex/-/commit/fc0ef0544dd61ff6d825c53323d4b4cba4481a03
+https://gitlab.gnome.org/GNOME/libdex/-/merge_requests/17
+
+From fc0ef0544dd61ff6d825c53323d4b4cba4481a03 Mon Sep 17 00:00:00 2001
+From: Alfred Wingate <parona@protonmail.com>
+Date: Wed, 29 Jan 2025 07:16:41 +0200
+Subject: [PATCH] build: try libucontext if symbols are not present
+
+Musl includes uncontext.h but doesn't implement the symbols. This means
+that HAVE_CONTEXT_H will be set and linking will fail due to missing
+symbols.
+
+https://wiki.musl-libc.org/open-issues.html#ucontext.h
+
+If the symbols are missing depend on libucontext which is an implementation
+of these functions for musl.
+
+https://github.com/kaniini/libucontext
+
+Bug: https://bugs.gentoo.org/928892
+Signed-off-by: Alfred Wingate <parona@protonmail.com>
+--- a/meson.build
++++ b/meson.build
+@@ -44,14 +44,14 @@ if get_option('sysprof')
+   config_h.set10('HAVE_SYSPROF', true)
+ endif
+ 
+-check_headers = [
+-  'ucontext.h',
+-]
+-foreach h : check_headers
+-  if cc.has_header(h)
+-    config_h.set('HAVE_' + h.underscorify().to_upper(), 1)
++if cc.has_header('ucontext.h')
++  if not cc.has_function('makecontext', prefix : '#include <ucontext.h>')
++    libucontext_dep = dependency('libucontext', required: false)
++  else
++    libucontext_dep = disabler()
+   endif
+-endforeach
++  config_h.set('HAVE_UCONTEXT_H', 1)
++endif
+ 
+ if host_machine.system() == 'darwin'
+   # known alignment for darwin where we're using helpers
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -95,6 +95,9 @@ if host_machine.system() != 'windows'
+     'dex-unix-signal.c',
+     'dex-ucontext.c',
+   ]
++  if libucontext_dep.found()
++    libdex_deps += [libucontext_dep]
++  endif
+ 
+   # If we're on Linux and mips we might still need asm.S.
+   # But otherwise linux can do it all without any custom
+-- 
+GitLab
+
diff --git a/dev-libs/libdex/libdex-0.8.1.ebuild b/dev-libs/libdex/libdex-0.8.1.ebuild
index 9d73c00378b0..3133919102f6 100644
--- a/dev-libs/libdex/libdex-0.8.1.ebuild
+++ b/dev-libs/libdex/libdex-0.8.1.ebuild
@@ -24,6 +24,7 @@ RDEPEND="
 	liburing? ( >=sys-libs/liburing-0.7:= )
 	introspection? ( dev-libs/gobject-introspection:= )
 	sysprof? ( dev-util/sysprof-capture:4 )
+	elibc_musl? ( sys-libs/libucontext )
 "
 DEPEND="${RDEPEND}"
 BDEPEND="
@@ -33,6 +34,10 @@ BDEPEND="
 	gtk-doc? ( dev-util/gi-docgen )
 "
 
+PATCHES=(
+	"${FILESDIR}"/libdex-0.8.1-libucontext-musl.patch
+)
+
 pkg_setup() {
 	if use eventfd && linux_config_exists; then
 		if ! linux_chkconfig_present EVENTFD ; then
^ permalink raw reply related	[flat|nested] only message in thread
only message in thread, other threads:[~2025-02-20 23:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20 23:21 [gentoo-commits] repo/gentoo:master commit in: dev-libs/libdex/files/, dev-libs/libdex/ Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox