hmcl: fix gtk wrapping

(cherry picked from commit c3424ad025)
This commit is contained in:
éclairevoyant 2024-06-20 23:35:52 -04:00 committed by github-actions[bot]
parent 72d3497807
commit 9c8856a534

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,42 +49,51 @@ stdenv.mkDerivation (finalAttrs: {
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
makeBinaryWrapper gobject-introspection
wrapGAppsHook3 wrapGAppsHook3
copyDesktopItems copyDesktopItems
imagemagick imagemagick
]; ];
installPhase = installPhase = ''
let runHook preInstall
libpath = lib.makeLibraryPath ([
libGL mkdir -p $out/{bin,lib/hmcl}
glfw cp $src $out/lib/hmcl/hmcl.jar
openal magick ${icon} hmcl.png
libglvnd install -Dm644 hmcl-1.png $out/share/icons/hicolor/32x32/apps/hmcl.png
] ++ lib.optionals stdenv.isLinux [
xorg.libX11 runHook postInstall
xorg.libXxf86vm '';
xorg.libXext
xorg.libXcursor fixupPhase =
xorg.libXrandr let
xorg.libXtst libpath = lib.makeLibraryPath ([
libpulseaudio libGL
wayland glfw
alsa-lib openal
]); libglvnd
in ] ++ lib.optionals stdenv.isLinux [
'' xorg.libX11
runHook preInstall xorg.libXxf86vm
mkdir -p $out/{bin,lib/hmcl} xorg.libXext
cp $src $out/lib/hmcl/hmcl.jar xorg.libXcursor
magick ${icon} hmcl.png xorg.libXrandr
install -Dm644 hmcl-1.png $out/share/icons/hicolor/32x32/apps/hmcl.png xorg.libXtst
makeBinaryWrapper ${jre}/bin/java $out/bin/hmcl \ libpulseaudio
--add-flags "-jar $out/lib/hmcl/hmcl.jar" \ wayland
--set LD_LIBRARY_PATH ${libpath} alsa-lib
runHook postInstall ]);
''; in ''
runHook preFixup
makeBinaryWrapper ${jre}/bin/java $out/bin/hmcl \
--add-flags "-jar $out/lib/hmcl/hmcl.jar" \
--set LD_LIBRARY_PATH ${libpath} \
''${gappsWrapperArgs[@]}
runHook postFixup
'';
meta = with lib; { meta = with lib; {
homepage = "https://hmcl.huangyuhui.net"; homepage = "https://hmcl.huangyuhui.net";