1{
2 lib,
3
4 coreutils,
5 fetchFromGitHub,
6 python3Packages,
7 stdenv,
8
9 # nativeCheckInputs
10 debian-devscripts,
11 dpkg,
12 gitMinimal,
13 gitSetupHook,
14 man,
15}:
16
17python3Packages.buildPythonApplication rec {
18 pname = "git-buildpackage";
19 version = "0.9.37";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "agx";
24 repo = "git-buildpackage";
25 tag = "debian/${version}";
26 hash = "sha256-0gfryd1GrVfL11u/IrtLSJAABRsTpFfPOGxWfVdYtgE=";
27 fetchSubmodules = true;
28 };
29
30 postPatch = ''
31 substituteInPlace gbp/command_wrappers.py \
32 --replace-fail "/bin/true" "${lib.getExe' coreutils "true"}" \
33 --replace-fail "/bin/false" "${lib.getExe' coreutils "false"}"
34 '';
35
36 build-system = [
37 python3Packages.setuptools
38 ];
39
40 dependencies = with python3Packages; [
41 python-dateutil
42 ];
43
44 pythonImportsCheck = [
45 "gbp"
46 ];
47
48 nativeCheckInputs = [
49 debian-devscripts
50 dpkg
51 gitMinimal
52 gitSetupHook
53 man
54 ]
55 ++ (with python3Packages; [
56 coverage
57 pytest-cov
58 pytestCheckHook
59 pyyaml
60 rpm
61 ]);
62
63 disabledTests = [
64 # gbp.command_wrappers.CommandExecFailed:
65 # Couldn't commit to 'pristine-tar' with upstream 'upstream':
66 # execution failed: [Errno 2] No such file or directory: 'pristine-tar'
67 "tests.doctests.test_PristineTar.test_pristine_tar"
68
69 # When gitMinimal is used instead of git:
70 # UNEXPECTED EXCEPTION: GitRepositoryError("Invalid git command 'branch': No manual entry for git-branch")
71 "tests.doctests.test_GitRepository.test_repo"
72 ]
73 ++ lib.optionals stdenv.hostPlatform.isDarwin [
74 # gbp.git.repository.GitRepositoryError:
75 # Cannot create Git repository at '/does/not/exist':
76 # [Errno 30] Read-only file system: '/does'
77 "tests.doctests.test_GitRepository.test_create_noperm"
78 ];
79
80 meta = {
81 description = "Suite to help with maintaining Debian packages in Git repositories";
82 homepage = "https://honk.sigxcpu.org/piki/projects/git-buildpackage/";
83 license = lib.licenses.gpl2Only;
84 maintainers = with lib.maintainers; [ nim65s ];
85 mainProgram = "git-buildpackage";
86 };
87}