Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, fetchzip }: 2let 3 version = "3.8.0"; 4 srcHash = "sha256-vU8lyWnXU2KnayZ863MMTMOc1/AkQ6p+uNiJOFqDNJk="; 5 # The tarball contains vendored dependencies 6 vendorHash = null; 7in 8{ 9 inherit version vendorHash; 10 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 }; 16 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 ''; 34 35 ldflags = [ 36 "-s" 37 "-w" 38 "-X go.woodpecker-ci.org/woodpecker/v3/version.Version=${version}" 39 ]; 40 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 }; 51}