summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/data/misc/miscfiles/default.nix16
-rw-r--r--pkgs/games/bsdgames/default.nix47
-rw-r--r--pkgs/top-level/all-packages.nix8
3 files changed, 71 insertions, 0 deletions
diff --git a/pkgs/data/misc/miscfiles/default.nix b/pkgs/data/misc/miscfiles/default.nix
new file mode 100644
index 00000000000..e216f4b0278
--- /dev/null
+++ b/pkgs/data/misc/miscfiles/default.nix
@@ -0,0 +1,16 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  name = "miscfiles-1.4.2";
+
+  src = fetchurl {
+    url = "mirror://gnu/miscfiles/${name}.tar.gz";
+    sha256 = "1rh10y63asyrqyp5mlmxy7y4kdp6svk2inws3y7mfx8lsrhcm6dn";
+  };
+
+  meta = {
+    homepage = http://www.gnu.org/software/miscfiles/;
+    license = "GPLv2+";
+    description = "Collection of files not of crucial importance for sysadmins";
+  };
+}
diff --git a/pkgs/games/bsdgames/default.nix b/pkgs/games/bsdgames/default.nix
new file mode 100644
index 00000000000..8f83c9e588d
--- /dev/null
+++ b/pkgs/games/bsdgames/default.nix
@@ -0,0 +1,47 @@
+{stdenv, fetchurl, ncurses, openssl, flex, bison, miscfiles}:
+
+stdenv.mkDerivation {
+  name = "bsd-games-2.17";
+
+  src = fetchurl {
+    url = ftp://metalab.unc.edu/pub/Linux/games/bsd-games-2.17.tar.gz;
+    sha256 = "0q7zdyyfvn15y0w4g54kq3gza89h61py727m8slmw73cxx594vq6";
+  };
+
+  buildInputs = [ ncurses openssl flex bison ];
+
+  preConfigure = ''
+    cat > config.params << EOF
+    bsd_games_cfg_man6dir=$out/share/man/man6
+    bsd_games_cfg_man8dir=$out/share/man/man8
+    bsd_games_cfg_man5dir=$out/share/man/man5
+    bsd_games_cfg_wtf_acronymfile=$out/share/misc/acronyms
+    bsd_games_cfg_fortune_dir=$out/share/games/fortune
+    bsd_games_cfg_quiz_dir=$out/share/games/quiz
+    bsd_games_cfg_gamesdir=$out/bin
+    bsd_games_cfg_non_interactive=y
+    bsd_games_cfg_no_build_dirs="dab hack phantasia sail"
+    bsd_games_cfg_dictionary_src=${miscfiles}/share/dict/words
+    EOF
+  '';
+
+  postConfigure = ''
+    sed -i -e 's,/usr,'$out, \
+       -e "s,-o root -g root, ," \
+       -e "s,-o root -g games, ," \
+       -e "s,.*chown.*,true," \
+       -e 's/INSTALL_VARDATA.*/INSTALL_VARDATA := true/' \
+       -e 's/INSTALL_HACKDIR.*/INSTALL_HACKDIR := true/' \
+       -e 's/INSTALL_DM.*/INSTALL_DM := true/' \
+       -e 's/INSTALL_SCORE_FILE.*/INSTALL_SCORE_FILE := true/' \
+       Makeconfig install-man
+  '';
+
+  meta = {
+    homepage = "http://www.t2-project.org/packages/bsd-games.html";
+    description = "Ports of all the games from NetBSD-current that are free";
+    license = "free";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c3c95bcac49..a2a7b3deca0 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6301,6 +6301,10 @@ let
     inherit fetchurl stdenv;
   };
 
+  miscfiles = import ../data/misc/miscfiles {
+    inherit fetchurl stdenv;
+  };
+
   mph_2b_damase = import ../data/fonts/mph-2b-damase {
     inherit fetchurl stdenv unzip;
   };
@@ -8134,6 +8138,10 @@ let
     inherit fetchurl stdenv SDL SDL_image SDL_mixer SDL_ttf guile gettext;
   };
 
+  bsdgames = import ../games/bsdgames {
+    inherit fetchurl stdenv ncurses openssl flex bison miscfiles;
+  };
+
   castleCombat = import ../games/castle-combat {
     inherit fetchurl stdenv python pygame twisted lib numeric makeWrapper;
   };