fluffychat: 1.22.1 -> 1.23.0 (#364091)
[NixPkgs.git] / pkgs / by-name / to / toolbox / package.nix
blobcb2b136ab9c06acc366487d9c23e61d5915489ec
2   lib,
3   buildGoModule,
4   fetchFromGitHub,
5   glibc,
6   go-md2man,
7   installShellFiles,
8 }:
10 buildGoModule rec {
11   pname = "toolbox";
12   version = "0.0.99.3";
14   src = fetchFromGitHub {
15     owner = "containers";
16     repo = pname;
17     rev = version;
18     hash = "sha256-9HiWgEtaMypLOwXJ6Xg3grLSZOQ4NInZtcvLPV51YO8=";
19   };
21   patches = [ ./glibc.patch ];
23   vendorHash = "sha256-k79TcC9voQROpJnyZ0RsqxJnBT83W5Z+D+D3HnuQGsI=";
25   postPatch = ''
26     substituteInPlace src/cmd/create.go --subst-var-by glibc ${glibc}
27   '';
29   modRoot = "src";
31   nativeBuildInputs = [
32     go-md2man
33     installShellFiles
34   ];
36   ldflags = [
37     "-s"
38     "-w"
39     "-X github.com/containers/toolbox/pkg/version.currentVersion=${version}"
40   ];
42   preCheck = "export PATH=$GOPATH/bin:$PATH";
44   postInstall = ''
45     cd ..
46     for d in doc/*.md; do
47       go-md2man -in $d -out ''${d%.md}
48     done
49     installManPage doc/*.[1-9]
50     installShellCompletion --bash completion/bash/toolbox
51     install profile.d/toolbox.sh -Dt $out/share/profile.d
52   '';
54   meta = with lib; {
55     homepage = "https://containertoolbx.org";
56     changelog = "https://github.com/containers/toolbox/releases/tag/${version}";
57     description = "Tool for containerized command line environments on Linux";
58     license = licenses.asl20;
59     maintainers = with maintainers; [ urandom ];
60     mainProgram = "toolbox";
61   };