diff options
author | Domen Kožar <domen@dev.si> | 2016-03-24 15:44:14 +0000 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2016-03-24 15:44:34 +0000 |
commit | 9c274b4bef10f7e535ce5bf72f0259e7c0d76c93 (patch) | |
tree | 23c4b3b528bd04f940cb507f3741e3b889f00536 | |
parent | 7acb89da8dbd8bc481c90ea1e6582a86c89eb0e8 (diff) | |
download | nixlib-9c274b4bef10f7e535ce5bf72f0259e7c0d76c93.tar nixlib-9c274b4bef10f7e535ce5bf72f0259e7c0d76c93.tar.gz nixlib-9c274b4bef10f7e535ce5bf72f0259e7c0d76c93.tar.bz2 nixlib-9c274b4bef10f7e535ce5bf72f0259e7c0d76c93.tar.lz nixlib-9c274b4bef10f7e535ce5bf72f0259e7c0d76c93.tar.xz nixlib-9c274b4bef10f7e535ce5bf72f0259e7c0d76c93.tar.zst nixlib-9c274b4bef10f7e535ce5bf72f0259e7c0d76c93.zip |
bootstrapped-pip: support Python 2.6
-rw-r--r-- | pkgs/development/python-modules/bootstrapped-pip/default.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/bootstrapped-pip/default.nix b/pkgs/development/python-modules/bootstrapped-pip/default.nix index c0e5ae0ec774..c53a2fd24778 100644 --- a/pkgs/development/python-modules/bootstrapped-pip/default.nix +++ b/pkgs/development/python-modules/bootstrapped-pip/default.nix @@ -9,6 +9,10 @@ let url = "https://pypi.python.org/packages/3.5/s/setuptools/setuptools-19.4-py2.py3-none-any.whl"; sha256 = "0801e6d862ca4ce24d918420d62f07ee2fe736dc016e3afa99d2103e7a02e9a6"; }; + argparse_source = fetchurl { + url = "https://pypi.python.org/packages/2.7/a/argparse/argparse-1.4.0-py2.py3-none-any.whl"; + sha256 = "0533cr5w14da8wdb2q4py6aizvbvsdbk3sj7m1jx9lwznvnlf5n3"; + }; in stdenv.mkDerivation rec { name = "python-${python.version}-bootstrapped-pip-${version}"; version = "8.0.2"; @@ -23,8 +27,11 @@ in stdenv.mkDerivation rec { unzip -d $out/${python.sitePackages} $src unzip -d $out/${python.sitePackages} ${setuptools_source} unzip -d $out/${python.sitePackages} ${wheel_source} + '' + stdenv.lib.optionalString (python.isPy26 or false) '' + unzip -d $out/${python.sitePackages} ${argparse_source} ''; + patchPhase = '' mkdir -p $out/bin ''; @@ -34,7 +41,9 @@ in stdenv.mkDerivation rec { installPhase = '' # install pip binary - echo '${python.interpreter} -m pip "$@"' > $out/bin/pip + echo '#!${python.interpreter}' > $out/bin/pip + echo 'import sys;from pip import main' >> $out/bin/pip + echo 'sys.exit(main())' >> $out/bin/pip chmod +x $out/bin/pip # wrap binaries with PYTHONPATH |