jabref: add gtk3

This commit is contained in:
linsui 2022-08-20 19:39:39 +08:00
parent 8793b8bfdc
commit b52596ca68

View file

@ -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";