hmcl: init at 3.5.5

This commit is contained in:
Red Star Over Earth 2023-07-31 17:03:00 +08:00
parent 8c028ce6ff
commit b4395db675
No known key found for this signature in database
GPG key ID: A5687C915DEBF98D
2 changed files with 99 additions and 0 deletions

View file

@ -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;
};
})

View file

@ -37407,6 +37407,8 @@ with pkgs;
hikounomizu = callPackage ../games/hikounomizu { }; hikounomizu = callPackage ../games/hikounomizu { };
hmcl = callPackage ../games/hmcl { };
hyperrogue = callPackage ../games/hyperrogue { }; hyperrogue = callPackage ../games/hyperrogue { };
ibmcloud-cli = callPackage ../tools/admin/ibmcloud-cli { stdenv = stdenvNoCC; }; ibmcloud-cli = callPackage ../tools/admin/ibmcloud-cli { stdenv = stdenvNoCC; };