commit:     c883b953f67f7bb8f6eba3ba11e061f723d746d7
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 10 04:14:51 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jul 10 04:22:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c883b953

media-libs/libbluray: fix musl build by fixing configure checks

Closes: https://bugs.gentoo.org/958375
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/libbluray-1.3.4-musl-dlopen.patch        | 37 ++++++++++++++++++++++
 media-libs/libbluray/libbluray-1.3.4-r2.ebuild     |  3 +-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/media-libs/libbluray/files/libbluray-1.3.4-musl-dlopen.patch 
b/media-libs/libbluray/files/libbluray-1.3.4-musl-dlopen.patch
new file mode 100644
index 000000000000..01f1655d7a47
--- /dev/null
+++ b/media-libs/libbluray/files/libbluray-1.3.4-musl-dlopen.patch
@@ -0,0 +1,37 @@
+https://code.videolan.org/videolan/libbluray/-/merge_requests/52
+
+(Dropped the Meson parts as it's not in the last release.)
+
+From 4cc7e7ec4730f56e76902a7abe5b3d7f19a1109d Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Thu, 10 Jul 2025 05:08:11 +0100
+Subject: [PATCH] build: fix dlfcn, sys/dl.h checks
+
+We had a bug report downstream in Gentoo of a build failure on musl
+systems (https://bugs.gentoo.org/958375). It turns out that nothing
+defines HAVE_DLFCN_H or HAVE_DLFCN_H in configure.ac, and the logic
+in meson.build isn't ideal either.
+
+Fix that by:
+* Looking for dlfcn.h, sys/dl.h in the autotools build
+* Check for dlfcn.h rather than assuming in the Meson build
+* Look for sys/dl.h in the Meson build as well
+---
+ configure.ac | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index bbb08bb0..fb54f0ef 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -147,7 +147,7 @@ LT_INIT
+ dnl required headers
+ AC_CHECK_HEADERS([stdarg.h sys/types.h dirent.h errno.h libgen.h malloc.h])
+ AC_CHECK_HEADERS([stdlib.h mntent.h inttypes.h strings.h])
+-AC_CHECK_HEADERS([sys/time.h time.h mntent.h])
++AC_CHECK_HEADERS([dlfcn.h sys/dl.h sys/time.h time.h mntent.h])
+ 
+ dnl required structures
+ AC_STRUCT_DIRENT_D_TYPE
+-- 
+GitLab

diff --git a/media-libs/libbluray/libbluray-1.3.4-r2.ebuild 
b/media-libs/libbluray/libbluray-1.3.4-r2.ebuild
index b1cf2e14a489..edc24923ae58 100644
--- a/media-libs/libbluray/libbluray-1.3.4-r2.ebuild
+++ b/media-libs/libbluray/libbluray-1.3.4-r2.ebuild
@@ -44,9 +44,10 @@ BDEPEND="
 "
 
 PATCHES=(
-       "${FILESDIR}/libbluray-1.3.4-min-java.patch"
+       "${FILESDIR}"/${PN}-1.3.4-min-java.patch
        "${FILESDIR}"/${PN}-jars.patch
        "${FILESDIR}"/${PN}-1.3.4-fix-libudfread-option.patch
+       "${FILESDIR}"/${PN}-1.3.4-musl-dlopen.patch
 )
 
 DOCS=( ChangeLog README.md )

Reply via email to