From b52596ca68a1c73bd115cb8570aa978df30f5bd1 Mon Sep 17 00:00:00 2001 From: linsui Date: Sat, 20 Aug 2022 19:39:39 +0800 Subject: [PATCH] jabref: add gtk3 --- pkgs/applications/office/jabref/default.nix | 22 ++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/office/jabref/default.nix b/pkgs/applications/office/jabref/default.nix index 8d3fffb709b4..fe481d3f51b4 100644 --- a/pkgs/applications/office/jabref/default.nix +++ b/pkgs/applications/office/jabref/default.nix @@ -1,11 +1,12 @@ { lib , stdenv , fetchFromGitHub -, makeWrapper +, wrapGAppsHook , makeDesktopItem , copyDesktopItems , unzip , xdg-utils +, gtk3 , jdk , gradle , perl @@ -78,11 +79,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ jdk gradle - makeWrapper + wrapGAppsHook copyDesktopItems unzip ]; + buildInputs = [ gtk3 ]; + buildPhase = '' runHook preBuild @@ -118,17 +121,22 @@ stdenv.mkDerivation rec { 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/ - wrapProgram $out/bin/JabRef \ - --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" - # 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";