From 634cbfa8f2796ad9ddf151ab639e6ca68b80aaa1 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Mon, 12 Mar 2018 12:16:17 +0100 Subject: [PATCH] nodejs: patch bundled node-gyp module to not invoke xcodebuild on macOS causing modules with native dependencies to fail --- pkgs/development/web/nodejs/no-xcodebuild.patch | 13 +++++++++++++ pkgs/development/web/nodejs/v6.nix | 2 +- pkgs/development/web/nodejs/v8.nix | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/web/nodejs/no-xcodebuild.patch diff --git a/pkgs/development/web/nodejs/no-xcodebuild.patch b/pkgs/development/web/nodejs/no-xcodebuild.patch new file mode 100644 index 00000000000..94184152a03 --- /dev/null +++ b/pkgs/development/web/nodejs/no-xcodebuild.patch @@ -0,0 +1,13 @@ +diff -Naur node-v8.9.4/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py node-v8.9.4-new/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +--- node-v8.9.4/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py 2018-01-03 03:34:44.000000000 +0100 ++++ node-v8.9.4-new/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py 2018-03-12 11:15:37.972537585 +0100 +@@ -1251,7 +1251,8 @@ + if XCODE_VERSION_CACHE: + return XCODE_VERSION_CACHE + try: +- version_list = GetStdout(['xcodebuild', '-version']).splitlines() ++ #version_list = GetStdout(['xcodebuild', '-version']).splitlines() ++ version_list = ['Xcode 9.2', 'Build version 9C40b'] + # 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/v6.nix b/pkgs/development/web/nodejs/v6.nix index c2ca341751b..491c0674a70 100644 --- a/pkgs/development/web/nodejs/v6.nix +++ b/pkgs/development/web/nodejs/v6.nix @@ -7,5 +7,5 @@ in inherit enableNpm; version = "6.13.0"; sha256 = "012dpfqxsrmd3xc4dmq0mik1kab4czf56s8wm2jvm7xjqvi6y5mp"; - patches = lib.optionals stdenv.isDarwin [ ./no-xcode.patch ]; + patches = lib.optionals stdenv.isDarwin [ ./no-xcode.patch ./no-xcodebuild.patch ]; } diff --git a/pkgs/development/web/nodejs/v8.nix b/pkgs/development/web/nodejs/v8.nix index fa5f10e8f7b..662999225bf 100644 --- a/pkgs/development/web/nodejs/v8.nix +++ b/pkgs/development/web/nodejs/v8.nix @@ -7,5 +7,5 @@ in inherit enableNpm; version = "8.9.4"; sha256 = "0vy8rlg58kg75j4sw3xadmbrwxfa56iaykmjl18g9a8wkjfdxp3c"; - patches = lib.optionals stdenv.isDarwin [ ./no-xcode-v7.patch ]; + patches = lib.optionals stdenv.isDarwin [ ./no-xcode-v7.patch ./no-xcodebuild.patch ]; }