ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / games / bsdgames / default.nix
blobc837ba39b444a70e92a9fe14bf68ea8ae275ae02
1 { lib, stdenv, fetchurl, ncurses, openssl, flex, bison, less, miscfiles }:
3 stdenv.mkDerivation rec {
4   pname = "bsd-games";
5   version = "2.17";
7   src = fetchurl {
8     url = "mirror://ibiblioPubLinux/games/${pname}-${version}.tar.gz";
9     hash = "sha256-Bm+SSu9sHF6pRvWI428wMCH138CTlEc48CXY7bxv/2A=";
10   };
12   buildInputs = [ ncurses openssl flex bison ];
14   patches = [
15     # Remove UTMPX support on Makefrag file
16     (fetchurl {
17       url = "http://svn.exactcode.de/t2/trunk/package/games/bsd-games/dm-noutmpx.patch";
18       sha256 = "1k3qp3jj0dksjr4dnppv6dvkwslrgk9c7p2n9vipqildpxgqp7w2";
19     })
20   ];
22   hardeningDisable = [ "format" ];
24   makeFlags = [ "STRIP=" ];
26   preConfigure = ''
27     cat > config.params << EOF
28     bsd_games_cfg_man6dir=$out/share/man/man6
29     bsd_games_cfg_man8dir=$out/share/man/man8
30     bsd_games_cfg_man5dir=$out/share/man/man5
31     bsd_games_cfg_wtf_acronymfile=$out/share/misc/acronyms
32     bsd_games_cfg_fortune_dir=$out/share/games/fortune
33     bsd_games_cfg_quiz_dir=$out/share/games/quiz
34     bsd_games_cfg_gamesdir=$out/bin
35     bsd_games_cfg_sbindir=$out/bin
36     bsd_games_cfg_usrbindir=$out/bin
37     bsd_games_cfg_libexecdir=$out/lib/games/dm
38     bsd_games_cfg_docdir=$out/share/doc/bsd-games
39     bsd_games_cfg_sharedir=$out/share/games
40     bsd_games_cfg_varlibdir=.
41     bsd_games_cfg_non_interactive=y
42     bsd_games_cfg_no_build_dirs="dab hack phantasia sail"
43     bsd_games_cfg_dictionary_src=${miscfiles}/share/web2
44     bsd_games_cfg_pager=${less}
45     EOF
47     sed -e s/getline/bsdgames_local_getline/g -i $(grep getline -rl .)
48   '';
50   postConfigure = ''
51     sed -i -e 's,/usr,'$out, \
52        -e "s,-o root -g root, ," \
53        -e "s,-o root -g games, ," \
54        -e "s,.*chown.*,true," \
55        -e 's/INSTALL_VARDATA.*/INSTALL_VARDATA := true/' \
56        -e 's/INSTALL_HACKDIR.*/INSTALL_HACKDIR := true/' \
57        -e 's/INSTALL_DM.*/INSTALL_DM := true/' \
58        -e 's/INSTALL_SCORE_FILE.*/INSTALL_SCORE_FILE := true/' \
59        Makeconfig install-man
60   '';
62   meta = {
63     homepage = "http://www.t2-project.org/packages/bsd-games.html";
64     description = "Ports of all the games from NetBSD-current that are free";
65     license = lib.licenses.free;
66     maintainers = with lib.maintainers; [viric];
67     platforms = with lib.platforms; linux;
68   };