about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/interpreters/python/build-python-package-setuptools.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/python/build-python-package-setuptools.nix')
-rw-r--r--nixpkgs/pkgs/development/interpreters/python/build-python-package-setuptools.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/python/build-python-package-setuptools.nix b/nixpkgs/pkgs/development/interpreters/python/build-python-package-setuptools.nix
index 4c66fdec5f6b..7738ea2f66a5 100644
--- a/nixpkgs/pkgs/development/interpreters/python/build-python-package-setuptools.nix
+++ b/nixpkgs/pkgs/development/interpreters/python/build-python-package-setuptools.nix
@@ -5,9 +5,11 @@
 }:
 
 {
-# passed to "python setup.py build_ext"
+# Global options passed to "python setup.py"
+  setupPyGlobalFlags ? []
+# Build options passed to "python setup.py build_ext"
 # https://github.com/pypa/pip/issues/881
-  setupPyBuildFlags ? []
+, setupPyBuildFlags ? []
 # Execute before shell hook
 , preShellHook ? ""
 # Execute after shell hook
@@ -19,13 +21,16 @@ let
   # pip does the same thing: https://github.com/pypa/pip/pull/3265
   setuppy = ./run_setup.py;
 
+  setupPyGlobalFlagsString = lib.concatStringsSep " " setupPyGlobalFlags;
+  setupPyBuildExtString = lib.optionalString (setupPyBuildFlags != []) ("build_ext " + (lib.concatStringsSep " " setupPyBuildFlags));
+
 in attrs // {
   # we copy nix_run_setup over so it's executed relative to the root of the source
   # many project make that assumption
   buildPhase = attrs.buildPhase or ''
     runHook preBuild
     cp ${setuppy} nix_run_setup
-    ${python.pythonForBuild.interpreter} nix_run_setup ${lib.optionalString (setupPyBuildFlags != []) ("build_ext " + (lib.concatStringsSep " " setupPyBuildFlags))} bdist_wheel
+    ${python.pythonForBuild.interpreter} nix_run_setup ${setupPyGlobalFlagsString} ${setupPyBuildExtString} bdist_wheel
     runHook postBuild
   '';