summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ap/aptly/package.nix
blob: dfbd7332551bac9ff0f1ee96a200ab4fda21e274 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
  lib,
  buildGoModule,
  fetchFromGitHub,
  installShellFiles,
  makeWrapper,
  gnupg,
  bzip2,
  xz,
  graphviz,
  testers,
  aptly,
}:

buildGoModule (finalAttrs: {
  pname = "aptly";
  version = "1.6.3";

  src = fetchFromGitHub {
    owner = "aptly-dev";
    repo = "aptly";
    tag = "v${finalAttrs.version}";
    hash = "sha256-fjNN8EffY9G8YX/uME5ehs2zZj/YRA62y/muqigWSnE=";
  };

  vendorHash = "sha256-QPYKdiEiV1iS3xJ3A66ILUXAlj0TGXuGf11wzdX3Z7Y=";

  nativeBuildInputs = [
    installShellFiles
    makeWrapper
  ];

  ldflags = [
    "-s"
    "-w"
  ];

  preBuild = ''
    echo ${finalAttrs.version} > VERSION
  '';
  excludedPackages = [
    "system"
  ];

  postInstall = ''
    installShellCompletion --bash --name aptly completion.d/aptly
    installShellCompletion --zsh --name _aptly completion.d/_aptly
    wrapProgram $out/bin/aptly \
      --prefix PATH : ${
        lib.makeBinPath [
          gnupg
          bzip2
          xz
          graphviz
        ]
      }
  '';

  doCheck = false;

  passthru.tests.version = testers.testVersion {
    package = aptly;
    command = "aptly version";
  };

  meta = {
    homepage = "https://www.aptly.info";
    description = "Debian repository management tool";
    license = lib.licenses.mit;
    changelog = "https://github.com/aptly-dev/aptly/releases/tag/v${finalAttrs.version}";
    maintainers = with lib.maintainers; [
      cdepillabout
      montag451
      wraithm
    ];
    mainProgram = "aptly";
  };
})