woodpecker-{agent,cli,server}: 3.0.0 -> 3.0.1
[NixPkgs.git] / pkgs / development / tools / continuous-integration / woodpecker / common.nix
blobf240ead19bd52343585d46d5578b63a036dc98f7
1 { lib, fetchzip }:
2 let
3   version = "3.0.1";
4   srcHash = "sha256-BJHvZhi/jjVH/NZKqGwL2ZiYGxM72EtJ0KTO21IigAY=";
5   # The tarball contains vendored dependencies
6   vendorHash = null;
7 in
9   inherit version vendorHash;
11   src = fetchzip {
12     url = "https://github.com/woodpecker-ci/woodpecker/releases/download/v${version}/woodpecker-src.tar.gz";
13     hash = srcHash;
14     stripRoot = false;
15   };
17   postInstall = ''
18     cd $out/bin
19     for f in *; do
20       if [ "$f" = cli ]; then
21         # Issue a warning to the user if they call the deprecated executable
22         cat >woodpecker << EOF
23     #!/bin/sh
24     echo 'WARNING: calling \`woodpecker\` is deprecated, use \`woodpecker-cli\` instead.' >&2
25     $out/bin/woodpecker-cli "\$@"
26     EOF
27         chmod +x woodpecker
28         patchShebangs woodpecker
29       fi
30         mv -- "$f" "woodpecker-$f"
31     done
32     cd -
33   '';
35   ldflags = [
36     "-s"
37     "-w"
38     "-X go.woodpecker-ci.org/woodpecker/v3/version.Version=${version}"
39   ];
41   meta = with lib; {
42     homepage = "https://woodpecker-ci.org/";
43     changelog = "https://github.com/woodpecker-ci/woodpecker/blob/v${version}/CHANGELOG.md";
44     license = licenses.asl20;
45     maintainers = with maintainers; [
46       ambroisie
47       techknowlogick
48       adamcstephens
49     ];
50   };