commit:     6aae73c5a4e9b32f8e19388bc831c23c0e19259f
Author:     Matthew Smith <matthew <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  7 21:28:26 2024 +0000
Commit:     Matthew Smith <matthew <AT> gentoo <DOT> org>
CommitDate: Thu Mar  7 21:28:43 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6aae73c5

dev-embedded/picotool: fix musl build

Closes: https://bugs.gentoo.org/867283
Signed-off-by: Matthew Smith <matthew <AT> gentoo.org>

 dev-embedded/picotool/files/picotool-1.1.2-musl.patch | 17 +++++++++++++++++
 dev-embedded/picotool/picotool-1.1.2.ebuild           | 11 +++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/dev-embedded/picotool/files/picotool-1.1.2-musl.patch 
b/dev-embedded/picotool/files/picotool-1.1.2-musl.patch
new file mode 100644
index 000000000000..77eeda5b6b9c
--- /dev/null
+++ b/dev-embedded/picotool/files/picotool-1.1.2-musl.patch
@@ -0,0 +1,17 @@
+https://bugs.gentoo.org/867283
+https://wiki.gentoo.org/wiki/Musl_porting_notes#cdefs.h:_No_such_file_or_directory
+--- a/pico-sdk/src/host/pico_platform/include/pico/platform.h
++++ b/pico-sdk/src/host/pico_platform/include/pico/platform.h
+@@ -13,7 +13,11 @@
+ 
+ #ifdef __unix__
+ 
+-#include <sys/cdefs.h>
++#if defined __has_include
++# if __has_include (<sys/cdefs.h>)
++#  include <sys/cdefs.h>
++# endif
++#endif
+ 
+ #endif
+ 

diff --git a/dev-embedded/picotool/picotool-1.1.2.ebuild 
b/dev-embedded/picotool/picotool-1.1.2.ebuild
index 4c0f759534b0..fbed611955ca 100644
--- a/dev-embedded/picotool/picotool-1.1.2.ebuild
+++ b/dev-embedded/picotool/picotool-1.1.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 Gentoo Authors
+# Copyright 2022-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -27,9 +27,16 @@ RDEPEND="virtual/libusb:1"
 DEPEND="${RDEPEND}"
 BDEPEND="virtual/pkgconfig"
 
+PATCHES=( "${FILESDIR}"/${PN}-1.1.2-musl.patch )
+
+src_prepare() {
+       mv "${WORKDIR}"/${SDK_P} "${S}"/pico-sdk || die
+       cmake_src_prepare
+}
+
 src_configure() {
        local mycmakeargs=(
-               -DPICO_SDK_PATH="${WORKDIR}"/${SDK_P}
+               -DPICO_SDK_PATH="${S}"/pico-sdk
        )
        cmake_src_configure
 }

Reply via email to