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