about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/gyp
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/gyp')
-rw-r--r--nixpkgs/pkgs/development/python-modules/gyp/default.nix34
-rw-r--r--nixpkgs/pkgs/development/python-modules/gyp/no-darwin-cflags.patch40
-rw-r--r--nixpkgs/pkgs/development/python-modules/gyp/no-xcode.patch12
3 files changed, 86 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/gyp/default.nix b/nixpkgs/pkgs/development/python-modules/gyp/default.nix
new file mode 100644
index 000000000000..46b0dde636af
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/gyp/default.nix
@@ -0,0 +1,34 @@
+{ stdenv
+, buildPythonPackage
+, fetchgit
+, isPy3k
+}:
+
+buildPythonPackage rec {
+  pname = "gyp";
+  version = "2015-06-11";
+  disabled = isPy3k;
+
+  src = fetchgit {
+    url = "https://chromium.googlesource.com/external/gyp.git";
+    rev = "fdc7b812f99e48c00e9a487bd56751bbeae07043";
+    sha256 = "1imgxsl4mr1662vsj2mlnpvvrbz71yk00w8p85vi5bkgmc6awgiz";
+  };
+
+  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
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A tool to generate native build files";
+    homepage = https://chromium.googlesource.com/external/gyp/+/master/README.md;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ codyopel ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/python-modules/gyp/no-darwin-cflags.patch b/nixpkgs/pkgs/development/python-modules/gyp/no-darwin-cflags.patch
new file mode 100644
index 000000000000..798d0f0b16d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/gyp/no-darwin-cflags.patch
@@ -0,0 +1,40 @@
+Index: gyp/pylib/gyp/xcode_emulation.py
+===================================================================
+--- gyp/pylib/gyp/xcode_emulation.py
++++ gyp/pylib/gyp/xcode_emulation.py
+@@ -483,9 +483,6 @@
+     if self._Test('GCC_CHAR_IS_UNSIGNED_CHAR', 'YES', default='NO'):
+       cflags.append('-funsigned-char')
+ 
+-    if self._Test('GCC_CW_ASM_SYNTAX', 'YES', default='YES'):
+-      cflags.append('-fasm-blocks')
+-
+     if 'GCC_DYNAMIC_NO_PIC' in self._Settings():
+       if self._Settings()['GCC_DYNAMIC_NO_PIC'] == 'YES':
+         cflags.append('-mdynamic-no-pic')
+@@ -495,9 +492,6 @@
+       # mdynamic-no-pic by default for executable and possibly static lib
+       # according to mento
+ 
+-    if self._Test('GCC_ENABLE_PASCAL_STRINGS', 'YES', default='YES'):
+-      cflags.append('-mpascal-strings')
+-
+     self._Appendf(cflags, 'GCC_OPTIMIZATION_LEVEL', '-O%s', default='s')
+ 
+     if self._Test('GCC_GENERATE_DEBUGGING_SYMBOLS', 'YES', default='YES'):
+@@ -553,7 +541,6 @@
+       # TODO: Supporting fat binaries will be annoying.
+       self._WarnUnimplemented('ARCHS')
+       archs = ['i386']
+-    cflags.append('-arch ' + archs[0])
+ 
+     if archs[0] in ('i386', 'x86_64'):
+       if self._Test('GCC_ENABLE_SSE3_EXTENSIONS', 'YES', default='NO'):
+@@ -811,7 +798,6 @@
+       # TODO: Supporting fat binaries will be annoying.
+       self._WarnUnimplemented('ARCHS')
+       archs = ['i386']
+-    ldflags.append('-arch ' + archs[0])
+ 
+     # Xcode adds the product directory by default.
+     ldflags.append('-L' + product_dir)
diff --git a/nixpkgs/pkgs/development/python-modules/gyp/no-xcode.patch b/nixpkgs/pkgs/development/python-modules/gyp/no-xcode.patch
new file mode 100644
index 000000000000..d202b7224744
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/gyp/no-xcode.patch
@@ -0,0 +1,12 @@
+--- a/pylib/gyp/xcode_emulation.py
++++ b/pylib/gyp/xcode_emulation.py
+@@ -1470,7 +1470,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 additional_settings:
+     additional_settings = {}