swift-corefoundation: fix sandboxed build

This commit is contained in:
Daiderd Jordan 2019-02-12 00:29:28 +01:00
parent 015b0294b3
commit 051fcba987
No known key found for this signature in database
GPG Key ID: D02435D05B810C96

View File

@ -8,7 +8,9 @@ let
url = "https://raw.githubusercontent.com/apple/swift-corelibs-foundation/9a5d8420f7793e63a8d5ec1ede516c4ebec939f0/CoreFoundation/Base.subproj/CFSystemDirectories.c"; url = "https://raw.githubusercontent.com/apple/swift-corelibs-foundation/9a5d8420f7793e63a8d5ec1ede516c4ebec939f0/CoreFoundation/Base.subproj/CFSystemDirectories.c";
sha256 = "0krfyghj4f096arvvpf884ra5czqlmbrgf8yyc0b3avqmb613pcc"; sha256 = "0krfyghj4f096arvvpf884ra5czqlmbrgf8yyc0b3avqmb613pcc";
}; };
in stdenv.mkDerivation { in
stdenv.mkDerivation {
name = "swift-corefoundation"; name = "swift-corefoundation";
src = fetchFromGitHub { src = fetchFromGitHub {
@ -34,6 +36,10 @@ in stdenv.mkDerivation {
--replace "cf.CFLAGS += '-DDEPLOYMENT" '#' \ --replace "cf.CFLAGS += '-DDEPLOYMENT" '#' \
--replace "cf.LDFLAGS += '-ldispatch" '#' --replace "cf.LDFLAGS += '-ldispatch" '#'
# Fix sandbox impurities.
substituteInPlace ../lib/script.py \
--replace '/bin/cp' cp
# Includes xpc for some initialization routine that they don't define anyway, so no harm here # Includes xpc for some initialization routine that they don't define anyway, so no harm here
substituteInPlace PlugIn.subproj/CFBundlePriv.h \ substituteInPlace PlugIn.subproj/CFBundlePriv.h \
--replace '#if (TARGET_OS_MAC' '#if (0' --replace '#if (TARGET_OS_MAC' '#if (0'