mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 17:33:09 +00:00
pypi2nix: 1.6.0 -> 1.8.0
This commit is contained in:
parent
8c8942a5e4
commit
8fcb9275d1
@ -1,23 +1,24 @@
|
|||||||
{ stdenv, fetchurl, python, zip, makeWrapper, nix, nix-prefetch-scripts
|
{ stdenv, fetchurl, pythonPackages, zip, makeWrapper, nix, nix-prefetch-git
|
||||||
|
, nix-prefetch-hg
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
version = "1.6.0";
|
version = "1.8.0";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/garbas/pypi2nix/archive/v${version}.tar.gz";
|
url = "https://github.com/garbas/pypi2nix/archive/v${version}.tar.gz";
|
||||||
sha256 = "08iad1ad2gnvsnd66ddw3lff19ms2yly4iq63c8800j603d0pdhn";
|
sha256 = "133sjx8r1jdb5gi3caawa9m7v496jv4id2c3zqnx8hria22425za";
|
||||||
};
|
};
|
||||||
|
|
||||||
click = fetchurl {
|
click = fetchurl {
|
||||||
url = "https://pypi.python.org/packages/7a/00/c14926d8232b36b08218067bcd5853caefb4737cda3f0a47437151344792/click-6.6.tar.gz";
|
url = "https://pypi.python.org/packages/95/d9/c3336b6b5711c3ab9d1d3a80f1a3e2afeb9d8c02a7166462f6cc96570897/click-6.7.tar.gz";
|
||||||
sha256 = "1sggipyz52crrybwbr9xvwxd4aqigvplf53k9w3ygxmzivd1jsnc";
|
sha256 = "02qkfpykbq35id8glfgwc38yc430427yd05z1wc5cnld8zgicmgi";
|
||||||
};
|
};
|
||||||
|
|
||||||
requests = fetchurl {
|
requests = fetchurl {
|
||||||
url = "https://pypi.python.org/packages/5b/0b/34be574b1ec997247796e5d516f3a6b6509c4e064f2885a96ed885ce7579/requests-2.12.4.tar.gz";
|
url = "https://pypi.python.org/packages/16/09/37b69de7c924d318e51ece1c4ceb679bf93be9d05973bb30c35babd596e2/requests-2.13.0.tar.gz";
|
||||||
sha256 = "0d5fwxmw4ibynk3imph3n4n84m0n3ib1vj339fxhkqri0qd4767d";
|
sha256 = "1s0wg4any4dsv5l3hqjxqk2zgb7pdbqhy9rhc8kh3aigfq4ws8jp";
|
||||||
};
|
};
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
@ -27,7 +28,11 @@ in stdenv.mkDerivation rec {
|
|||||||
click
|
click
|
||||||
requests
|
requests
|
||||||
];
|
];
|
||||||
buildInputs = [ python zip makeWrapper nix.out nix-prefetch-scripts ];
|
buildInputs = [
|
||||||
|
pythonPackages.python pythonPackages.flake8
|
||||||
|
zip makeWrapper nix.out nix-prefetch-git nix-prefetch-hg
|
||||||
|
];
|
||||||
|
|
||||||
sourceRoot = ".";
|
sourceRoot = ".";
|
||||||
|
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
@ -47,13 +52,14 @@ in stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
sed -i -e "s|default='nix-shell',|default='${nix.out}/bin/nix-shell',|" $out/pkgs/pypi2nix/cli.py
|
sed -i -e "s|default='nix-shell',|default='${nix.out}/bin/nix-shell',|" $out/pkgs/pypi2nix/cli.py
|
||||||
sed -i -e "s|nix-prefetch-git|${nix-prefetch-scripts}/bin/nix-prefetch-git|" $out/pkgs/pypi2nix/stage2.py
|
sed -i -e "s|nix-prefetch-git|${nix-prefetch-git}/bin/nix-prefetch-git|" $out/pkgs/pypi2nix/stage2.py
|
||||||
|
sed -i -e "s|nix-prefetch-hg|${nix-prefetch-hg}/bin/nix-prefetch-hg|" $out/pkgs/pypi2nix/stage2.py
|
||||||
'';
|
'';
|
||||||
|
|
||||||
commonPhase = ''
|
commonPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
|
|
||||||
echo "#!${python.interpreter}" > $out/bin/pypi2nix
|
echo "#!${pythonPackages.python.interpreter}" > $out/bin/pypi2nix
|
||||||
echo "import pypi2nix.cli" >> $out/bin/pypi2nix
|
echo "import pypi2nix.cli" >> $out/bin/pypi2nix
|
||||||
echo "pypi2nix.cli.main()" >> $out/bin/pypi2nix
|
echo "pypi2nix.cli.main()" >> $out/bin/pypi2nix
|
||||||
|
|
||||||
@ -62,8 +68,16 @@ in stdenv.mkDerivation rec {
|
|||||||
export PYTHONPATH=$out/pkgs:$PYTHONPATH
|
export PYTHONPATH=$out/pkgs:$PYTHONPATH
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# flake8 doesn't run on python3
|
||||||
|
doCheck = false;
|
||||||
|
checkPhase = ''
|
||||||
|
flake8 ${src}/src
|
||||||
|
'';
|
||||||
|
|
||||||
installPhase = commonPhase + ''
|
installPhase = commonPhase + ''
|
||||||
wrapProgram $out/bin/pypi2nix --prefix PYTHONPATH : "$PYTHONPATH"
|
wrapProgram $out/bin/pypi2nix \
|
||||||
|
--prefix PYTHONPATH : "$PYTHONPATH" \
|
||||||
|
--prefix PATH : "${nix-prefetch-git}/bin:${nix-prefetch-hg}/bin"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
@ -6073,7 +6073,9 @@ with pkgs;
|
|||||||
|
|
||||||
pythonDocs = recurseIntoAttrs (callPackage ../development/interpreters/python/cpython/docs {});
|
pythonDocs = recurseIntoAttrs (callPackage ../development/interpreters/python/cpython/docs {});
|
||||||
|
|
||||||
pypi2nix = callPackage ../development/tools/pypi2nix { python = python35; };
|
pypi2nix = callPackage ../development/tools/pypi2nix {
|
||||||
|
pythonPackages = python3Packages;
|
||||||
|
};
|
||||||
|
|
||||||
svg2tikz = python27Packages.svg2tikz;
|
svg2tikz = python27Packages.svg2tikz;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user