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