mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +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
58 lines
1.4 KiB
Nix
58 lines
1.4 KiB
Nix
{ stdenv, lib, fetchFromGitHub, cmake }:
|
|
|
|
let
|
|
games = {
|
|
ctf = {
|
|
id = "ctf";
|
|
version = "1.07";
|
|
description = "'Capture The Flag' for Yamagi Quake II";
|
|
sha256 = "0i9bwhjvq6yhalrsbzjambh27fdzrzgswqz3jgfn9qw6k1kjvlin";
|
|
};
|
|
|
|
ground-zero = {
|
|
id = "rogue";
|
|
version = "2.07";
|
|
description = "'Ground Zero' for Yamagi Quake II";
|
|
sha256 = "1m2r4vgfdxpsi0lkf32liwf1433mdhhmjxiicjwzqjlkncjyfcb1";
|
|
};
|
|
|
|
the-reckoning = {
|
|
id = "xatrix";
|
|
version = "2.08";
|
|
description = "'The Reckoning' for Yamagi Quake II";
|
|
sha256 = "1wp9fg1q8nly2r9hh4394r1h4dxyni3lvdy7g419cz5s8hhn5msr";
|
|
};
|
|
};
|
|
|
|
toDrv = title: data: stdenv.mkDerivation rec {
|
|
inherit (data) id version description sha256;
|
|
inherit title;
|
|
|
|
name = "yquake2-${title}-${version}";
|
|
|
|
src = fetchFromGitHub {
|
|
inherit sha256;
|
|
owner = "yquake2";
|
|
repo = data.id;
|
|
rev = "${lib.toUpper id}_${builtins.replaceStrings ["."] ["_"] version}";
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/lib/yquake2/${id}
|
|
cp Release/* $out/lib/yquake2/${id}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
inherit (data) description;
|
|
homepage = "https://www.yamagi.org/quake2/";
|
|
license = licenses.unfree;
|
|
platforms = platforms.unix;
|
|
maintainers = with maintainers; [ tadfisher ];
|
|
};
|
|
};
|
|
|
|
in
|
|
lib.mapAttrs toDrv games
|