]> git.scottworley.com Git - pinch/blob - default.nix
7744281ae0afb0fe74fe58f1c1a7e62f1e583b66
[pinch] / default.nix
1 { pkgs ? import <nixpkgs> { }, lint ? false }:
2
3 let
4
5 git-cache-fallback = { buildPythonPackage, fetchgit, git, backoff, mypy, }:
6 buildPythonPackage rec {
7 pname = "git-cache";
8 version = "1.4.2";
9 src = fetchgit {
10 url = "https://git.scottworley.com/pub/git/git-cache";
11 rev = "v${version}";
12 hash = "sha256-Z9daNCmjzaVdeG3mITRWdNM+ewUEcKy5N4/Xpdotsg0=";
13 };
14 propagatedBuildInputs = [ backoff ];
15 checkInputs = [ git mypy ];
16 doCheck = true;
17 checkPhase = "./test.sh";
18 };
19
20 in pkgs.python3Packages.callPackage ({ lib, buildPythonPackage, nix_2_3, git
21 , autopep8, makeWrapper, mypy, pylint, git-cache, }:
22 buildPythonPackage rec {
23 pname = "pinch";
24 version = "3.0.10";
25 src = lib.cleanSource ./.;
26 buildInputs = [ makeWrapper ];
27 propagatedBuildInputs = [ git-cache ];
28 checkInputs = [ nix_2_3 git mypy ] ++ lib.optionals lint [ autopep8 pylint ];
29 postInstall = ''
30 wrapProgram "$out/bin/pinch" --prefix PATH : ${nix_2_3}/bin
31 '';
32 doCheck = true;
33 checkPhase = "./test.sh";
34 }) {
35 git-cache =
36 pkgs.python3Packages.git-cache or (pkgs.python3Packages.callPackage
37 git-cache-fallback { });
38 nix_2_3 = pkgs.nix_2_3 or pkgs.nix;
39 }