nixpkgs/pkgs/development/tools/continuous-integration/woodpecker/common.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2023-11-13 22:45:18 +00:00
{ lib, fetchzip }:
let
2024-11-27 10:00:08 +00:00
version = "2.7.3";
srcHash = "sha256-ut5F2KZlWkJeAiLv2z9WmSoUoXxbzCXCgmZiwtX0f+U=";
2023-11-13 22:45:18 +00:00
# The tarball contains vendored dependencies
vendorHash = null;
in
{
2023-11-13 22:45:18 +00:00
inherit version vendorHash;
2023-11-13 22:45:18 +00:00
src = fetchzip {
url = "https://github.com/woodpecker-ci/woodpecker/releases/download/v${version}/woodpecker-src.tar.gz";
hash = srcHash;
2023-11-13 22:45:18 +00:00
stripRoot = false;
};
2023-07-30 13:40:17 +01:00
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"
2023-11-13 22:45:18 +00:00
"-X go.woodpecker-ci.org/woodpecker/v2/version.Version=${version}"
];
meta = with lib; {
homepage = "https://woodpecker-ci.org/";
2023-08-16 16:27:10 +01:00
changelog = "https://github.com/woodpecker-ci/woodpecker/blob/v${version}/CHANGELOG.md";
license = licenses.asl20;
maintainers = with maintainers; [ ambroisie techknowlogick adamcstephens ];
};
}