From dab2ed10e1c18eb8c4f0a8857af7bd874a3b9a81 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 2 Aug 2020 21:01:12 -0500 Subject: [PATCH 1/3] gyp: update no-xcode.patch --- .../python-modules/gyp/default.nix | 4 ---- .../python-modules/gyp/no-xcode.patch | 23 +++++++++++++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/gyp/default.nix b/pkgs/development/python-modules/gyp/default.nix index 8bb20fafe76e..c951c97b20f4 100644 --- a/pkgs/development/python-modules/gyp/default.nix +++ b/pkgs/development/python-modules/gyp/default.nix @@ -14,10 +14,6 @@ buildPythonPackage { sha256 = "0r9phq5yrmj968vdvy9vivli35wn1j9a6iwshp69wl7q4p0x8q2b"; }; - prePatch = stdenv.lib.optionals stdenv.isDarwin '' - sed -i 's/raise.*No Xcode or CLT version detected.*/version = "7.0.0"/' pylib/gyp/xcode_emulation.py - ''; - patches = stdenv.lib.optionals stdenv.isDarwin [ ./no-darwin-cflags.patch ./no-xcode.patch diff --git a/pkgs/development/python-modules/gyp/no-xcode.patch b/pkgs/development/python-modules/gyp/no-xcode.patch index d202b7224744..0e46865846a8 100644 --- a/pkgs/development/python-modules/gyp/no-xcode.patch +++ b/pkgs/development/python-modules/gyp/no-xcode.patch @@ -1,12 +1,25 @@ ---- a/pylib/gyp/xcode_emulation.py -+++ b/pylib/gyp/xcode_emulation.py -@@ -1470,7 +1470,8 @@ +--- gyp-old/pylib/gyp/xcode_emulation.py 1980-01-02 00:00:00.000000000 -0600 ++++ gyp/pylib/gyp/xcode_emulation.py 2020-08-02 20:24:24.871322520 -0500 +@@ -1407,10 +1407,10 @@ + raise GypError("xcodebuild returned unexpected results") + except: + version = CLTVersion() +- if version: ++ if version and re.match(r'(\d\.\d\.?\d*)', version): + version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0] + else: +- raise GypError("No Xcode or CLT version detected!") ++ version = '7.0.0' + # The CLT has no build information, so we return an empty string. + version_list = [version, ''] + version = version_list[0] +@@ -1667,7 +1667,8 @@ sdk_root = xcode_settings._SdkRoot(configuration) if not sdk_root: sdk_root = xcode_settings._XcodeSdkPath('') - env['SDKROOT'] = sdk_root -+ if sdk_root: -+ env['SDKROOT'] = sdk_root ++ if not sdk_root: ++ env['SDKROOT'] = '' if not additional_settings: additional_settings = {} From 203538bd4fae00adeecce82d3432258a0242b27d Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 2 Aug 2020 21:01:41 -0500 Subject: [PATCH 2/3] lzfse: supports unix --- pkgs/tools/compression/lzfse/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/compression/lzfse/default.nix b/pkgs/tools/compression/lzfse/default.nix index 72560c1d9ae2..c5b9eea47960 100644 --- a/pkgs/tools/compression/lzfse/default.nix +++ b/pkgs/tools/compression/lzfse/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation { LZFSE is a Lempel-Ziv style data compression algorithm using Finite State Entropy coding. It targets similar compression rates at higher compression and decompression speed compared to deflate using zlib. ''; - platforms = platforms.linux; + platforms = platforms.unix; license = licenses.bsd3; maintainers = with maintainers; [ ]; }; From d0468f86e8e0fa59f6ee8fa493d68abc61facd98 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 2 Aug 2020 21:02:14 -0500 Subject: [PATCH 3/3] nss: set install name correctly --- pkgs/development/libraries/nss/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix index a7b014acc89a..d8af8bac615d 100644 --- a/pkgs/development/libraries/nss/default.nix +++ b/pkgs/development/libraries/nss/default.nix @@ -54,6 +54,11 @@ in stdenv.mkDerivation rec { patchFlags = [ "-p0" ]; + postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)" + substituteInPlace nss/coreconf/config.gypi --replace "'DYLIB_INSTALL_NAME_BASE': '@executable_path'" "'DYLIB_INSTALL_NAME_BASE': '$out/lib'" + ''; + outputs = [ "out" "dev" "tools" ]; preConfigure = "cd nss";