From 61b94f0dd06cac0f7dcd38cce80f2a7ab8376098 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Fri, 12 Aug 2022 22:53:53 +0300 Subject: 2022-08-12 --- packages/ultimmc.nix | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 packages/ultimmc.nix (limited to 'packages/ultimmc.nix') diff --git a/packages/ultimmc.nix b/packages/ultimmc.nix new file mode 100644 index 0000000..e90d5bd --- /dev/null +++ b/packages/ultimmc.nix @@ -0,0 +1,63 @@ +{ + cmake, + fetchFromGitHub, + jdk, + makeDesktopItem, + qtbase, + stdenv, + wrapQtAppsHook, + zlib, +}: +stdenv.mkDerivation rec { + pname = "UltimMC"; + version = "unstable-2022-06-09"; + + src = fetchFromGitHub { + owner = "UltimMC"; + repo = "Launcher"; + rev = "b7c9b27ed6fb047da7fab5e4cee99b298b9e9811"; + hash = "sha256-xmkflvtOSLMTuzAKovgOLjgpbR8j53bkGV3QZRsQItw="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [cmake jdk wrapQtAppsHook]; + + buildInputs = [qtbase zlib]; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace 'LIBRARY_DEST_DIR "bin"' 'LIBRARY_DEST_DIR "lib"' \ + --replace 'JARS_DEST_DIR "bin/jars"' 'JARS_DEST_DIR "share/${pname}/jar"' + + substituteInPlace launcher/Application.cpp \ + --replace '"jars"' '"../share/${pname}/jar"'; + ''; + + cmakeFlags = ["-DCMAKE_BUILD_TYPE=Release"]; + + desktopItem = makeDesktopItem { + name = pname; + exec = pname; + icon = pname; + desktopName = pname; + genericName = "Custom Minecraft launcher"; + categories = ["Game"]; + }; + + dontWrapQtApps = true; + + postInstall = '' + rm $out/${pname} + + wrapProgram $out/bin/${pname} \ + --add-flags "--dir \''${XDG_DATA_HOME:-~/.local/share}/${pname}" \ + "''${qtWrapperArgs[@]}" + + install -Dm644 \ + ${desktopItem}/share/applications/${pname}.desktop \ + $out/share/applications/${pname}.desktop + install -Dm644 \ + $src/notsecrets/logo.svg \ + $out/share/icons/hicolor/scalable/apps/${pname}.svg + ''; +} -- cgit 1.4.1