diff options
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/tools/pipenv')
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/tools/pipenv/default.nix | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/pipenv/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/pipenv/default.nix new file mode 100644 index 000000000000..2eff05b04ea7 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/tools/pipenv/default.nix @@ -0,0 +1,54 @@ +{ lib +, python3 +}: + +with python3.pkgs; + +let + + runtimeDeps = ps: with ps; [ + certifi + setuptools + pip + virtualenv + virtualenv-clone + ]; + + pythonEnv = python3.withPackages runtimeDeps; + +in buildPythonApplication rec { + pname = "pipenv"; + version = "2020.11.15"; + + src = fetchPypi { + inherit pname version; + sha256 = "8253fe6f9cfb3791a54da8a0571f73c918cb3457dd908684c1800a13a06ec4c1"; + }; + + LC_ALL = "en_US.UTF-8"; + + postPatch = '' + # pipenv invokes python in a subprocess to create a virtualenv + # and to call setup.py. + # It would use sys.executable, which in our case points to a python that + # does not have the required dependencies. + substituteInPlace pipenv/core.py \ + --replace "sys.executable" "'${pythonEnv.interpreter}'" + ''; + + propagatedBuildInputs = runtimeDeps python3.pkgs; + + doCheck = true; + checkPhase = '' + export HOME=$(mktemp -d) + cp -r --no-preserve=mode ${wheel.src} $HOME/wheel-src + $out/bin/pipenv install $HOME/wheel-src + ''; + + meta = with lib; { + description = "Python Development Workflow for Humans"; + license = licenses.mit; + platforms = platforms.all; + maintainers = with maintainers; [ berdario ]; + }; +} |