Skip to content

Commit 2ffbe98

Browse files
committed
libdispatch: update for Scarthgap
Update libdispatch for Scarthgap, with some cleanups to the summary and description. Add support for building separate -dev and -staticdev packages rather than including development-only products in the target image.
1 parent ad623b3 commit 2ffbe98

File tree

1 file changed

+44
-13
lines changed

1 file changed

+44
-13
lines changed

recipes-devtools/swift/libdispatch.bb

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
2-
SUMMARY = "Libdispatch"
3-
HOMEPAGE = "https://github.com/apple/swift-corelibs-libdispatch"
1+
SUMMARY = "libdispatch"
2+
DESCRIPTION = "The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware"
3+
HOMEPAGE = "https://github.com/swiftlang/swift-corelibs-libdispatch"
44

55
LICENSE = "Apache-2.0"
66
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=1cd73afe3fb82e8d5c899b9d926451d0"
77

88
require swift-version.inc
9-
PV = "${SWIFT_VERSION}"
9+
PV = "${SWIFT_VERSION}+git${SRCPV}"
1010

11-
SRC_URI = "git://github.com/apple/swift-corelibs-libdispatch.git;protocol=https;tag=swift-${PV}-RELEASE;nobranch=1"
11+
DEPENDS = "swift-stdlib"
1212

13-
DEPENDS = "swift-stdlib ncurses"
13+
SRC_URI = "git://github.com/swiftlang/swift-corelibs-libdispatch.git;protocol=https;tag=swift-${SWIFT_VERSION}-RELEASE;nobranch=1"
1414

1515
S = "${WORKDIR}/git"
16+
LIBDISPATCH_BUILDDIR = "${WORKDIR}/build"
1617

1718
inherit swift-cmake-base
1819

@@ -22,15 +23,45 @@ TARGET_LDFLAGS += "-L${STAGING_DIR_TARGET}/usr/lib/swift/linux"
2223
EXTRA_OECMAKE += "-DENABLE_SWIFT=YES"
2324

2425
# Ensure the right CPU is targeted
25-
cmake_do_generate_toolchain_file_append() {
26+
cmake_do_generate_toolchain_file:append() {
2627
sed -i 's/set([ ]*CMAKE_SYSTEM_PROCESSOR .*[ ]*)/set(CMAKE_SYSTEM_PROCESSOR ${TARGET_CPU_NAME})/' ${WORKDIR}/toolchain.cmake
2728
}
2829

29-
do_install_append() {
30-
# Copy cmake build modules
31-
mkdir -p ${D}${libdir}/swift/dispatch/cmake
32-
cp -rf ${WORKDIR}/build/cmake/modules/* ${D}${libdir}/swift/dispatch/cmake/
30+
do_install:append() {
31+
# move the header files out of /usr/lib/swift and into /usr/include,
32+
# because we want Swift C shims to be able to pick them up without fancy
33+
# SwiftPM magic
34+
install -d ${D}${includedir}
35+
(cd ${D}${libdir}/swift; mv Block os dispatch ${D}${includedir})
36+
37+
# don't install CMake modules as they have absolute paths in them
38+
# install -d ${D}${libdir}/cmake/dispatch
39+
# install -m 0644 ${LIBDISPATCH_BUILDDIR}/cmake/modules/dispatchConfig.cmake ${D}${libdir}/cmake/dispatch/
40+
# install -m 0644 ${LIBDISPATCH_BUILDDIR}/cmake/modules/dispatchExports.cmake ${D}${libdir}/cmake/dispatch/
3341
}
3442

35-
FILES_${PN} = "${libdir}/swift/*"
36-
INSANE_SKIP_${PN} = "file-rdeps"
43+
FILES:${PN} = "\
44+
${libdir}/swift/linux/libdispatch.so \
45+
${libdir}/swift/linux/libswiftDispatch.so \
46+
${libdir}/swift/linux/libBlocksRuntime.so \
47+
"
48+
49+
FILES:${PN}-dev = "\
50+
${libdir}/swift/linux/${SWIFT_TARGET_ARCH}/Dispatch.swiftdoc \
51+
${libdir}/swift/linux/${SWIFT_TARGET_ARCH}/Dispatch.swiftmodule \
52+
${includedir}/Block \
53+
${includedir}/os \
54+
${includedir}/dispatch \
55+
"
56+
57+
FILES:${PN}-staticdev = "\
58+
${libdir}/swift_static/linux/libdispatch.a \
59+
${libdir}/swift_static/linux/libswiftDispatch.a \
60+
${libdir}/swift_static/linux/libBlocksRuntime.a \
61+
${libdir}/swift_static/linux/libDispatchStubs.a \
62+
${libdir}/swift_static/linux/${SWIFT_TARGET_ARCH}/Dispatch.swiftdoc \
63+
${libdir}/swift_static/linux/${SWIFT_TARGET_ARCH}/Dispatch.swiftmodule \
64+
${libdir}/swift_static/linux/dispatch \
65+
"
66+
67+
INSANE_SKIP:${PN} = "file-rdeps"

0 commit comments

Comments
 (0)