nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

rocksndiamonds: modernize

Signed-off-by: Marcin Serwin <marcin@serwin.dev>

+26 -28
+26 -28
pkgs/by-name/ro/rocksndiamonds/package.nix
··· 3 3 stdenv, 4 4 fetchurl, 5 5 makeDesktopItem, 6 + copyDesktopItems, 6 7 SDL2, 7 8 SDL2_image, 8 9 SDL2_mixer, ··· 11 10 zlib, 12 11 }: 13 12 14 - stdenv.mkDerivation rec { 13 + stdenv.mkDerivation (finalAttrs: { 15 14 pname = "rocksndiamonds"; 16 15 version = "4.4.0.5"; 17 16 18 17 src = fetchurl { 19 - url = "https://www.artsoft.org/RELEASES/linux/${pname}/${pname}-${version}-linux.tar.gz"; 18 + url = "https://www.artsoft.org/RELEASES/linux/rocksndiamonds/rocksndiamonds-${finalAttrs.version}-linux.tar.gz"; 20 19 hash = "sha256-8e6ZYpFoUQ4+ykHDLlKWWyUANPq1lXv7IRHYWfBOU/U="; 21 20 }; 22 21 23 - desktopItem = makeDesktopItem { 24 - name = "rocksndiamonds"; 25 - exec = "rocksndiamonds"; 26 - icon = "rocksndiamonds"; 27 - comment = meta.description; 28 - desktopName = "Rocks'n'Diamonds"; 29 - genericName = "Tile-based puzzle"; 30 - categories = [ 31 - "Game" 32 - "LogicGame" 33 - ]; 34 - }; 22 + desktopItems = [ 23 + (makeDesktopItem { 24 + name = "rocksndiamonds"; 25 + exec = finalAttrs.meta.mainProgram; 26 + icon = "rocksndiamonds"; 27 + comment = finalAttrs.meta.description; 28 + desktopName = "Rocks'n'Diamonds"; 29 + genericName = "Tile-based puzzle"; 30 + categories = [ 31 + "Game" 32 + "LogicGame" 33 + ]; 34 + }) 35 + ]; 35 36 36 37 strictDeps = true; 37 38 38 39 nativeBuildInputs = [ 39 40 SDL2 # sdl2-config 41 + copyDesktopItems 40 42 ]; 41 43 buildInputs = [ 42 44 SDL2 ··· 50 46 ]; 51 47 52 48 preConfigure = '' 53 - makeFlagsArray+=("CC=$CC" "AR=$AR" "RANLIB=$RANLIB") 54 - ''; 55 - 56 - preBuild = '' 57 - dataDir="$out/share/rocksndiamonds" 58 - appendToVar makeFlags "BASE_PATH=$dataDir" 49 + dataDir=$out/share/rocksndiamonds 50 + makeFlagsArray+=("CC=$CC" "AR=$AR" "RANLIB=$RANLIB" "BASE_PATH=$dataDir") 59 51 ''; 60 52 61 53 installPhase = '' 62 54 runHook preInstall 63 55 64 - appDir=$out/share/applications 65 56 iconDir=$out/share/icons/hicolor/32x32/apps 66 - mkdir -p $out/bin $appDir $iconDir $dataDir 57 + mkdir -p $out/bin $iconDir $dataDir 67 58 cp rocksndiamonds $out/bin/ 68 - ln -s ${desktopItem}/share/applications/* $appDir/ 69 59 ln -s $dataDir/graphics/gfx_classic/icons/icon.png $iconDir/rocksndiamonds.png 70 60 cp -r conf docs graphics levels music sounds $dataDir 71 61 ··· 70 72 # ranlib: game_bd.a: error reading bd_caveengine.o: file truncated 71 73 enableParallelBuilding = false; 72 74 73 - meta = with lib; { 75 + meta = { 74 76 description = "Scrolling tile-based arcade style puzzle game"; 75 77 mainProgram = "rocksndiamonds"; 76 78 homepage = "https://www.artsoft.org/rocksndiamonds/"; 77 - license = licenses.gpl2Only; 78 - platforms = platforms.linux; 79 - maintainers = with maintainers; [ orivej ]; 79 + license = lib.licenses.gpl2Only; 80 + platforms = lib.platforms.linux; 81 + maintainers = with lib.maintainers; [ orivej ]; 80 82 }; 81 - } 83 + })