1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

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";
sha256 = "0krfyghj4f096arvvpf884ra5czqlmbrgf8yyc0b3avqmb613pcc";
};
in stdenv.mkDerivation {
in
stdenv.mkDerivation {
name = "swift-corefoundation";
src = fetchFromGitHub {
@ -34,6 +36,10 @@ in stdenv.mkDerivation {
--replace "cf.CFLAGS += '-DDEPLOYMENT" '#' \
--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
substituteInPlace PlugIn.subproj/CFBundlePriv.h \
--replace '#if (TARGET_OS_MAC' '#if (0'
@ -53,7 +59,7 @@ in stdenv.mkDerivation {
BUILD_DIR = "./Build";
CFLAGS = "-DINCLUDE_OBJC -I${libxml2.dev}/include/libxml2"; # They seem to assume we include objc in some places and not in others, make a PR; also not sure why but libxml2 include path isn't getting picked up from buildInputs
# I'm guessing at the version here. https://github.com/apple/swift-corelibs-foundation/commit/df3ec55fe6c162d590a7653d89ad669c2b9716b1 imported "high sierra"
# and this version is a version from there. No idea how accurate it is.
LDFLAGS = "-current_version 1454.90.0 -compatibility_version 150.0.0 -init ___CFInitialize";