summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoréclairevoyant <848000+eclairevoyant@users.noreply.github.com>2024-06-20 23:35:52 -0400
committeréclairevoyant <848000+eclairevoyant@users.noreply.github.com>2024-06-20 23:51:00 -0400
commitc3424ad0257b98172c8daebc3465c1f01d802e73 (patch)
tree1bd5495544ff129250c88957f54bd21f9a2b5c19
parent3ed0e6824c1a677493e86904a9f7472fcef5b46a (diff)
hmcl: fix gtk wrapping
-rw-r--r--pkgs/games/hmcl/default.nix73
1 files changed, 41 insertions, 32 deletions
diff --git a/pkgs/games/hmcl/default.nix b/pkgs/games/hmcl/default.nix
index 2ff06a19219d..3ac7b9a96cda 100644
--- a/pkgs/games/hmcl/default.nix
+++ b/pkgs/games/hmcl/default.nix
@@ -1,7 +1,6 @@
{ lib
, stdenv
, fetchurl
-, makeBinaryWrapper
, makeDesktopItem
, wrapGAppsHook3
, copyDesktopItems
@@ -15,6 +14,7 @@
, alsa-lib
, wayland
, libpulseaudio
+, gobject-introspection
}:
let
@@ -49,42 +49,51 @@ stdenv.mkDerivation (finalAttrs: {
];
nativeBuildInputs = [
- makeBinaryWrapper
+ gobject-introspection
wrapGAppsHook3
copyDesktopItems
imagemagick
];
- installPhase =
- let
- libpath = lib.makeLibraryPath ([
- libGL
- glfw
- openal
- libglvnd
- ] ++ lib.optionals stdenv.isLinux [
- xorg.libX11
- xorg.libXxf86vm
- xorg.libXext
- xorg.libXcursor
- xorg.libXrandr
- xorg.libXtst
- libpulseaudio
- wayland
- alsa-lib
- ]);
- in
- ''
- 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 \
- --add-flags "-jar $out/lib/hmcl/hmcl.jar" \
- --set LD_LIBRARY_PATH ${libpath}
- runHook postInstall
- '';
+ 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
+ libpath = lib.makeLibraryPath ([
+ libGL
+ glfw
+ openal
+ libglvnd
+ ] ++ lib.optionals stdenv.isLinux [
+ xorg.libX11
+ xorg.libXxf86vm
+ xorg.libXext
+ xorg.libXcursor
+ xorg.libXrandr
+ xorg.libXtst
+ libpulseaudio
+ wayland
+ alsa-lib
+ ]);
+ 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; {
homepage = "https://hmcl.huangyuhui.net";