Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7 fetchpatch,
8}:
9
10buildGoModule rec {
11 pname = "bob";
12 version = "0.8.2";
13
14 src = fetchFromGitHub {
15 owner = "benchkram";
16 repo = "bob";
17 rev = version;
18 hash = "sha256-zmWfOLBb+GWw9v6LdCC7/WaP1Wz7UipPwqkmI1+rG8Q=";
19 };
20
21 patches = [
22 # Fix vulnerable dependencies
23 # Backport of https://github.com/benchkram/bob/pull/387
24 (fetchpatch {
25 url = "https://github.com/benchkram/bob/commit/5020e6fafbfbcb1b3add5d936886423ce882793d.patch";
26 hash = "sha256-if1ZErI0Un7d26eOkYSkEa87+VTRcEtF6JbsJYOHpHE=";
27 })
28 ];
29
30 ldflags = [
31 "-s"
32 "-w"
33 "-X main.Version=${version}"
34 ];
35
36 vendorHash = "sha256-u0nFaTQWU9O7A/RAhGaLcBka+YNGjSlpycDF8TLQALw=";
37
38 excludedPackages = [
39 "example/server-db"
40 "test/e2e"
41 "tui-example"
42 ];
43
44 nativeBuildInputs = [ installShellFiles ];
45
46 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
47 installShellCompletion --cmd bob \
48 --bash <($out/bin/bob completion) \
49 --zsh <($out/bin/bob completion -z)
50 '';
51
52 # tests require network access
53 doCheck = false;
54
55 meta = with lib; {
56 description = "Build system for microservices";
57 mainProgram = "bob";
58 homepage = "https://bob.build";
59 license = licenses.asl20;
60 maintainers = with maintainers; [ zuzuleinen ];
61 };
62}