diff --git a/pkgs/development/web/nodejs/bypass-xcodebuild.diff b/pkgs/development/web/nodejs/bypass-xcodebuild.diff new file mode 100644 index 000000000000..5c900dd2143f --- /dev/null +++ b/pkgs/development/web/nodejs/bypass-xcodebuild.diff @@ -0,0 +1,28 @@ +diff -Naur node-v12.18.4/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py node-v12.18.4-new/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +--- node-v12.18.4/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py 2020-09-15 09:08:46.000000000 +0200 ++++ node-v12.18.4-new/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py 2020-12-03 16:55:43.781860687 +0100 +@@ -436,7 +436,14 @@ + # Since the CLT has no SDK paths anyway, returning None is the + # most sensible route and should still do the right thing. + try: +- return GetStdoutQuiet(['xcodebuild', '-version', '-sdk', sdk, infoitem]) ++ # Return fake data that xcodebuild would normally return ++ ++ xcodedata = { ++ "Path": "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk", ++ "ProductBuildVersion": "19A547", ++ "ProductVersion": "10.15" ++ } ++ return xcodedata[infoitem] + except GypError: + pass + +@@ -1271,7 +1278,7 @@ + version = "" + build = "" + try: +- version_list = GetStdoutQuiet(['xcodebuild', '-version']).splitlines() ++ version_list = [] + # In some circumstances xcodebuild exits 0 but doesn't return + # the right results; for example, a user on 10.7 or 10.8 with + # a bogus path set via xcode-select diff --git a/pkgs/development/web/nodejs/v10.nix b/pkgs/development/web/nodejs/v10.nix index 1fa463892042..fcfc206d4699 100644 --- a/pkgs/development/web/nodejs/v10.nix +++ b/pkgs/development/web/nodejs/v10.nix @@ -1,7 +1,7 @@ -{ callPackage, openssl, icu, python2, enableNpm ? true }: +{ callPackage, openssl, icu, python2, stdenv, enableNpm ? true }: let - buildNodejs = callPackage ./nodejs.nix { + buildNodejs = callPackage ./nodejs.nix { inherit openssl icu; python = python2; }; @@ -10,4 +10,5 @@ in inherit enableNpm; version = "10.22.1"; sha256 = "0pr569qiabr4m7k38s7rwi3iyzrc5jmx19z2z0k7n4xfvhjlfzzl"; + patches = stdenv.lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff; } diff --git a/pkgs/development/web/nodejs/v12.nix b/pkgs/development/web/nodejs/v12.nix index 0e8362268331..5369adedc5c9 100644 --- a/pkgs/development/web/nodejs/v12.nix +++ b/pkgs/development/web/nodejs/v12.nix @@ -1,7 +1,7 @@ -{ callPackage, openssl, icu, python2, enableNpm ? true }: +{ callPackage, openssl, icu, python2, stdenv, enableNpm ? true }: let - buildNodejs = callPackage ./nodejs.nix { + buildNodejs = callPackage ./nodejs.nix { inherit openssl icu; python = python2; }; @@ -10,4 +10,5 @@ in inherit enableNpm; version = "12.18.4"; sha256 = "02gncjrrjqdwf9ydmg96yn9ldsw539q9w88cknax1djkisqkrw15"; + patches = stdenv.lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff; } diff --git a/pkgs/development/web/nodejs/v14.nix b/pkgs/development/web/nodejs/v14.nix index 549f29db2fec..ff359bf93d2b 100644 --- a/pkgs/development/web/nodejs/v14.nix +++ b/pkgs/development/web/nodejs/v14.nix @@ -1,4 +1,4 @@ -{ callPackage, openssl, python3, enableNpm ? true }: +{ callPackage, openssl, python3, stdenv, enableNpm ? true }: let buildNodejs = callPackage ./nodejs.nix { @@ -10,4 +10,5 @@ in inherit enableNpm; version = "14.9.0"; sha256 = "1xkfivr0qci50ksg66szyasdlbiwh2j7ia4n6qc5csih2nvzcbh1"; + patches = stdenv.lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff; }