Merge #94587: nss: fix on darwin

This commit is contained in:
Vladimír Čunát 2020-08-06 09:08:29 +02:00
commit ce174c7bc9
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA
3 changed files with 23 additions and 9 deletions

View file

@ -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";

View file

@ -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

View file

@ -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 = {}