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