aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/python-modules/setuptools
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2020-01-10 20:09:37 +0000
committerKatharina Fey <kookie@spacekookie.de>2020-01-10 20:09:37 +0000
commit45431c078bf8f54aef7c9fae2e5913395ec82c31 (patch)
treefd8ff1346a963ddd72e782421f05b623f9759e2a /nixpkgs/pkgs/development/python-modules/setuptools
parentc86fea6086c212ea489cfb023a5f5c9c8f188810 (diff)
parent3ccbc8d89153ecf13f3eae7d9c106d91cd4ab9e5 (diff)
Merge commit '3ccbc8d89153ecf13f3eae7d9c106d91cd4ab9e5' into fuckthisshit
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/setuptools')
-rw-r--r--nixpkgs/pkgs/development/python-modules/setuptools/default.nix60
1 files changed, 43 insertions, 17 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/setuptools/default.nix b/nixpkgs/pkgs/development/python-modules/setuptools/default.nix
index 569ff017ea9..9254e53d142 100644
--- a/nixpkgs/pkgs/development/python-modules/setuptools/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/setuptools/default.nix
@@ -1,37 +1,63 @@
{ stdenv
, buildPythonPackage
-, fetchPypi
+, fetchFromGitHub
, python
, wrapPython
, unzip
, callPackage
, bootstrapped-pip
+, lib
+, pipInstallHook
+, setuptoolsBuildHook
}:
-buildPythonPackage rec {
+let
pname = "setuptools";
- version = "41.2.0";
- format = "other";
+ version = "41.4.0";
+
+ # Create an sdist of setuptools
+ sdist = stdenv.mkDerivation rec {
+ name = "${pname}-${version}-sdist.tar.gz";
+
+ src = fetchFromGitHub {
+ owner = "pypa";
+ repo = pname;
+ rev = "v${version}";
+ sha256 = "0asxfnsi56r81lm48ynqbfkmm3kvw2jwrlf2l9azn5w6xm30jvp5";
+ name = "${pname}-${version}-source";
+ };
- src = fetchPypi {
- inherit pname version;
- extension = "zip";
- sha256 = "66b86bbae7cc7ac2e867f52dc08a6bd064d938bac59dfec71b9b565dd36d6012";
+ buildPhase = ''
+ ${python.pythonForBuild.interpreter} bootstrap.py
+ ${python.pythonForBuild.interpreter} setup.py sdist --formats=gztar
+ '';
+
+ installPhase = ''
+ echo "Moving sdist..."
+ mv dist/*.tar.gz $out
+ '';
};
+in buildPythonPackage rec {
+ inherit pname version;
+ # Because of bootstrapping we don't use the setuptoolsBuildHook that comes with format="setuptools" directly.
+ # Instead, we override it to remove setuptools to avoid a circular dependency.
+ # The same is done for pip and the pipInstallHook.
+ format = "other";
- # There is nothing to build
- dontBuild = true;
+ src = sdist;
- nativeBuildInputs = [ bootstrapped-pip ];
+ nativeBuildInputs = [
+ bootstrapped-pip
+ (pipInstallHook.override{pip=null;})
+ (setuptoolsBuildHook.override{setuptools=null; wheel=null;})
+ ];
- installPhase = ''
- dst=$out/${python.sitePackages}
- mkdir -p $dst
- export PYTHONPATH="$dst:$PYTHONPATH"
- ${python.pythonForBuild.interpreter} setup.py install --prefix=$out
- wrapPythonPrograms
+ preBuild = lib.strings.optionalString (!stdenv.hostPlatform.isWindows) ''
+ export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
'';
+ pipInstallFlags = [ "--ignore-installed" ];
+
# Adds setuptools to nativeBuildInputs causing infinite recursion.
catchConflicts = false;