python.pkgs.git-annex-adapter: use patch to hardcode git-annex path

This commit is contained in:
Robert Schütz
2019-02-20 15:05:16 +01:00
parent 5e3bdbedd3
commit c1b7deab9f
2 changed files with 86 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
{ stdenv, buildPythonPackage, isPy3k, fetchFromGitHub, fetchpatch
, utillinux, pygit2, gitMinimal, git-annex
{ stdenv, buildPythonPackage, isPy3k, fetchFromGitHub, substituteAll
, python, utillinux, pygit2, gitMinimal, git-annex
}:
buildPythonPackage rec {
@@ -16,22 +16,22 @@ buildPythonPackage rec {
sha256 = "146q1jhcfc7f96ajkhjffskkljk2xzivs5ih5clb8qx0sh7mj097";
};
prePatch = ''
substituteInPlace git_annex_adapter/process.py \
--replace "'git', 'annex'" "'${git-annex}/bin/git-annex'" \
--replace "'git-annex'" "'${git-annex}/bin/git-annex'"
'';
patches = [
(substituteAll {
src = ./git-annex-path.patch;
gitAnnex = "${git-annex}/bin/git-annex";
})
];
checkInputs = [
gitMinimal
utillinux # `rev` is needed in tests/test_process.py
];
propagatedBuildInputs = [ pygit2 gitMinimal ];
buildInputs = [ git-annex ];
propagatedBuildInputs = [ pygit2 ];
checkPhase = ''
python -m unittest
${python.interpreter} -m unittest
'';
meta = with stdenv.lib; {