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
52 lines
1.3 KiB
Nix
52 lines
1.3 KiB
Nix
{ lib, stdenv, fetchFromGitHub, zip, love_0_7, makeWrapper, makeDesktopItem }:
|
|
|
|
let
|
|
pname = "nottetris2";
|
|
version = "2.0";
|
|
|
|
desktopItem = makeDesktopItem {
|
|
name = "nottetris2";
|
|
exec = pname;
|
|
comment = "It's like tetris, but it's not";
|
|
desktopName = "nottetris2";
|
|
genericName = "nottetris2";
|
|
categories = "Game";
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
inherit pname version;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Stabyourself";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "17iabh6rr8jim70n96rbhif4xq02g2kppscm8l339yqx6mhb64hs";
|
|
};
|
|
|
|
nativeBuildInputs = [ zip ];
|
|
buildInputs = [ love_0_7 makeWrapper ];
|
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
|
|
|
installPhase =
|
|
''
|
|
mkdir -p $out/bin $out/share/games/lovegames $out/share/applications
|
|
zip -9 -r ${pname}.love ./*
|
|
mv ${pname}.love $out/share/games/lovegames/${pname}.love
|
|
makeWrapper ${love_0_7}/bin/love $out/bin/${pname} --add-flags $out/share/games/lovegames/${pname}.love
|
|
ln -s ${desktopItem}/share/applications/* $out/share/applications/
|
|
chmod +x $out/bin/${pname}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "It's like Tetris, but it's not";
|
|
platforms = platforms.linux;
|
|
license = licenses.wtfpl;
|
|
maintainers = with maintainers; [ yorickvp ];
|
|
downloadPage = "https://stabyourself.net/nottetris2/";
|
|
};
|
|
|
|
}
|