|
| 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" |
0 commit comments