commit:     d65dc3c1a57f44e5cc517f49bf95efc1eee99907
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 22 00:01:19 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Apr 22 00:20:10 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d65dc3c1

dev-libs/libcec: fix build with musl 1.2.3

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libcec/files/libcec-6.0.2-musl-nullptr.patch   | 29 ++++++++++++++++++++++
 dev-libs/libcec/libcec-6.0.2.ebuild                |  3 ++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/dev-libs/libcec/files/libcec-6.0.2-musl-nullptr.patch 
b/dev-libs/libcec/files/libcec-6.0.2-musl-nullptr.patch
new file mode 100644
index 000000000000..d161e20c130d
--- /dev/null
+++ b/dev-libs/libcec/files/libcec-6.0.2-musl-nullptr.patch
@@ -0,0 +1,29 @@
+https://github.com/Pulse-Eight/libcec/pull/599
+
+From 452b2049b2ee3e73968c603e5524b2d349ac0c3e Mon Sep 17 00:00:00 2001
+From: psykose <[email protected]>
+Date: Sat, 9 Apr 2022 17:59:11 +0000
+Subject: [PATCH] cecloader.h: fix null return
+
+returning NULL is invalid for a return type of bool when NULL is defined
+as `nullptr` instead of 0L
+--- a/include/cecloader.h
++++ b/include/cecloader.h
+@@ -172,7 +172,7 @@ bool LibCecBootloader(const char *strLib = NULL)
+     if (!g_libCEC)
+     {
+       std::cout << dlerror() << std::endl;
+-      return NULL;
++      return false;
+     }
+   }
+ 
+@@ -181,7 +181,7 @@ bool LibCecBootloader(const char *strLib = NULL)
+   if (!LibCecBootloader)
+   {
+     std::cout << "cannot find CECStartBootloader" << std::endl;
+-    return NULL;
++    return false;
+   }
+ 
+   bool bReturn = LibCecBootloader();

diff --git a/dev-libs/libcec/libcec-6.0.2.ebuild 
b/dev-libs/libcec/libcec-6.0.2.ebuild
index 80507a293bfb..9518fad0b156 100644
--- a/dev-libs/libcec/libcec-6.0.2.ebuild
+++ b/dev-libs/libcec/libcec-6.0.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -36,6 +36,7 @@ S="${WORKDIR}/${PN}-${MY_P}"
 
 PATCHES=(
        "${FILESDIR}/${PN}-4.0.7-no-override-udev.patch"
+       "${FILESDIR}/${PN}-6.0.2-musl-nullptr.patch"
 )
 
 pkg_pretend() {

Reply via email to