mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
50 lines
1.4 KiB
Nix
50 lines
1.4 KiB
Nix
{ lib, stdenv, fetchurl, makeDesktopItem, SDL2, SDL2_image, SDL2_mixer, SDL2_net }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "${project}-${version}";
|
|
project = "rocksndiamonds";
|
|
version = "4.1.1.0";
|
|
|
|
src = fetchurl {
|
|
url = "https://www.artsoft.org/RELEASES/unix/${project}/${name}.tar.gz";
|
|
sha256 = "1k0m6l5g886d9mwwh6q0gw75qsb85mpf8i0rglh047app56nsk72";
|
|
};
|
|
|
|
desktopItem = makeDesktopItem {
|
|
name = "rocksndiamonds";
|
|
exec = "rocksndiamonds";
|
|
icon = "rocksndiamonds";
|
|
comment = meta.description;
|
|
desktopName = "Rocks'n'Diamonds";
|
|
genericName = "Tile-based puzzle";
|
|
categories = "Game;LogicGame;";
|
|
};
|
|
|
|
buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_net ];
|
|
|
|
preBuild = ''
|
|
dataDir="$out/share/rocksndiamonds"
|
|
makeFlags+="RO_GAME_DIR=$dataDir"
|
|
'';
|
|
|
|
installPhase = ''
|
|
appDir=$out/share/applications
|
|
iconDir=$out/share/icons/hicolor/32x32/apps
|
|
mkdir -p $out/bin $appDir $iconDir $dataDir
|
|
cp rocksndiamonds $out/bin/
|
|
ln -s ${desktopItem}/share/applications/* $appDir/
|
|
ln -s $dataDir/graphics/gfx_classic/RocksIcon32x32.png $iconDir/rocksndiamonds.png
|
|
cp -r docs graphics levels music sounds $dataDir
|
|
'';
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
meta = with lib; {
|
|
description = "Scrolling tile-based arcade style puzzle game";
|
|
homepage = "https://www.artsoft.org/rocksndiamonds/";
|
|
license = licenses.gpl2;
|
|
platforms = platforms.linux;
|
|
maintainers = with maintainers; [ orivej ];
|
|
};
|
|
}
|