diff options
author | linsui <linsui555@gmail.com> | 2022-09-23 12:51:12 +0800 |
---|---|---|
committer | linsui <linsui555@gmail.com> | 2022-09-23 12:51:26 +0800 |
commit | 79833127caf9f94006418c758fb9b51ef773c9b9 (patch) | |
tree | 01f9c5d9150b744be6ffcac3015869acce129e41 /pkgs/applications/office/jabref/default.nix | |
parent | e14f9fb57315f0d4abde222364f19f88c77d2b79 (diff) |
jabref: 5.6 -> 5.7
Diffstat (limited to 'pkgs/applications/office/jabref/default.nix')
-rw-r--r-- | pkgs/applications/office/jabref/default.nix | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/pkgs/applications/office/jabref/default.nix b/pkgs/applications/office/jabref/default.nix index fe481d3f51b44..a7b5a39d72f6b 100644 --- a/pkgs/applications/office/jabref/default.nix +++ b/pkgs/applications/office/jabref/default.nix @@ -13,25 +13,27 @@ }: stdenv.mkDerivation rec { - version = "5.6"; + version = "5.7"; pname = "jabref"; src = fetchFromGitHub { owner = "JabRef"; repo = "jabref"; rev = "v${version}"; - hash = "sha256-w3F1td7KmdSor/2vKar3w17bChe1yH7JMobOaCjZqd4="; + hash = "sha256-wzBaAaxGsMPh64uW+bBOiycYfVCW9H5FCn06r6XdxeE="; }; desktopItems = [ (makeDesktopItem { comment = meta.description; - name = "jabref"; + name = "JabRef %U"; desktopName = "JabRef"; genericName = "Bibliography manager"; categories = [ "Office" ]; icon = "jabref"; - exec = "jabref"; + exec = "JabRef"; + startupWMClass = "org.jabref.gui.JabRefMain"; + mimeTypes = [ "text/x-bibtex" ]; }) ]; @@ -39,12 +41,6 @@ stdenv.mkDerivation rec { 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) @@ -60,8 +56,8 @@ stdenv.mkDerivation rec { forceShare = [ "dummy" ]; outputHashMode = "recursive"; outputHash = { - x86_64-linux = "sha256-ySGXZM9LCJUjGCrKMc+5I6duEbmSsp3tU3t/o5nM+5M="; - aarch64-linux = "sha256-mfWyGGBqjRQ8q9ddR57O2rwtby2T1H6Ra2m0JGVZ1Zs="; + x86_64-linux = "sha256-OicHJVFxHGPE76bEDoLhkEhVcAJmplqjoh2I3nnVaLA="; + aarch64-linux = "sha256-8QWmweptL/+pSO6DhfBLaLcBrfKd4TDsDoXs4TgXvew="; }.${stdenv.hostPlatform.system} or (throw "Unsupported system ${stdenv.hostPlatform.system}"); }; @@ -95,11 +91,14 @@ stdenv.mkDerivation rec { --no-daemon \ -PprojVersion="${version}" \ -PprojVersionInfo="${version} NixOS" \ + -Dorg.gradle.java.home=${jdk} \ assemble runHook postBuild ''; + dontWrapGApps = true; + installPhase = '' runHook preInstall @@ -109,8 +108,6 @@ stdenv.mkDerivation rec { # 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 @@ -119,31 +116,30 @@ stdenv.mkDerivation rec { # 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/ + unzip $out/lib/javafx-web-*-linux${lib.optionalString stdenv.isAarch64 "-aarch64"}.jar libjfxwebkit.so -d $out/lib/ + + DEFAULT_JVM_OPTS=$(sed -n -E "s/^DEFAULT_JVM_OPTS='(.*)'$/\1/p" $out/bin/JabRef | sed -e "s|\$APP_HOME|$out|g" -e 's/"//g') + rm $out/bin/* + + makeWrapper ${jdk}/bin/java $out/bin/JabRef \ + "''${gappsWrapperArgs[@]}" \ + --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \ + --add-flags "-Djava.library.path=$out/lib/ --patch-module org.jabref=$out/share/java/jabref/resources/main" \ + --add-flags "$DEFAULT_JVM_OPTS" # 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; { description = "Open source bibliography reference manager"; homepage = "https://www.jabref.org"; sourceProvenance = with sourceTypes; [ fromSource - binaryBytecode # source bundles dependencies as jars - binaryNativeCode # source bundles dependencies as jars + binaryBytecode # source bundles dependencies as jars + binaryNativeCode # source bundles dependencies as jars ]; license = licenses.gpl2; platforms = [ "x86_64-linux" "aarch64-linux" ]; |