about summary refs log tree commit diff
path: root/pkgs/games/hmcl
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games/hmcl')
-rw-r--r--pkgs/games/hmcl/default.nix85
1 files changed, 47 insertions, 38 deletions
diff --git a/pkgs/games/hmcl/default.nix b/pkgs/games/hmcl/default.nix
index 95a40f0a8d809..3ac7b9a96cdac 100644
--- a/pkgs/games/hmcl/default.nix
+++ b/pkgs/games/hmcl/default.nix
@@ -1,9 +1,8 @@
 { lib
 , stdenv
 , fetchurl
-, makeBinaryWrapper
 , makeDesktopItem
-, wrapGAppsHook
+, wrapGAppsHook3
 , copyDesktopItems
 , imagemagick
 , jre
@@ -15,13 +14,14 @@
 , alsa-lib
 , wayland
 , libpulseaudio
+, gobject-introspection
 }:
 
 let
-  version = "3.5.5";
+  version = "3.5.8";
   icon = fetchurl {
     url = "https://github.com/huanghongxun/HMCL/raw/release-${version}/HMCLauncher/HMCL/HMCL.ico";
-    hash = "sha256-MWp78rP4b39Scz5/gpsjwaJhSu+K9q3S2B2cD/V31MA=";
+    hash = "sha256-+EYL33VAzKHOMp9iXoJaSGZfv+ymDDYIx6i/1o47Dmc=";
   };
 in
 stdenv.mkDerivation (finalAttrs: {
@@ -30,7 +30,7 @@ stdenv.mkDerivation (finalAttrs: {
 
   src = fetchurl {
     url = "https://github.com/huanghongxun/HMCL/releases/download/release-${version}/HMCL-${version}.jar";
-    hash = "sha256-bXZF38pd8I8cReuDNrZzDj1hp1Crk+P26JNiikUCg4g=";
+    hash = "sha256-HRTXJhKtRB+pANMAZ9R1kNsSbl/Rr6a8wMhfaPeD/40=";
   };
 
   dontUnpack = true;
@@ -49,42 +49,51 @@ stdenv.mkDerivation (finalAttrs: {
   ];
 
   nativeBuildInputs = [
-    makeBinaryWrapper
-    wrapGAppsHook
+    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.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";
@@ -92,7 +101,7 @@ stdenv.mkDerivation (finalAttrs: {
     mainProgram = "hmcl";
     sourceProvenance = with sourceTypes; [ binaryBytecode ];
     license = licenses.gpl3Only;
-    maintainers = with maintainers; [ ];
+    maintainers = with maintainers; [ daru-san ];
     inherit (jre.meta) platforms;
   };
 })