Skip to content

Commit fe0ba81

Browse files
committed
swift-foundation: update for 6.1.2 and Scarthgap
The new Swift Foundation is separated into FoundationEssentials, FoundationICU and Foundation. Create separate recipes for all three. Add support for building separate -dev and -staticdev packages rather than including development-only products in the target image Include a small patch to enable CF timer tolerance APIs for non-Darwin platforms.
1 parent b696e6d commit fe0ba81

File tree

6 files changed

+236
-207
lines changed

6 files changed

+236
-207
lines changed

recipes-devtools/swift/libfoundation.bb

Lines changed: 0 additions & 54 deletions
This file was deleted.

recipes-devtools/swift/libfoundation/0001-Make-FoundationConfig.cmake-not-depend-on-build-dir.patch

Lines changed: 0 additions & 153 deletions
This file was deleted.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
SUMMARY = "FoundationEssentials"
2+
DESCRIPTION = "Foundation provides a base layer of functionality useful in many applications, including fundamental types for numbers, data, collections, and dates, as well as functions for task management, file system access, and more."
3+
HOMEPAGE = "https://github.com/swiftlang/swift-foundation"
4+
5+
LICENSE = "Apache-2.0"
6+
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=2380e856fbdbc7ccae6bd699d53ec121"
7+
8+
require swift-version.inc
9+
PV = "${SWIFT_VERSION}+git${SRCPV}"
10+
SRCREV_FORMAT = "foundation_icu_syntax_collections"
11+
12+
SRC_URI = "git://github.com/swiftlang/swift-foundation.git;protocol=https;name=foundation;tag=swift-${SWIFT_VERSION}-RELEASE;nobranch=1;"
13+
SRC_URI += "git://github.com/swiftlang/swift-foundation-icu.git;protocol=https;name=icu;tag=swift-${SWIFT_VERSION}-RELEASE;nobranch=1;destsuffix=swift-foundation-icu;"
14+
SRC_URI += "git://github.com/swiftlang/swift-syntax.git;protocol=https;name=syntax;tag=swift-${SWIFT_VERSION}-RELEASE;nobranch=1;destsuffix=swift-foundation-icu;"
15+
SRC_URI += "git://github.com/apple/swift-collections.git;protocol=https;nobranch=1;name=collections;tag=1.1.4;destsuffix=swift-collections;"
16+
17+
S = "${WORKDIR}/git"
18+
19+
DEPENDS = "icu swift-stdlib swift-native swift-foundation-icu"
20+
RDEPENDS:${PN} += "icu swift-stdlib swift-foundation-icu"
21+
22+
inherit swift-cmake-base
23+
24+
TARGET_LDFLAGS += "-L${STAGING_DIR_TARGET}/usr/lib/swift/linux"
25+
26+
# Enable Swift parts
27+
EXTRA_OECMAKE += "-DENABLE_SWIFT=YES"
28+
EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=YES"
29+
EXTRA_OECMAKE += "-D_SwiftFoundationICU_SourceDIR=${WORKDIR}/swift-foundation-icu"
30+
EXTRA_OECMAKE += "-D_SwiftCollections_SourceDIR=${WORKDIR}/swift-collections"
31+
EXTRA_OECMAKE += "-DSwiftFoundation_MODULE_TRIPLE=${TARGET_ARCH}-unknown-linux-gnu"
32+
EXTRA_OECMAKE += "-DSwiftSyntax_DIR=${WORKDIR}/swift-syntax/cmake/modules"
33+
34+
lcl_maybe_fortify="-D_FORTIFY_SOURCE=0"
35+
36+
# Ensure the right CPU is targeted
37+
cmake_do_generate_toolchain_file:append() {
38+
sed -i 's/set([ ]*CMAKE_SYSTEM_PROCESSOR .*[ ]*)/set(CMAKE_SYSTEM_PROCESSOR ${TARGET_CPU_NAME})/' ${WORKDIR}/toolchain.cmake
39+
}
40+
41+
do_install:append() {
42+
# don't double up on Unicode
43+
rm -rf ${D}${libdir}/swift/_foundation_unicode
44+
rm -rf ${D}${libdir}/swift/linux/lib_FoundationICU.so
45+
}
46+
47+
FILES:${PN} = "\
48+
${libdir}/swift/linux/libFoundationEssentials.so \
49+
${libdir}/swift/linux/libFoundationInternationalization.so \
50+
"
51+
52+
FILES:${PN}-dev = "\
53+
${libdir}/swift/_FoundationCShims/* \
54+
${libdir}/swift/linux/FoundationEssentials.swiftmodule/* \
55+
${libdir}/swift/linux/FoundationInternationalization.swiftmodule/* \
56+
${libdir}/swift/linux/_FoundationCollections.swiftmodule/* \
57+
"
58+
59+
FILES:${PN}-staticdev = "\
60+
${libdir}/lib_SwiftLibraryPluginProviderCShims.a \
61+
${libdir}/swift_static/linux/libFoundationEssentials.a \
62+
"
63+
64+
INSANE_SKIP:${PN} = "file-rdeps"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
SUMMARY = "swift-foundation-icu"
2+
DESCRIPTION = "This version of the ICU4C project contains customized extensions for use by the Foundation package."
3+
HOMEPAGE = "https://github.com/swiftlang/swift-corelibs-foundation-icu"
4+
5+
LICENSE = "Apache-2.0"
6+
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=2380e856fbdbc7ccae6bd699d53ec121"
7+
8+
require swift-version.inc
9+
PV = "${SWIFT_VERSION}+git${SRCPV}"
10+
11+
SRC_URI = "git://github.com/swiftlang/swift-foundation-icu.git;protocol=https;name=icu;tag=swift-${SWIFT_VERSION}-RELEASE;nobranch=1;"
12+
13+
S = "${WORKDIR}/git"
14+
15+
DEPENDS = "icu swift-stdlib"
16+
RDEPENDS:${PN} += "swift-stdlib"
17+
18+
inherit swift-cmake-base
19+
20+
TARGET_LDFLAGS += "-L${STAGING_DIR_TARGET}/usr/lib/swift/linux"
21+
22+
# Enable Swift parts
23+
EXTRA_OECMAKE += "-DENABLE_SWIFT=YES"
24+
EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=YES"
25+
26+
lcl_maybe_fortify="-D_FORTIFY_SOURCE=0"
27+
28+
# Ensure the right CPU is targeted
29+
cmake_do_generate_toolchain_file:append() {
30+
sed -i 's/set([ ]*CMAKE_SYSTEM_PROCESSOR .*[ ]*)/set(CMAKE_SYSTEM_PROCESSOR ${TARGET_CPU_NAME})/' ${WORKDIR}/toolchain.cmake
31+
}
32+
33+
FILES:${PN} = "\
34+
${libdir}/swift/linux/lib_FoundationICU.so \
35+
"
36+
37+
FILES:${PN}-dev = "\
38+
${libdir}/swift/_foundation_unicode/* \
39+
${libdir}/swift/linux/${SWIFT_TARGET_ARCH}/FoundationICU.swiftmodule/* \
40+
"
41+
42+
INSANE_SKIP:${PN} = "file-rdeps"

0 commit comments

Comments
 (0)