diff mbox series

[meta-darwin] osx-runtime: update to 14.5

Message ID 20250410135024.19183-1-ecordonnier@snap.com
State New
Headers show
Series [meta-darwin] osx-runtime: update to 14.5 | expand

Commit Message

Etienne Cordonnier April 10, 2025, 1:50 p.m. UTC
From: Dominik Schnitzer <dominik@snap.com>

Signed-off-by: Dominik Schnitzer <dominik@snap.com>
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
---
 README                                        | 22 +-------------
 .../osx-runtime/files/sdk-14.5.patch          | 18 ++++++++++++
 ..._12.3.bb => nativesdk-osx-runtime_14.5.bb} | 29 +++++++++++++------
 3 files changed, 39 insertions(+), 30 deletions(-)
 create mode 100644 recipes-devtools/osx-runtime/files/sdk-14.5.patch
 rename recipes-devtools/osx-runtime/{nativesdk-osx-runtime_12.3.bb => nativesdk-osx-runtime_14.5.bb} (69%)
diff mbox series

Patch

diff --git a/README b/README
index 4cea8d6..89845b5 100644
--- a/README
+++ b/README
@@ -3,31 +3,11 @@  meta-darwin
 
 OpenEmbedded meta layer for darwin based SDKs
 
-Note: Only macOS SDK version 12.3 (Darwin 21) is supported.
+Note: Only macOS SDK version 14.5 (>=Darwin 21) is supported.
 
 Ensure you have read and understood the Xcode license terms:
 https://www.apple.com/legal/sla/docs/xcode.pdf
 
-You also need a macOS sysroot tarball/zip file generated (copied) from a target macOS
-system. This is placed in the osx-runtime files directory and is used to compile the SDK
-against it. It needs to contain the system libraries (/usr/lib) and include files 
-(/usr/include). This tarball is not part of this meta-darwin layer and must be
-created by the user. To create it, the user is required to have a legitimate Mac computer
-with macOS 12.3 or later and with Xcode installed.
-
-Information on packaging the SDK is available at:
-https://github.com/tpoechtrager/osxcross#packaging-the-sdk
-
-Copy the created OSX-sdk.zip file to your Yocto development machine, placing it into
-meta-darwin layer:
-
- <...>/meta-darwin/recipes-devtools/osx-runtime/files
-
-You can alternatively add a nativesdk-osx-runtime_%.bbappend file to your
-layer and override SRC_URI and do_configure() to extract the SDK from
-a different location.
-
-
 This layer depends on:
 
  URI: git://git.openembedded.org/openembedded-core
diff --git a/recipes-devtools/osx-runtime/files/sdk-14.5.patch b/recipes-devtools/osx-runtime/files/sdk-14.5.patch
new file mode 100644
index 0000000..075efa3
--- /dev/null
+++ b/recipes-devtools/osx-runtime/files/sdk-14.5.patch
@@ -0,0 +1,18 @@ 
+From: Dominik Schnitzer <dominik@snap.com>
+Date: Mon, 17 Mar 2025 10:22:17 +0000
+Subject: [PATCH] Handle __FLT_EVAL_METHOD__ == 16
+
+Upstream-Status: Inappropriate [OE specific]
+Signed-off-by: Dominik Schnitzer <dominik@snap.com>
+diff -ru OSX-sdk-orig/usr/include/math.h OSX-sdk/usr/include/math.h
+--- OSX-sdk-orig/usr/include/math.h	2024-10-16 20:10:36.199787938 +0200
++++ OSX-sdk/usr/include/math.h	2024-10-16 20:21:31.536514706 +0200
+@@ -41,7 +41,7 @@
+     taking advantage of GCC's __FLT_EVAL_METHOD__ (which a compiler may
+     define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a
+     compiler must define only in float.h).                                    */
+-#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1
++#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1 || __FLT_EVAL_METHOD__ == 16
+     typedef float float_t;
+     typedef double double_t;
+ #elif __FLT_EVAL_METHOD__ == 1
diff --git a/recipes-devtools/osx-runtime/nativesdk-osx-runtime_12.3.bb b/recipes-devtools/osx-runtime/nativesdk-osx-runtime_14.5.bb
similarity index 69%
rename from recipes-devtools/osx-runtime/nativesdk-osx-runtime_12.3.bb
rename to recipes-devtools/osx-runtime/nativesdk-osx-runtime_14.5.bb
index f572b16..a7421cf 100644
--- a/recipes-devtools/osx-runtime/nativesdk-osx-runtime_12.3.bb
+++ b/recipes-devtools/osx-runtime/nativesdk-osx-runtime_14.5.bb
@@ -1,18 +1,22 @@ 
-DESCRIPTION = "Runtime libraries from OSX"
+DESCRIPTION = "Runtime libraries for MacOS"
 LICENSE = "Proprietary"
 
 COMPATIBLE_HOST = ".*-darwin.*"
 
-OSX_SDK ?= "file://OSX-sdk.zip"
+OSX_SDK ?= "git://github.com/alexey-lysiuk/macos-sdk.git;nobranch=1;protocol=https;subpath=MacOSX14.5.sdk;destsuffix=git"
+SRCREV = "69ddec41e6224afebd5f19bb24764305ac3e828a"
 
-SRC_URI = "${OSX_SDK} \
-           file://LICENSE"
+SRC_URI = " \
+    ${OSX_SDK} \
+    file://sdk-14.5.patch \
+    file://LICENSE \
+"
 
 LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=03fe683ef28b9ddfe7f658a0f4b3b80e"
 
 PR = "1"
 
-S = "${WORKDIR}/OSX-sdk"
+S = "${WORKDIR}/git"
 
 inherit nativesdk
 
@@ -48,7 +52,7 @@  do_configure() {
 
 do_install () {
     mkdir -p ${D}
-	cp -r ${WORKDIR}/OSX-sdk/* ${D}/
+    cp -r ${S}/* ${D}/
 }
 
 do_stash_locale () {
@@ -59,12 +63,19 @@  ALLOW_EMPTY:${PN} = "1"
 
 PACKAGES = "${PN} ${PN}-dontship"
 
-FILES:${PN}-dontship = "/usr /System /Entitlements.plist /SDKSettings.json /SDKSettings.plist /Library"
+FILES:${PN}-dontship = " \
+    /usr \
+    /System \
+    /Entitlements.plist \
+    /SDKSettings.json \
+    /SDKSettings.plist \
+    /Library \
+    /patches \
+"
 
 SYSROOT_DIRS_NATIVE:append = " ${SDKPATHNATIVE}/runtime"
 SYSROOT_DIRS:append = " ${SDKPATHNATIVE}/runtime"
 
 sysroot_stage_all:append() {
-	sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}${SDKPATHNATIVE}/runtime
+    sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}${SDKPATHNATIVE}/runtime
 }
-