1{ stdenv, buildPythonPackage, isPy3k, fetchFromGitHub, substituteAll
2, python, utillinux, pygit2, gitMinimal, git-annex, cacert
3}:
4
5buildPythonPackage rec {
6 pname = "git-annex-adapter";
7 version = "0.2.2";
8
9 disabled = !isPy3k;
10
11 # No tests in PyPI tarball
12 src = fetchFromGitHub {
13 owner = "alpernebbi";
14 repo = pname;
15 rev = "v${version}";
16 sha256 = "0666vqspgnvmfs6j3kifwyxr6zmxjs0wlwis7br4zcq0gk32zgdx";
17 };
18
19 patches = [
20 (substituteAll {
21 src = ./git-annex-path.patch;
22 gitAnnex = "${git-annex}/bin/git-annex";
23 })
24 ];
25
26 checkInputs = [
27 gitMinimal
28 utillinux # `rev` is needed in tests/test_process.py
29 ];
30
31 propagatedBuildInputs = [ pygit2 cacert ];
32
33 checkPhase = ''
34 ${python.interpreter} -m unittest
35 '';
36 pythonImportsCheck = [ "git_annex_adapter" ];
37
38 meta = with stdenv.lib; {
39 homepage = "https://github.com/alpernebbi/git-annex-adapter";
40 description = "Call git-annex commands from Python";
41 license = licenses.gpl3Plus;
42 maintainers = with maintainers; [ dotlambda ];
43 };
44}