From 2bb0e256ea97dbddb21490ad788db3a1cf443a6e Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 26 Apr 2021 21:24:03 +0200 Subject: [PATCH] darwin.CF: Include missing TARGET_OS_* defines This patch is static and may not be appropriate if the compilation target is iOS. --- .../0001-Add-missing-TARGET_OS_-defines.patch | 30 +++++++++++++++++++ .../darwin/swift-corelibs/corefoundation.nix | 4 ++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 pkgs/os-specific/darwin/swift-corelibs/0001-Add-missing-TARGET_OS_-defines.patch diff --git a/pkgs/os-specific/darwin/swift-corelibs/0001-Add-missing-TARGET_OS_-defines.patch b/pkgs/os-specific/darwin/swift-corelibs/0001-Add-missing-TARGET_OS_-defines.patch new file mode 100644 index 000000000000..db17c517c720 --- /dev/null +++ b/pkgs/os-specific/darwin/swift-corelibs/0001-Add-missing-TARGET_OS_-defines.patch @@ -0,0 +1,30 @@ +From 549160574ee44656d50997b27ef83736e0848201 Mon Sep 17 00:00:00 2001 +From: toonn +Date: Mon, 26 Apr 2021 20:51:05 +0200 +Subject: [PATCH] Add missing TARGET_OS_* defines + +--- + .../Base.subproj/SwiftRuntime/TargetConditionals.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/CoreFoundation/Base.subproj/SwiftRuntime/TargetConditionals.h b/CoreFoundation/Base.subproj/SwiftRuntime/TargetConditionals.h +index 6d42b873..abf746c9 100644 +--- a/CoreFoundation/Base.subproj/SwiftRuntime/TargetConditionals.h ++++ b/CoreFoundation/Base.subproj/SwiftRuntime/TargetConditionals.h +@@ -118,6 +118,13 @@ + + #define TARGET_OS_WIN32 TARGET_OS_WINDOWS + #define TARGET_OS_MAC TARGET_OS_DARWIN ++#define TARGET_OS_OSX TARGET_OS_DARWIN ++ ++#define TARGET_OS_IPHONE 0 ++#define TARGET_OS_WATCH 0 ++#define TARGET_OS_TV 0 ++#define TARGET_OS_EMBEDDED 0 ++ + + #if __x86_64__ + #define TARGET_CPU_PPC 0 +-- +2.17.2 (Apple Git-113) + diff --git a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix index 560be0c31ab6..59bff5fac147 100644 --- a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix +++ b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ ninja python3 ]; buildInputs = [ curl libxml2 objc4 ICU ]; + patches = [ ./0001-Add-missing-TARGET_OS_-defines.patch ]; + postPatch = '' cd CoreFoundation @@ -76,7 +78,7 @@ stdenv.mkDerivation { # please remove this when updating the default llvm versions to 8 or # later. buildPhase = lib.optionalString true '' - for i in {1..512}; do + for i in {1..1}; do if ninja -j $NIX_BUILD_CORES; then break fi