2021-02-05 17:12:51 +00:00
|
|
|
{ lib, buildPythonPackage, isPy3k, fetchFromGitHub, fetchpatch, substituteAll
|
2020-11-24 20:58:05 +00:00
|
|
|
, python, util-linux, pygit2, gitMinimal, git-annex, cacert
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "git-annex-adapter";
|
2020-10-07 09:15:18 +00:00
|
|
|
version = "0.2.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
# No tests in PyPI tarball
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alpernebbi";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-10-07 09:15:18 +00:00
|
|
|
sha256 = "0666vqspgnvmfs6j3kifwyxr6zmxjs0wlwis7br4zcq0gk32zgdx";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-02-05 17:12:51 +00:00
|
|
|
# fix tests with recent versions of git-annex
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/alpernebbi/git-annex-adapter/commit/6c210d828e8a57b12c716339ad1bf15c31cd4a55.patch";
|
|
|
|
sha256 = "17kp7pnm9svq9av4q7hfic95xa1w3z02dnr8nmg14sjck2rlmqsi";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./git-annex-path.patch;
|
|
|
|
gitAnnex = "${git-annex}/bin/git-annex";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
gitMinimal
|
2020-11-24 20:58:05 +00:00
|
|
|
util-linux # `rev` is needed in tests/test_process.py
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
propagatedBuildInputs = [ pygit2 cacert ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest
|
|
|
|
'';
|
2020-10-07 09:15:18 +00:00
|
|
|
pythonImportsCheck = [ "git_annex_adapter" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/alpernebbi/git-annex-adapter";
|
|
|
|
description = "Call git-annex commands from Python";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|