Merge pull request #321409 from eclairevoyant/hmcl

hmcl: fix gtk wrapping
This commit is contained in:
Artturin 2024-06-22 00:38:10 +03:00 committed by GitHub
commit 637319bb0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,6 @@
{ lib { lib
, stdenv , stdenv
, fetchurl , fetchurl
, makeBinaryWrapper
, makeDesktopItem , makeDesktopItem
, wrapGAppsHook3 , wrapGAppsHook3
, copyDesktopItems , copyDesktopItems
@ -15,6 +14,7 @@
, alsa-lib , alsa-lib
, wayland , wayland
, libpulseaudio , libpulseaudio
, gobject-introspection
}: }:
let let
@ -49,13 +49,24 @@ stdenv.mkDerivation (finalAttrs: {
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
makeBinaryWrapper gobject-introspection
wrapGAppsHook3 wrapGAppsHook3
copyDesktopItems copyDesktopItems
imagemagick imagemagick
]; ];
installPhase = installPhase = ''
runHook preInstall
mkdir -p $out/{bin,lib/hmcl}
cp $src $out/lib/hmcl/hmcl.jar
magick ${icon} hmcl.png
install -Dm644 hmcl-1.png $out/share/icons/hicolor/32x32/apps/hmcl.png
runHook postInstall
'';
fixupPhase =
let let
libpath = lib.makeLibraryPath ([ libpath = lib.makeLibraryPath ([
libGL libGL
@ -73,17 +84,15 @@ stdenv.mkDerivation (finalAttrs: {
wayland wayland
alsa-lib alsa-lib
]); ]);
in in ''
'' runHook preFixup
runHook preInstall
mkdir -p $out/{bin,lib/hmcl}
cp $src $out/lib/hmcl/hmcl.jar
magick ${icon} hmcl.png
install -Dm644 hmcl-1.png $out/share/icons/hicolor/32x32/apps/hmcl.png
makeBinaryWrapper ${jre}/bin/java $out/bin/hmcl \ makeBinaryWrapper ${jre}/bin/java $out/bin/hmcl \
--add-flags "-jar $out/lib/hmcl/hmcl.jar" \ --add-flags "-jar $out/lib/hmcl/hmcl.jar" \
--set LD_LIBRARY_PATH ${libpath} --set LD_LIBRARY_PATH ${libpath} \
runHook postInstall ''${gappsWrapperArgs[@]}
runHook postFixup
''; '';
meta = with lib; { meta = with lib; {