classicube: use makeDesktopItem

authored by

360ied and committed by
Rick van Schijndel
23579912 52519fd1

+17 -14
+17 -14
pkgs/games/classicube/default.nix
··· 3 , fetchFromGitHub 4 , dos2unix 5 , makeWrapper 6 , SDL2 7 , libGL 8 , curl ··· 21 sha256 = "sha256-m7pg9OL2RuCVKgFD3hMtIeY0XdJ1YviXBFVJH8/T5gI="; 22 }; 23 24 - nativeBuildInputs = [ dos2unix makeWrapper ]; 25 26 prePatch = '' 27 # The ClassiCube sources have DOS-style newlines ··· 77 --run 'mkdir -p "$HOME/.local/share/ClassiCube"' \ 78 --run 'cd "$HOME/.local/share/ClassiCube"' 79 runHook postInstall 80 - ''; 81 82 - postInstall = '' 83 - mkdir -p "$out/share/applications" "$out/share/resources" 84 - cp 'misc/CCicon.png' "$out/share/resources" 85 - cat >"$out/share/applications/ClassiCube.desktop" <<EOF 86 - [Desktop Entry] 87 - Type = Application 88 - Exec = "$out/bin/ClassiCube" 89 - Icon = "$out/share/resources/CCicon.png" 90 - Name = ClassiCube 91 - GenericName = Sandbox Block Game 92 - Categories = ["Game"] 93 - EOF 94 ''; 95 96 meta = with lib; {
··· 3 , fetchFromGitHub 4 , dos2unix 5 , makeWrapper 6 + , makeDesktopItem 7 + , copyDesktopItems 8 , SDL2 9 , libGL 10 , curl ··· 23 sha256 = "sha256-m7pg9OL2RuCVKgFD3hMtIeY0XdJ1YviXBFVJH8/T5gI="; 24 }; 25 26 + nativeBuildInputs = [ dos2unix makeWrapper copyDesktopItems ]; 27 + 28 + desktopItems = [ 29 + (makeDesktopItem { 30 + name = pname; 31 + desktopName = pname; 32 + genericName = "Sandbox Block Game"; 33 + exec = "ClassiCube"; 34 + icon = "CCicon"; 35 + comment = "Minecraft Classic inspired sandbox game"; 36 + categories = [ "Game" ]; 37 + }) 38 + ]; 39 40 prePatch = '' 41 # The ClassiCube sources have DOS-style newlines ··· 91 --run 'mkdir -p "$HOME/.local/share/ClassiCube"' \ 92 --run 'cd "$HOME/.local/share/ClassiCube"' 93 runHook postInstall 94 95 + mkdir -p "$out/share/icons/hicolor/256x256/apps" 96 + cp misc/CCicon.png "$out/share/icons/hicolor/256x256/apps" 97 ''; 98 99 meta = with lib; {