2024-02-07 01:22:34 +00:00
|
|
|
{ lib, fetchzip }:
|
2022-06-26 10:26:21 +00:00
|
|
|
let
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "2.5.0";
|
|
|
|
srcHash = "sha256-tR+suOR09folwZ6qmuaQhGml134L8dcK7ZX8/Pl4xfQ=";
|
2024-02-07 01:22:34 +00:00
|
|
|
# The tarball contains vendored dependencies
|
|
|
|
vendorHash = null;
|
2022-06-26 10:26:21 +00:00
|
|
|
in
|
|
|
|
{
|
2024-02-07 01:22:34 +00:00
|
|
|
inherit version vendorHash;
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/woodpecker-ci/woodpecker/releases/download/v${version}/woodpecker-src.tar.gz";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = srcHash;
|
2024-02-07 01:22:34 +00:00
|
|
|
stripRoot = false;
|
2022-06-26 10:26:21 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
postInstall = ''
|
|
|
|
cd $out/bin
|
2022-06-26 10:26:21 +00:00
|
|
|
for f in *; do
|
2024-02-29 20:09:43 +00:00
|
|
|
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
|
2022-06-26 10:26:21 +00:00
|
|
|
done
|
|
|
|
cd -
|
|
|
|
'';
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2024-02-07 01:22:34 +00:00
|
|
|
"-X go.woodpecker-ci.org/woodpecker/v2/version.Version=${version}"
|
2022-06-26 10:26:21 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://woodpecker-ci.org/";
|
2023-08-22 20:05:09 +00:00
|
|
|
changelog = "https://github.com/woodpecker-ci/woodpecker/blob/v${version}/CHANGELOG.md";
|
2022-06-26 10:26:21 +00:00
|
|
|
license = licenses.asl20;
|
2023-08-10 07:59:29 +00:00
|
|
|
maintainers = with maintainers; [ ambroisie techknowlogick adamcstephens ];
|
2022-06-26 10:26:21 +00:00
|
|
|
};
|
|
|
|
}
|