Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, stdenv
3, buildGoModule
4, fetchFromGitHub
5, go-md2man
6, installShellFiles
7, pkg-config
8, gpgme
9, lvm2
10, btrfs-progs
11, libapparmor
12, libselinux
13, libseccomp
14, testers
15, buildah
16}:
17
18buildGoModule rec {
19 pname = "buildah";
20 version = "1.30.0";
21
22 src = fetchFromGitHub {
23 owner = "containers";
24 repo = "buildah";
25 rev = "v${version}";
26 hash = "sha256-h0fipw3lJKy+VkGkh1XbZ6wUOg4001uURoJpjNq7QOs=";
27 };
28
29 outputs = [ "out" "man" ];
30
31 vendorHash = null;
32
33 doCheck = false;
34
35 nativeBuildInputs = [ go-md2man installShellFiles pkg-config ];
36
37 buildInputs = [
38 gpgme
39 ] ++ lib.optionals stdenv.isLinux [
40 btrfs-progs
41 libapparmor
42 libseccomp
43 libselinux
44 lvm2
45 ];
46
47 buildPhase = ''
48 runHook preBuild
49 patchShebangs .
50 make bin/buildah
51 make -C docs GOMD2MAN="go-md2man"
52 runHook postBuild
53 '';
54
55 installPhase = ''
56 runHook preInstall
57 install -Dm755 bin/buildah $out/bin/buildah
58 installShellCompletion --bash contrib/completions/bash/buildah
59 make -C docs install PREFIX="$man"
60 runHook postInstall
61 '';
62
63 passthru.tests.version = testers.testVersion {
64 package = buildah;
65 };
66
67 meta = with lib; {
68 description = "A tool which facilitates building OCI images";
69 homepage = "https://buildah.io/";
70 changelog = "https://github.com/containers/buildah/releases/tag/v${version}";
71 license = licenses.asl20;
72 maintainers = with maintainers; [ Profpatsch ] ++ teams.podman.members;
73 };
74}