Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / web / nodejs / bypass-darwin-xcrun-node16.patch
blobe86fcc4d2973d84f38da0c67fe8941ca7f9889ae
1 Avoids needing xcrun or xcodebuild in PATH for native package builds
3 diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
4 index a75d8ee..476440d 100644
5 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
6 +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
7 @@ -522,7 +522,13 @@ class XcodeSettings:
8 # Since the CLT has no SDK paths anyway, returning None is the
9 # most sensible route and should still do the right thing.
10 try:
11 - return GetStdoutQuiet(["xcrun", "--sdk", sdk, infoitem])
12 + #return GetStdoutQuiet(["xcrun", "--sdk", sdk, infoitem])
13 + return {
14 + "--show-sdk-platform-path": "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform",
15 + "--show-sdk-path": "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk",
16 + "--show-sdk-build-version": "19A547",
17 + "--show-sdk-version": "10.15"
18 + }[infoitem]
19 except GypError:
20 pass
22 @@ -1499,7 +1505,8 @@ def XcodeVersion():
23 version = ""
24 build = ""
25 try:
26 - version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines()
27 + #version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines()
28 + version_list = []
29 # In some circumstances xcodebuild exits 0 but doesn't return
30 # the right results; for example, a user on 10.7 or 10.8 with
31 # a bogus path set via xcode-select
32 @@ -1510,7 +1517,8 @@ def XcodeVersion():
33 version = version_list[0].split()[-1] # Last word on first line
34 build = version_list[-1].split()[-1] # Last word on last line
35 except GypError: # Xcode not installed so look for XCode Command Line Tools
36 - version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322
37 + #version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322
38 + version = "11.0.0.0.1.1567737322"
39 if not version:
40 raise GypError("No Xcode or CLT version detected!")
41 # Be careful to convert "4.2.3" to "0423" and "11.0.0" to "1100":