anchor.diff:      tar xvf ./build/distributions/signald.tar --strip-components=1 --directory $out/
       wrapProgram $out/bin/signald \
         --prefix PATH : ${lib.makeBinPath [ coreutils ]} \
  -      --set JAVA_HOME "${jre_headless}"
  +      --set JAVA_HOME "${jdk17_headless}"
   
       runHook postInstall
     '';
  
positive.code:     sha256 = "0y1f42y7ilm3ykgnm6s3ks54d71n8lsy5649xgd9ahv28lj05x9f";
    };
  
    postPatch = ''
      patchShebangs gradlew
      sed -i -e 's|BuildConfig.jar|${buildConfigJar}|' build.gradle
    '';
  
    # fake build to pre-download deps into fixed-output derivation
    deps = stdenv.mkDerivation {
      name = "${pname}-deps";
      inherit src version postPatch;
      nativeBuildInputs = [ gradle_6 perl ];
      buildPhase = ''
        export GRADLE_USER_HOME=$(mktemp -d)
  
negative.code:     outputHashMode = "recursive";
      # Downloaded jars differ by platform
      outputHash = {
        x86_64-linux = "gEaOOsELhfKC1cFV8tqRHbBUI6+M/cDOaqN8FQ1J/TE=";
        aarch64-linux = "UhnQ+Ge48/NdTqUWIxd0VNadHFvQ9awBTtn65Nz3+UM=";
      }.${stdenv.system} or (throw "Unsupported platform");
    };
  
  in stdenv.mkDerivation rec {
    inherit pname src version;
  
    patches = [ ./gradle-plugin.patch ];
  
    postPatch = ''
      sed -i 's|BuildConfig.jar|${buildConfigJar}|' build.gradle
    '';
  
    buildPhase = ''
      runHook preBuild
  