nix: use .desktop file provided by cmake

This commit is contained in:
Mustafa Çalışkan 2022-01-29 17:38:12 +03:00
parent 7df5091fdc
commit b710b719a8
No known key found for this signature in database
GPG Key ID: 65A4189BDDE655E0

View File

@ -1,7 +1,6 @@
{ lib { lib
, mkDerivation , mkDerivation
, fetchFromGitHub , fetchFromGitHub
, makeDesktopItem
, cmake , cmake
, ninja , ninja
, jdk8 , jdk8
@ -73,27 +72,11 @@ mkDerivation rec {
"-DLauncher_LAYOUT=lin-system" "-DLauncher_LAYOUT=lin-system"
]; ];
desktopItem = makeDesktopItem {
name = "polymc";
exec = "polymc";
icon = "polymc";
desktopName = "PolyMC";
genericName = "Minecraft Launcher";
comment = "A custom launcher for Minecraft";
categories = "Game;";
extraEntries = ''
Keywords=game;Minecraft;
'';
};
postInstall = '' postInstall = ''
install -Dm644 ../launcher/resources/multimc/scalable/launcher.svg $out/share/pixmaps/polymc.svg
install -Dm644 ${desktopItem}/share/applications/polymc.desktop $out/share/applications/org.polymc.polymc.desktop
# xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128 # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
wrapProgram $out/bin/polymc \ wrapProgram $out/bin/polymc \
"''${qtWrapperArgs[@]}" \ "''${qtWrapperArgs[@]}" \
--set GAME_LIBRARY_PATH ${gameLibraryPath} \ --set GAME_LIBRARY_PATH ${gameLibraryPath} \
--prefix PATH : ${lib.makeBinPath [ xorg.xrandr jdk ]} --prefix PATH : ${lib.makeBinPath [ xorg.xrandr ]}
''; '';
} }