mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-02 07:31:26 +00:00
pypi2nix: new release
This commit is contained in:
parent
e965e42dc5
commit
9cd896367a
72
pkgs/development/tools/pypi2nix/default.nix
Normal file
72
pkgs/development/tools/pypi2nix/default.nix
Normal file
@ -0,0 +1,72 @@
|
||||
{ stdenv, fetchurl, python, zip, makeWrapper
|
||||
}:
|
||||
|
||||
let
|
||||
deps = import ./deps.nix { inherit fetchurl; };
|
||||
version = "1.0.0";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/garbas/pypi2nix/archive/v${version}.tar.gz";
|
||||
sha256 = "1rbwkmsllg8wxv45xyvc3vh97na0zxxydcfqrvig496xkylvw2rn";
|
||||
|
||||
};
|
||||
in stdenv.mkDerivation rec {
|
||||
name = "pypi2nix-${version}";
|
||||
srcs = with deps; [ src pip click setuptools zcbuildout zcrecipeegg ];
|
||||
buildInputs = [ python zip makeWrapper ];
|
||||
sourceRoot = ".";
|
||||
|
||||
postUnpack = ''
|
||||
mkdir -p $out/pkgs
|
||||
|
||||
mv pip-*/pip $out/pkgs/pip
|
||||
mv click-*/click $out/pkgs/click
|
||||
mv setuptools-*/setuptools $out/pkgs/setuptools
|
||||
mv zc.buildout-*/src/zc $out/pkgs/zc
|
||||
mv zc.recipe.egg-*/src/zc/recipe $out/pkgs/zc/recipe
|
||||
|
||||
if [ "$IN_NIX_SHELL" != "1" ]; then
|
||||
if [ -e git-export ]; then
|
||||
mv git-export/src/pypi2nix $out/pkgs/pypi2nix
|
||||
else
|
||||
mv pypi2nix*/src/pypi2nix $out/pkgs/pypi2nix
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
|
||||
commonPhase = ''
|
||||
mkdir -p $out/bin
|
||||
|
||||
echo "#!${python}/bin/python" > $out/bin/pypi2nix
|
||||
echo "import pypi2nix.cli" >> $out/bin/pypi2nix
|
||||
echo "pypi2nix.cli.main()" >> $out/bin/pypi2nix
|
||||
|
||||
chmod +x $out/bin/pypi2nix
|
||||
|
||||
export PYTHONPATH=$out/pkgs:$PYTHONPATH
|
||||
'';
|
||||
|
||||
installPhase = commonPhase + ''
|
||||
wrapProgram $out/bin/pypi2nix --prefix PYTHONPATH : "$PYTHONPATH"
|
||||
'';
|
||||
|
||||
shellHook = ''
|
||||
export home=`pwd`
|
||||
export out=/tmp/`pwd | md5sum | cut -f 1 -d " "`-$name
|
||||
|
||||
rm -rf $out
|
||||
mkdir -p $out
|
||||
|
||||
cd $out
|
||||
runHook unpackPhase
|
||||
runHook commonPhase
|
||||
cd $home
|
||||
|
||||
export PATH=$out/bin:$PATH
|
||||
export PYTHONPATH=`pwd`/src:$PYTHONPATH
|
||||
'';
|
||||
meta = {
|
||||
homepage = https://github.com/garbas/pypi2nix;
|
||||
description = "A tool that generates nix expressions for your python packages, so you don't have to.";
|
||||
maintainers = with stdenv.lib.maintainers; [ garbas ];
|
||||
};
|
||||
}
|
68
pkgs/development/tools/pypi2nix/deps.nix
Normal file
68
pkgs/development/tools/pypi2nix/deps.nix
Normal file
@ -0,0 +1,68 @@
|
||||
{ fetchurl
|
||||
#, pypi_url ? "https://files.pythonhosted.org/packages"
|
||||
, pypi_url ? "https://pypi.io/packages/source/packages"
|
||||
}:
|
||||
|
||||
rec {
|
||||
|
||||
pipVersion = "8.1.1";
|
||||
pipHash = "6b86f11841e89c8241d689956ba99ed7";
|
||||
pipWhlHash = "22db7b6a517a09c29d54a76650f170eb";
|
||||
|
||||
setuptoolsVersion = "21.0.0";
|
||||
setuptoolsHash = "81964fdb89534118707742e6d1a1ddb4";
|
||||
setuptoolsWhlHash = "6027400d6870a7dad29952b7d2dfdc7b";
|
||||
|
||||
zcbuildoutVersion = "2.5.1";
|
||||
zcbuildoutHash = "c88947a3c021ee1509a331c4fa9be187";
|
||||
|
||||
zcrecipeeggVersion = "2.0.3";
|
||||
zcrecipeeggHash = "69a8ce276029390a36008150444aa0b4";
|
||||
|
||||
wheelVersion = "0.29.0";
|
||||
wheelHash = "555a67e4507cedee23a0deb9651e452f";
|
||||
|
||||
clickVersion = "6.6";
|
||||
clickHash = "d0b09582123605220ad6977175f3e51d";
|
||||
|
||||
pipWhl = fetchurl {
|
||||
url = "https://pypi.python.org/packages/31/6a/0f19a7edef6c8e5065f4346137cc2a08e22e141942d66af2e1e72d851462/pip-${pipVersion}-py2.py3-none-any.whl";
|
||||
md5 = pipWhlHash;
|
||||
};
|
||||
|
||||
setuptoolsWhl = fetchurl {
|
||||
url = "https://pypi.python.org/packages/15/b7/a76624e5a3b18c8c1c8d33a5240b34cdabb08aef2da44b536a8b53ba1a45/setuptools-${setuptoolsVersion}-py2.py3-none-any.whl";
|
||||
md5 = setuptoolsWhlHash;
|
||||
};
|
||||
|
||||
pip = fetchurl {
|
||||
url = "${pypi_url}/source/p/pip/pip-${pipVersion}.tar.gz";
|
||||
md5 = pipHash;
|
||||
};
|
||||
|
||||
setuptools = fetchurl {
|
||||
url = "${pypi_url}/source/s/setuptools/setuptools-${setuptoolsVersion}.tar.gz";
|
||||
md5 = setuptoolsHash;
|
||||
};
|
||||
|
||||
zcbuildout = fetchurl {
|
||||
url = "${pypi_url}/source/z/zc.buildout/zc.buildout-${zcbuildoutVersion}.tar.gz";
|
||||
md5 = zcbuildoutHash;
|
||||
};
|
||||
|
||||
zcrecipeegg = fetchurl {
|
||||
url = "${pypi_url}/source/z/zc.recipe.egg/zc.recipe.egg-${zcrecipeeggVersion}.tar.gz";
|
||||
md5 = zcrecipeeggHash;
|
||||
};
|
||||
|
||||
wheel = fetchurl {
|
||||
url = "${pypi_url}/source/w/wheel/wheel-${wheelVersion}.tar.gz";
|
||||
md5 = wheelHash;
|
||||
};
|
||||
|
||||
click = fetchurl {
|
||||
url = "${pypi_url}/source/c/click/click-${clickVersion}.tar.gz";
|
||||
md5 = clickHash;
|
||||
};
|
||||
|
||||
}
|
@ -5593,7 +5593,7 @@ in
|
||||
|
||||
pythonDocs = recurseIntoAttrs (callPackage ../development/interpreters/python/docs {});
|
||||
|
||||
pypi2nix = python27Packages.pypi2nix;
|
||||
pypi2nix = callPackage ../development/tools/pypi2nix { python = python27; };
|
||||
|
||||
svg2tikz = python27Packages.svg2tikz;
|
||||
|
||||
|
@ -25060,26 +25060,6 @@ in modules // {
|
||||
retry_decorator pkgs.pyopenssl socksipy-branch crcmod ];
|
||||
};
|
||||
|
||||
pypi2nix = self.buildPythonPackage rec {
|
||||
rev = "04a68d8577acbceb88bdf51b1231a9dbdead7003";
|
||||
name = "pypi2nix-1.0_${rev}";
|
||||
disabled = ! isPy27;
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/garbas/pypi2nix/tarball/${rev}";
|
||||
name = "${name}.tar.bz";
|
||||
sha256 = "1fv85x2bz442iyxsvka2g75zibjcq48gp2fc7szaqcfqxq42syy9";
|
||||
};
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
homepage = https://github.com/garbas/pypi2nix;
|
||||
description = "";
|
||||
maintainers = with maintainers; [ garbas ];
|
||||
};
|
||||
};
|
||||
|
||||
svg2tikz = self.buildPythonPackage {
|
||||
name = "svg2tikz-1.0.0";
|
||||
disabled = ! isPy27;
|
||||
|
Loading…
Reference in New Issue
Block a user