v8: remove xcodebuild patch

Add xcodebuild commands from xcbuild.
This commit is contained in:
Matthew Bauer 2018-08-15 17:25:00 -05:00
parent bb3f7d14a1
commit d4b453d2c1
3 changed files with 3 additions and 74 deletions

View file

@ -1,5 +1,5 @@
{ stdenv, lib, fetchgit, fetchFromGitHub, gyp, readline, python, which, icu
, patchelf, coreutils, cctools
, patchelf, coreutils, xcbuild
, doCheck ? false
, static ? false
}:
@ -124,13 +124,7 @@ stdenv.mkDerivation rec {
# Patch based off of:
# https://github.com/cowboyd/libv8/tree/v5.1.281.67.0/patches
patches = lib.optional (!doCheck) ./libv8-5.4.232.patch
++ stdenv.lib.optionals stdenv.isDarwin [ ./no-xcode.patch ];
prePatch = ''
chmod +w tools/gyp/pylib/gyp
chmod +w tools/gyp/pylib/gyp/xcode_emulation.py
'';
patches = lib.optional (!doCheck) ./libv8-5.4.232.patch;
postPatch = ''
sed -i 's,#!/usr/bin/env python,#!${python}/bin/python,' gypfiles/gyp_v8
@ -157,7 +151,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ which ];
buildInputs = [ readline python icu ]
++ stdenv.lib.optional stdenv.isDarwin cctools
++ stdenv.lib.optional stdenv.isDarwin xcbuild
++ stdenv.lib.optional stdenv.isLinux patchelf;
NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow -Wno-error=unused-function -Wno-error=attributes"

View file

@ -1,64 +0,0 @@
--- a/tools/gyp/pylib/gyp/xcode_emulation.py
+++ a/tools/gyp/pylib/gyp/xcode_emulation.py
@@ -473,10 +473,16 @@
def _XcodeSdkPath(self, sdk_root):
if sdk_root not in XcodeSettings._sdk_path_cache:
- sdk_path = self._GetSdkVersionInfoItem(sdk_root, '--show-sdk-path')
- XcodeSettings._sdk_path_cache[sdk_root] = sdk_path
- if sdk_root:
- XcodeSettings._sdk_root_cache[sdk_path] = sdk_root
+ try:
+ sdk_path = self._GetSdkVersionInfoItem(sdk_root, '--show-sdk-path')
+ XcodeSettings._sdk_path_cache[sdk_root] = sdk_path
+ if sdk_root:
+ XcodeSettings._sdk_root_cache[sdk_path] = sdk_root
+ except:
+ # if this fails it's because xcodebuild failed, which means
+ # the user is probably on a CLT-only system, where there
+ # is no valid SDK root
+ XcodeSettings._sdk_path_cache[sdk_root] = None
return XcodeSettings._sdk_path_cache[sdk_root]
def _AppendPlatformVersionMinFlags(self, lst):
@@ -606,10 +612,11 @@
framework_root = sdk_root
else:
framework_root = ''
- config = self.spec['configurations'][self.configname]
- framework_dirs = config.get('mac_framework_dirs', [])
- for directory in framework_dirs:
- cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root))
+ if 'SDKROOT' in self._Settings():
+ config = self.spec['configurations'][self.configname]
+ framework_dirs = config.get('mac_framework_dirs', [])
+ for directory in framework_dirs:
+ cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root))
self.configname = None
return cflags
@@ -861,10 +868,11 @@
sdk_root = self._SdkPath()
if not sdk_root:
sdk_root = ''
- config = self.spec['configurations'][self.configname]
- framework_dirs = config.get('mac_framework_dirs', [])
- for directory in framework_dirs:
- ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
+ if 'SDKROOT' in self._Settings():
+ config = self.spec['configurations'][self.configname]
+ framework_dirs = config.get('mac_framework_dirs', [])
+ for directory in framework_dirs:
+ ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
platform_root = self._XcodePlatformPath(configname)
if sdk_root and platform_root and self._IsXCTest():
@@ -1358,7 +1366,7 @@
if 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]

View file

@ -12180,7 +12180,6 @@ with pkgs;
v8 = callPackage ../development/libraries/v8 ({
inherit (python2Packages) python gyp;
cctools = darwin.cctools;
icu = icu58; # v8-5.4.232 fails against icu4c-59.1
} // lib.optionalAttrs stdenv.isLinux {
# doesn't build with gcc7