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