biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / continuous-integration / woodpecker / common.nix
blob214e1c35b276247770ee04d43fbc8fc5c003e6f1
1 { lib, fetchzip }:
2 let
3   version = "2.4.1";
4   srcHash = "sha256-03y0xLXgdvw1NAtH2FDW91wp13ohimqjz3kl2mWc11E=";
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         mv -- "$f" "woodpecker"
22         # Issue a warning to the user if they call the deprecated executable
23         cat >woodpecker-cli << EOF
24     #/bin/sh
25     echo 'WARNING: calling `woodpecker-cli` is deprecated, use `woodpecker` instead.' >&2
26     $out/bin/woodpecker "\$@"
27     EOF
28         chmod +x woodpecker-cli
29         patchShebangs woodpecker-cli
30       else
31         mv -- "$f" "woodpecker-$f"
32       fi
33     done
34     cd -
35   '';
37   ldflags = [
38     "-s"
39     "-w"
40     "-X go.woodpecker-ci.org/woodpecker/v2/version.Version=${version}"
41   ];
43   meta = with lib; {
44     homepage = "https://woodpecker-ci.org/";
45     changelog = "https://github.com/woodpecker-ci/woodpecker/blob/v${version}/CHANGELOG.md";
46     license = licenses.asl20;
47     maintainers = with maintainers; [ ambroisie techknowlogick adamcstephens ];
48   };