1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-20 04:31:52 +00:00
nixpkgs/pkgs/games/instead/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
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
2021-01-11 10:38:22 +01:00

73 lines
2.1 KiB
Nix

{ lib, stdenv, fetchurl, SDL2, SDL2_ttf, SDL2_image, SDL2_mixer, pkgconfig, lua, zlib, unzip }:
let
version = "3.3.2";
# I took several games at random from https://instead.syscall.ru/games/
games = [
(fetchurl {
url = "http://instead-games.googlecode.com/files/instead-apple-day-1.2.zip";
sha256 = "0d4m554hiqmgl4xl0jp0b3bqjl35879768hqznh9y57y04sygd2a";
})
(fetchurl {
url = "http://instead-games.googlecode.com/files/instead-cat_en-1.2.zip";
sha256 = "0jlm3ssqlka16dm0rg6qfjh6xdh3pv7lj2s4ib4mqwj2vfy0v6sg";
})
(fetchurl {
url = "http://instead-games.googlecode.com/files/instead-vinny-0.1.zip";
sha256 = "15qdbg82zp3a8vz4qxminr0xbzbdpnsciliy2wm3raz4hnadawg1";
})
(fetchurl {
url = "http://instead-games.googlecode.com/files/instead-toilet3in1-1.2.zip";
sha256 = "0wz4bljbg67m84qwpaqpzs934a5pcbhpgh39fvbbbfvnnlm4lirl";
})
(fetchurl {
url = "http://instead-games.googlecode.com/files/instead-kayleth-0.4.1.zip";
sha256 = "0xmn9inys0kbcdd02qaqp8gazqs67xq3fq7hvcy2qb9jbq85j8b2";
})
];
in
stdenv.mkDerivation {
name = "instead-" + version;
src = fetchurl {
url = "mirror://sourceforge/project/instead/instead/${version}/instead_${version}.tar.gz";
sha256 = "u5j2kDKRvMQPsG8iA6uOBScuyE/e1BJIK2+qVL6jqQs=";
};
NIX_LDFLAGS = "-llua -lgcc_s";
nativeBuildInputs = [ pkgconfig unzip ];
buildInputs = [ SDL2 SDL2_ttf SDL2_image SDL2_mixer lua zlib ];
postPatch = ''
substituteInPlace configure.sh \
--replace "/tmp/sdl-test" $(mktemp)
'';
configurePhase = ''
{ echo 2; echo $out; } | ./configure.sh
'';
inherit games;
postInstall = ''
pushd $out/share/instead/games
for a in $games; do
unzip $a
done
popd
'';
enableParallelBuilding = true;
meta = with lib; {
description = "Simple text adventure interpreter for Unix and Windows";
homepage = "https://instead.syscall.ru/";
license = stdenv.lib.licenses.gpl2;
platforms = with stdenv.lib.platforms; linux;
maintainers = with maintainers; [ pSub ];
};
}