Change:
<del> { lib, stdenv, fetchurl, makeWrapper, makeDesktopItem, wrapGAppsHook, gtk3, gsettings-desktop-schemas , zlib , libX11, libXext, libXi, libXrender, libXtst, libGL, alsa-lib, cairo, freetype, pango, gdk-pixbuf, glib }: </del> <ins> { lib , stdenv , fetchFromGitHub , makeWrapper , makeDesktopItem , copyDesktopItems , unzip , xdg-utils , jdk , gradle , perl }: </ins> stdenv.mkDerivation rec { <del> version = "5.5"; </del> <ins> version = "5.6"; </ins> pname = "jabref"; <del> src = fetchurl { url = "https://github.com/JabRef/jabref/releases/download/v${version}/JabRef-${version}-portable_linux.tar.gz"; sha256 = "sha256-9MHNehyAmu7CiBp1rgb4zTkSqmjXm2tcmiGKFBFapKI="; </del> <ins> src = fetchFromGitHub { owner = "JabRef"; repo = "jabref"; rev = "v${version}"; hash = "sha256-w3F1td7KmdSor/2vKar3w17bChe1yH7JMobOaCjZqd4="; </ins> }; <del> preferLocalBuild = true; </del> <ins> desktopItems = [ (makeDesktopItem { comment = meta.description; name = "jabref"; desktopName = "JabRef"; genericName = "Bibliography manager"; categories = [ "Office" ]; icon = "jabref"; exec = "jabref"; }) ]; </ins> <del> desktopItem = makeDesktopItem { comment =  meta.description; name = "jabref"; desktopName = "JabRef"; genericName = "Bibliography manager"; categories = [ "Office" ]; icon = "jabref"; exec = "jabref"; </del> <ins> deps = stdenv.mkDerivation { pname = "${pname}-deps"; inherit src version; postPatch = '' sed -i -e '/testImplementation/d' -e '/testRuntimeOnly/d' build.gradle echo 'dependencyLocking { lockAllConfigurations() }' >> build.gradle cp ${./gradle.lockfile} ./ ''; nativeBuildInputs = [ gradle perl ]; buildPhase = '' export GRADLE_USER_HOME=$(mktemp -d) gradle --no-daemon downloadDependencies ''; # perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar) installPhase = '' find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*.(jar|pom)'  | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/s]+))$# ($x = $2) =~ tr|.|/|; "install -Dm444 $1 $out/$x/$3/$4/''${($5 =~ s/-jvm//r)}" #e'  | sh ''; # Don't move info to share/ forceShare = [ "dummy" ]; outputHashMode = "recursive"; outputHash = { x86_64-linux = "sha256-ySGXZM9LCJUjGCrKMc+5I6duEbmSsp3tU3t/o5nM+5M="; aarch64-linux = "sha256-mfWyGGBqjRQ8q9ddR57O2rwtby2T1H6Ra2m0JGVZ1Zs="; }.${stdenv.hostPlatform.system} or (throw "Unsupported system ${stdenv.hostPlatform.system}"); </ins> }; <del> nativeBuildInputs = [ makeWrapper wrapGAppsHook ]; buildInputs = [ gsettings-desktop-schemas ] ++ systemLibs; </del> <ins> preBuild = '' # Include CSL styles and locales in our build cp -r buildres/csl/* src/main/resources/ # Use the local packages from -deps sed -i -e '/repositories {/a maven { url uri("${deps}") }'  build.gradle  buildSrc/build.gradle  settings.gradle ''; nativeBuildInputs = [ jdk gradle makeWrapper copyDesktopItems unzip ]; buildPhase = '' runHook preBuild </ins> <del> systemLibs = [ gtk3 zlib libX11 libXext libXi libXrender libXtst libGL alsa-lib cairo freetype pango gdk-pixbuf glib ]; systemLibPaths = lib.makeLibraryPath systemLibs; </del> <ins> export GRADLE_USER_HOME=$(mktemp -d) gradle  --offline  --no-daemon  -PprojVersion="${version}"  -PprojVersionInfo="${version} NixOS"  assemble runHook postBuild ''; </ins> installPhase = '' <del> mkdir -p $out/share/java $out/share/icons </del> <ins> runHook preInstall </ins> <del> cp -r lib $out/lib </del> <ins> install -dm755 $out/share/java/jabref install -Dm644 LICENSE.md $out/share/licenses/jabref/LICENSE.md install -Dm644 src/main/resources/icons/jabref.svg $out/share/pixmaps/jabref.svg </ins> <del> for f in $out/lib/runtime/bin/j*; do patchelf  --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)"  --set-rpath "${ lib.makeLibraryPath [ zlib ]}:$out/lib/runtime/lib:$out/lib/runtime/lib/server" $f done </del> <ins> # script to support browser extensions install -Dm755 buildres/linux/jabrefHost.py $out/lib/jabrefHost.py # This can be removed in the next version sed -i -e "/importBibtex/s/{}/'{}'/" $out/lib/jabrefHost.py install -Dm644 buildres/linux/native-messaging-host/firefox/org.jabref.jabref.json $out/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json sed -i -e "s|/opt/jabref|$out|" $out/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json </ins> <del> for f in $out/lib/runtime/lib/*.so; do patchelf  --set-rpath "${systemLibPaths}:$out/lib/runtime/lib:$out/lib/runtime/lib/server" $f done </del> <ins> # Resources in the jar can't be found, workaround copied from AUR cp -r build/resources $out/share/java/jabref </ins> <del> # patching the libs in the JImage runtime image is quite impossible as there is no documented way # of rebuilding the image after it has been extracted # the image format itself is "intendedly not documented" - maybe one of the reasons the # devolpers constantly broke "jimage recreate" and dropped it in OpenJDK 9 Build 116 Early Access # so, for now just copy the image and provide our lib paths through the wrapper </del> <ins> # workaround for https://github.com/NixOS/nixpkgs/issues/162064 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/ </ins> <del> makeWrapper $out/lib/runtime/bin/java $out/bin/jabref  --add-flags '-Djava.library.path=${systemLibPaths}' --add-flags "-p $out/lib/app -m org.jabref/org.jabref.JabRefLauncher"  --prefix LD_LIBRARY_PATH : '${systemLibPaths}' </del> <ins> wrapProgram $out/bin/JabRef  --prefix 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" </ins> <del> cp -r ${desktopItem}/share/applications $out/share/ </del> <ins> # lowercase alias (for convenience and required for browser extensions) ln -sf $out/bin/JabRef $out/bin/jabref </ins> <del> # we still need to unpack the runtime image to get the icon mkdir unpacked $out/lib/runtime/bin/jimage extract --dir=./unpacked lib/runtime/lib/modules cp unpacked/org.jabref/icons/jabref.svg $out/share/icons/jabref.svg </del> <ins> runHook postInstall </ins> ''; meta = with lib; { <del> broken = (stdenv.isLinux && stdenv.isAarch64); </del> description = "Open source bibliography reference manager"; homepage = "https://www.jabref.org"; <del> sourceProvenance = with sourceTypes; [ binaryNativeCode ]; </del> <ins> sourceProvenance = with sourceTypes; [ fromSource binaryBytecode  # source bundles dependencies as jars binaryNativeCode  # source bundles dependencies as jars ]; </ins> license = licenses.gpl2; <del> platforms = platforms.unix; maintainers = [ maintainers.gebner ]; </del> <ins> platforms = [ "x86_64-linux" "aarch64-linux" ]; maintainers = with maintainers; [ gebner linsui ]; </ins> }; }

Discussion:
<!-- Note that these are hard requirements --<!-- You can use the "Go to file" functionality on github to find the package Then you can go to the history for this package Find the latest "packagename: oldversion -newversion" commit The "newversion" is the the current version of the package --- <!-- Type the name of your package and try to find an open pull request for the package If you find an open pull request, you can review it! There's a high chance that you'll have the new version right away while helping the community! --- name: jabref <!-- The current version can be found easily with the same process than above for checking the master branch If an open PR is present for the package, take this version as the current one and link to the PR --current version: 5.1 desired version: 5.3 <!-- Search your package here: If no maintainer is listed for your package, tag the person that last updated the package --maintainers: This is not a trivial change, both 5.2 and 5.3 give when run (after building 'successfully'). See also: , , , and This appears to be an issue which needs to be resolved otherwise jabref may end up stuck on 5.1 on NixOS. Jabref continues to have incremental fixes and new features: Thanks for your efforts so far with jabref on NixOS. Please tag this issue in your PR.
perhaps try changing it to build from the source with gradle use ripgrep to find other packages that use gradle in nixpkgs
I marked this as stale due to inactivity. &rarr;