nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 ncurses,
6 asciidoctor,
7 gitUpdater,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "greed";
12 version = "4.3";
13
14 src = fetchFromGitLab {
15 owner = "esr";
16 repo = "greed";
17 tag = finalAttrs.version;
18 hash = "sha256-NmX0hYHODe55N0edhdfdm0a/Yqm/UwkU/RREjYl3ePc=";
19 };
20
21 postPatch = ''
22 substituteInPlace Makefile \
23 --replace-fail "-lcurses" "-lncurses" \
24 --replace-fail "BIN=/usr/games" "BIN=$out/bin" \
25 --replace-fail "/usr/share" "$out/share" \
26 --replace-fail "/usr/games/lib/greed.hs" "/var/lib/greed/greed.hs"
27 '';
28
29 buildInputs = [
30 ncurses
31 ];
32
33 nativeBuildInputs = [
34 asciidoctor
35 ];
36
37 preInstall = ''
38 mkdir -p $out/bin
39 mkdir -p $out/share/man/man6
40 '';
41
42 passthru = {
43 updateScript = gitUpdater { };
44 };
45
46 meta = {
47 homepage = "http://www.catb.org/~esr/";
48 platforms = lib.platforms.unix;
49 license = lib.licenses.bsd2;
50 maintainers = with lib.maintainers; [ bot-wxt1221 ];
51 description = "Game of Consumption";
52 changelog = "https://gitlab.com/esr/greed/-/blob/${finalAttrs.version}/NEWS.adoc?ref_type=tags";
53 mainProgram = "greed";
54 };
55})