about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2023-07-31 15:43:23 +0200
committerGitHub <noreply@github.com>2023-07-31 15:43:23 +0200
commite80662ed6d054a7b31edb902007b4882e7895fb9 (patch)
tree1cadf8f2529826717fe60cb3b5d712a5d32cd738
parent1a09204d1925880b86368fee128af51541404c40 (diff)
parentb4395db6756b2872fadbd8060d35a8a2e1f23f5b (diff)
Merge pull request #246317 from rs0vere/hmcl
hmcl: init at 3.5.5
-rw-r--r--maintainers/maintainer-list.nix9
-rw-r--r--pkgs/games/hmcl/default.nix97
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 108 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index c74ec4ef8de5c..47b058227977f 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -14501,6 +14501,15 @@
     }];
     name = "Rahul Butani";
   };
+  rs0vere = {
+    email = "rs0vere@outlook.com";
+    github = "rs0vere";
+    githubId = 140035635;
+    keys = [{
+      fingerprint = "C6D8 B5C2 FA79 901B DCCF  95E1 FEC4 5C5A ED00 C58D";
+    }];
+    name = "Red Star Over Earth";
+  };
   rski = {
     name = "rski";
     email = "rom.skiad+nix@gmail.com";
diff --git a/pkgs/games/hmcl/default.nix b/pkgs/games/hmcl/default.nix
new file mode 100644
index 0000000000000..f6ded13dc0f4c
--- /dev/null
+++ b/pkgs/games/hmcl/default.nix
@@ -0,0 +1,97 @@
+{ lib
+, stdenv
+, fetchurl
+, makeBinaryWrapper
+, makeDesktopItem
+, wrapGAppsHook
+, copyDesktopItems
+, imagemagick
+, jre
+, xorg
+, libGL
+, glfw
+, openal
+, libglvnd
+, alsa-lib
+, wayland
+, libpulseaudio
+}:
+
+let
+  version = "3.5.5";
+  icon = fetchurl {
+    url = "https://github.com/huanghongxun/HMCL/raw/release-${version}/HMCLauncher/HMCL/HMCL.ico";
+    hash = "sha256-MWp78rP4b39Scz5/gpsjwaJhSu+K9q3S2B2cD/V31MA=";
+  };
+in
+stdenv.mkDerivation (finalAttrs: {
+  pname = "hmcl";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://github.com/huanghongxun/HMCL/releases/download/release-${version}/HMCL-${version}.jar";
+    hash = "sha256-bXZF38pd8I8cReuDNrZzDj1hp1Crk+P26JNiikUCg4g=";
+  };
+
+  dontUnpack = true;
+
+  dontWrapGApps = true;
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "HMCL";
+      exec = "hmcl";
+      icon = "hmcl";
+      comment = finalAttrs.meta.description;
+      desktopName = "HMCL";
+      categories = [ "Game" ];
+    })
+  ];
+
+  nativeBuildInputs = [
+    makeBinaryWrapper
+    wrapGAppsHook
+    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
+    '';
+
+  meta = with lib; {
+    homepage = "https://hmcl.huangyuhui.net";
+    description = "A Minecraft Launcher which is multi-functional, cross-platform and popular";
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ rs0vere ];
+    inherit (jre.meta) platforms;
+  };
+})
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e7a37d22b1379..982e1b9a7d351 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -37413,6 +37413,8 @@ with pkgs;
 
   hikounomizu = callPackage ../games/hikounomizu { };
 
+  hmcl = callPackage ../games/hmcl { };
+
   hyperrogue = callPackage ../games/hyperrogue { };
 
   ibmcloud-cli = callPackage ../tools/admin/ibmcloud-cli { stdenv = stdenvNoCC; };