anchor.diff:  { lib
   , stdenv
   , fetchFromGitHub
  -, makeWrapper
  +, wrapGAppsHook
   , makeDesktopItem
   , copyDesktopItems
   , unzip
   , xdg-utils
  +, gtk3
   , jdk
   , gradle
   , perl
  
positive.code:   nativeBuildInputs = [
      jdk
      gradle
      makeWrapper
      copyDesktopItems
      unzip
    ];
  
    buildPhase = ''
      runHook preBuild
  
negative.code:     tar xf build/distributions/JabRef-${version}.tar -C $out --strip-components=1
      unzip $out/lib/javafx-web-18-linux${lib.optionalString stdenv.isAarch64 "-aarch64"}.jar libjfxwebkit.so -d $out/lib/
  
      # lowercase alias (for convenience and required for browser extensions)
      ln -sf $out/bin/JabRef $out/bin/jabref
  
      rm $out/bin/JabRef.bat
  
      runHook postInstall
    '';
  
    preFixup = ''
      gappsWrapperArgs+=(
        --suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
        --set JAVA_HOME "${jdk}"
        --set JAVA_OPTS "-Djava.library.path=$out/lib/ --patch-module org.jabref=$out/share/java/jabref/resources/main"
      )
    '';
  
    meta = with lib; {
  