summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /games-misc/bsd-games
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'games-misc/bsd-games')
-rw-r--r--games-misc/bsd-games/Manifest2
-rw-r--r--games-misc/bsd-games/bsd-games-2.17-r5.ebuild133
-rw-r--r--games-misc/bsd-games/files/bsd-games-2.17-64bit.patch43
-rw-r--r--games-misc/bsd-games/files/bsd-games-2.17-64bitutmp.patch21
-rw-r--r--games-misc/bsd-games/files/bsd-games-2.17-bg.patch22
-rw-r--r--games-misc/bsd-games/files/bsd-games-2.17-gcc4.patch34
-rw-r--r--games-misc/bsd-games/files/bsd-games-2.17-gcc43.patch16
-rw-r--r--games-misc/bsd-games/files/bsd-games-2.17-glibc2.10.patch185
-rw-r--r--games-misc/bsd-games/files/bsd-games-2.17-headers.patch16
-rw-r--r--games-misc/bsd-games/files/config.params-gentoo39
-rw-r--r--games-misc/bsd-games/metadata.xml5
11 files changed, 516 insertions, 0 deletions
diff --git a/games-misc/bsd-games/Manifest b/games-misc/bsd-games/Manifest
new file mode 100644
index 000000000000..ff448efa6644
--- /dev/null
+++ b/games-misc/bsd-games/Manifest
@@ -0,0 +1,2 @@
+DIST bsd-games-2.17.tar.gz 2563311 SHA256 066f924aef6c1c5ea946f588e36f303021f5dfc093944738f025d8edbc6fff60 SHA512 cb2ee60474f164d42e3d47700270bbeeda3c8279d64da409c9cc05e36437ef95b92d0a85543298e97604635fcf3e068f3a5cc812e90b5c61fb8d146cf35bc38f WHIRLPOOL 4a8e4bcbf040997645d1b88ef17a3f0df6414a5ad922ea68045759eeafb09ff473ad3ed1a95304a82a4eace02ebc05c1c3966bfe46a204f22e29d4d945ad2566
+DIST bsdgames_2.17-22.debian.tar.xz 32268 SHA256 dd7457368e5b4cb5b223e91a2919aefae72237fa6ab840f162a779c209163d3e SHA512 902d86557dd3813c31333fe18437d8046ae100814c9c1b340ab1f8266c817545f21e000702b1ca93babb9d632896ea5bada1e146436abfa7916b469681fceed5 WHIRLPOOL e0b7214cafecd471c059d8a097d5df4706b41c2f4dcb0658522d65f7e0ddea7bdfcfdcb86d1b0dab0703b9182d63115b246a7dc3e77a715aaf53d7d59b48e0a6
diff --git a/games-misc/bsd-games/bsd-games-2.17-r5.ebuild b/games-misc/bsd-games/bsd-games-2.17-r5.ebuild
new file mode 100644
index 000000000000..e38b438e1314
--- /dev/null
+++ b/games-misc/bsd-games/bsd-games-2.17-r5.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils toolchain-funcs games
+
+DEB_PATCH_VER=22
+DESCRIPTION="collection of games from NetBSD"
+HOMEPAGE="http://www.advogato.org/proj/bsd-games/"
+SRC_URI="ftp://metalab.unc.edu/pub/Linux/games/${P}.tar.gz
+ mirror://debian/pool/main/b/bsdgames/bsdgames_${PV}-${DEB_PATCH_VER}.debian.tar.xz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 ppc sparc x86"
+IUSE=""
+
+RDEPEND="!games-misc/wtf
+ !app-misc/banner
+ !games-puzzle/hangman
+ sys-libs/ncurses
+ sys-apps/miscfiles"
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ sys-devel/bison
+ virtual/pkgconfig"
+
+# Set GAMES_TO_BUILD variable to whatever you want
+GAMES_TO_BUILD=${GAMES_TO_BUILD:=adventure arithmetic atc
+backgammon banner battlestar bcd boggle caesar canfield countmail cribbage
+dab dm factor fish gomoku hack hangman hunt mille monop morse
+number phantasia pig pom ppt primes quiz rain random robots sail snake
+tetris trek wargames worm worms wtf}
+
+src_prepare() {
+ local d="${WORKDIR}"/debian/patches
+ EPATCH_SOURCE="${d}" epatch $(<"${d}"/series)
+
+ # Used by gentoo config.params. See bug 531200
+ export GAMES_BINDIR GAMES_DATADIR GAMES_STATEDIR
+
+ epatch \
+ "${FILESDIR}"/${P}-64bitutmp.patch \
+ "${FILESDIR}"/${P}-headers.patch \
+ "${FILESDIR}"/${P}-bg.patch \
+ "${FILESDIR}"/${P}-gcc4.patch
+
+ # Use pkg-config to query Libs: from ncurses.pc (for eg. -ltinfo) wrt #459652
+ sed -i \
+ -e "/ncurses_lib/s:-lncurses:'$($(tc-getPKG_CONFIG) --libs-only-l ncurses)':" \
+ configure || die
+
+ sed -i \
+ -e "s:/usr/games:${GAMES_BINDIR}:" \
+ wargames/wargames || die
+
+ sed -i \
+ -e '/^CC :=/d' \
+ -e '/^CXX :=/d' \
+ -e '/^CFLAGS/s/OPTIMIZE/CFLAGS/' \
+ -e '/^CXXFLAGS/s/OPTIMIZE/CXXFLAGS/' \
+ -e '/^LDFLAGS/s/LDFLAGS := /LDFLAGS := \$(LDFLAGS) /' \
+ Makeconfig.in || die
+
+ cp "${FILESDIR}"/config.params-gentoo config.params || die
+ echo bsd_games_cfg_usrlibdir=\"$(games_get_libdir)\" >> ./config.params || die
+ echo bsd_games_cfg_build_dirs=\"${GAMES_TO_BUILD}\" >> ./config.params || die
+ echo bsd_games_cfg_docdir=\"/usr/share/doc/${PF}\" >> ./config.params || die
+}
+
+src_test() {
+ addwrite /dev/full
+ emake -j1 check
+}
+
+build_game() {
+ has ${1} ${GAMES_TO_BUILD}
+}
+
+do_statefile() {
+ touch "${D}/${GAMES_STATEDIR}/${1}" || die
+ chmod ug+rw "${D}/${GAMES_STATEDIR}/${1}" || die
+}
+
+src_install() {
+ dodir "${GAMES_BINDIR}" "${GAMES_STATEDIR}" /usr/share/man/man{1,6}
+ emake -j1 DESTDIR="${D}" install
+
+ dodoc AUTHORS BUGS ChangeLog ChangeLog.0 \
+ README PACKAGING SECURITY THANKS TODO YEAR2000
+
+ # set some binaries to run as games group (+S)
+ build_game atc && fperms g+s "${GAMES_BINDIR}"/atc
+ build_game battlestar && fperms g+s "${GAMES_BINDIR}"/battlestar
+ build_game canfield && fperms g+s "${GAMES_BINDIR}"/canfield
+ build_game cribbage && fperms g+s "${GAMES_BINDIR}"/cribbage
+ build_game phantasia && fperms g+s "${GAMES_BINDIR}"/phantasia
+ build_game robots && fperms g+s "${GAMES_BINDIR}"/robots
+ build_game sail && fperms g+s "${GAMES_BINDIR}"/sail
+ build_game snake && fperms g+s "${GAMES_BINDIR}"/snake
+ build_game tetris && fperms g+s "${GAMES_BINDIR}"/tetris-bsd
+
+ # state files
+ build_game atc && do_statefile atc_score
+ build_game battlestar && do_statefile battlestar.log
+ build_game canfield && do_statefile cfscores
+ build_game cribbage && do_statefile criblog
+ build_game hack && keepdir "${GAMES_STATEDIR}"/hack
+ build_game robots && do_statefile robots_roll
+ build_game sail && do_statefile saillog
+ build_game snake && do_statefile snake.log && do_statefile snakerawscores
+ build_game tetris && do_statefile tetris-bsd.scores
+
+ # extra docs
+ build_game atc && { docinto atc ; dodoc atc/BUGS; }
+ build_game boggle && { docinto boggle ; dodoc boggle/README; }
+ build_game hack && { docinto hack ; dodoc hack/{OWNER,Original_READ_ME,READ_ME,help}; }
+ build_game hunt && { docinto hunt ; dodoc hunt/README; }
+ build_game phantasia && { docinto phantasia ; dodoc phantasia/{OWNER,README}; }
+
+ # Since factor is usually not installed, and primes.6 is a symlink to
+ # factor.6, make sure that primes.6 is ok ...
+ if build_game primes && [[ ! $(build_game factor) ]] ; then
+ rm -f "${D}"/usr/share/man/man6/{factor,primes}.6
+ newman factor/factor.6 primes.6
+ fi
+
+ prepgamesdirs
+
+ # state dirs
+ chmod -R ug+rw "${D}/${GAMES_STATEDIR}"/* || die
+}
diff --git a/games-misc/bsd-games/files/bsd-games-2.17-64bit.patch b/games-misc/bsd-games/files/bsd-games-2.17-64bit.patch
new file mode 100644
index 000000000000..a56ea8454bc4
--- /dev/null
+++ b/games-misc/bsd-games/files/bsd-games-2.17-64bit.patch
@@ -0,0 +1,43 @@
+David Leverton writes about adventure/crc.c:
+
+The 'adventure' game from the games-misc/bsd-games-2.13 package crashes
+when saving the game on AMD64 (and probably other 64-bit systems, but I
+haven't checked). Find attached to fix this.
+
+http://bugs.gentoo.org/show_bug.cgi?id=77032
+
+
+About utmpentry.c:
+
+the utmpx structure defines the ut_tv member a little differently on
+64bit hosts so that a 32bit and 64bit structure can be shared. So the
+ut_tv is a custom 32bit structure rather than the native 64bit timeval
+structure. Work around is to assign the submembers instead.
+
+http://bugs.gentoo.org/show_bug.cgi?id=102667
+
+--- bsd-games/adventure/crc.c
++++ bsd-games/adventure/crc.c
+@@ -134,7 +134,8 @@
+ if (step >= sizeof(crctab) / sizeof(crctab[0]))
+ step = 0;
+ }
+- crcval = (crcval << 8) ^ crctab[i];
++ /* Mask to 32 bits. */
++ crcval = ((crcval << 8) ^ crctab[i]) & 0xffffffff;
+ }
+- return crcval & 0xffffffff; /* Mask to 32 bits. */
++ return crcval;
+ }
+--- bsd-games/dm/utmpentry.c
++++ bsd-games/dm/utmpentry.c
+@@ -291,7 +291,8 @@
+ e->line[sizeof(e->line) - 1] = '\0';
+ (void)strncpy(e->host, up->ut_host, sizeof(up->ut_host));
+ e->name[sizeof(e->host) - 1] = '\0';
+- e->tv = up->ut_tv;
++ e->tv.tv_sec = up->ut_tv.tv_sec;
++ e->tv.tv_usec = up->ut_tv.tv_usec;
+ adjust_size(e);
+ }
+ #endif
diff --git a/games-misc/bsd-games/files/bsd-games-2.17-64bitutmp.patch b/games-misc/bsd-games/files/bsd-games-2.17-64bitutmp.patch
new file mode 100644
index 000000000000..3be1b3de074b
--- /dev/null
+++ b/games-misc/bsd-games/files/bsd-games-2.17-64bitutmp.patch
@@ -0,0 +1,21 @@
+About utmpentry.c:
+
+the utmpx structure defines the ut_tv member a little differently on
+64bit hosts so that a 32bit and 64bit structure can be shared. So the
+ut_tv is a custom 32bit structure rather than the native 64bit timeval
+structure. Work around is to assign the submembers instead.
+
+http://bugs.gentoo.org/show_bug.cgi?id=102667
+
+--- bsd-games/dm/utmpentry.c
++++ bsd-games/dm/utmpentry.c
+@@ -291,7 +291,8 @@
+ e->line[sizeof(e->line) - 1] = '\0';
+ (void)strncpy(e->host, up->ut_host, sizeof(up->ut_host));
+ e->name[sizeof(e->host) - 1] = '\0';
+- e->tv = up->ut_tv;
++ e->tv.tv_sec = up->ut_tv.tv_sec;
++ e->tv.tv_usec = up->ut_tv.tv_usec;
+ adjust_size(e);
+ }
+ #endif
diff --git a/games-misc/bsd-games/files/bsd-games-2.17-bg.patch b/games-misc/bsd-games/files/bsd-games-2.17-bg.patch
new file mode 100644
index 000000000000..07dc520b77e4
--- /dev/null
+++ b/games-misc/bsd-games/files/bsd-games-2.17-bg.patch
@@ -0,0 +1,22 @@
+--- backgammon/common_source/fancy.c.old 2007-05-16 20:16:46.000000000 +0200
++++ backgammon/common_source/fancy.c 2007-05-16 20:19:00.000000000 +0200
+@@ -58,7 +58,7 @@
+ int lUP; /* length of UP */
+ int CO; /* number of columns */
+ int LI; /* number of lines */
+-int *linect; /* array of lengths of lines on screen (the
++static int linect[25]; /* array of lengths of lines on screen (the
+ * actual screen is not stored) */
+
+ /* two letter codes */
+@@ -728,10 +728,5 @@
+ lND = strlen(ND);
+ if (LI < 24 || CO < 72 || !(CL && UP && ND))
+ return (0);
+- linect = (int *) calloc(LI + 1, sizeof(int));
+- if (linect == NULL) {
+- write(2, "\r\nOut of memory!\r\n", 18);
+- getout(0);
+- }
+ return (1);
+ }
diff --git a/games-misc/bsd-games/files/bsd-games-2.17-gcc4.patch b/games-misc/bsd-games/files/bsd-games-2.17-gcc4.patch
new file mode 100644
index 000000000000..7de07effc25d
--- /dev/null
+++ b/games-misc/bsd-games/files/bsd-games-2.17-gcc4.patch
@@ -0,0 +1,34 @@
+--- trek/getpar.h.orig 2005-08-14 19:45:29.000000000 -0400
++++ trek/getpar.h 2005-08-14 19:46:33.000000000 -0400
+@@ -31,6 +31,9 @@
+ * @(#)getpar.h 8.1 (Berkeley) 5/31/93
+ */
+
++#ifndef __GETPAR_H_
++#define __GETPAR_H_
++
+ typedef void (*cmdfun)(int);
+ struct cvntab /* used for getcodpar() parameter list */
+ {
+@@ -51,3 +54,5 @@
+ int testnl(void);
+ void skiptonl(int);
+ int readdelim(int);
++
++#endif /*__GETPAR_H_*/
+--- trek/trek.h.orig 2005-08-14 19:45:37.000000000 -0400
++++ trek/trek.h 2005-08-14 19:48:17.000000000 -0400
+@@ -31,6 +31,13 @@
+ * @(#)trek.h 8.1 (Berkeley) 5/31/93
+ */
+
++/* For struct cvntab definition, which is now required for
++ * Skitab and Lentab below. gcc 4.0 and later will emit
++ * "array type has incomplete element type" errors otherwise.
++ * -- Jason Bucata (jbucata@tulsaconnect.com), 12-AUG-2005
++ */
++#include "getpar.h"
++
+ /*
+ ** Global Declarations
+ **
diff --git a/games-misc/bsd-games/files/bsd-games-2.17-gcc43.patch b/games-misc/bsd-games/files/bsd-games-2.17-gcc43.patch
new file mode 100644
index 000000000000..8009454e55a9
--- /dev/null
+++ b/games-misc/bsd-games/files/bsd-games-2.17-gcc43.patch
@@ -0,0 +1,16 @@
+--- dab/gamescreen.h.orig
++++ dab/gamescreen.h
+@@ -70,9 +70,9 @@
+ virtual void redraw(void) = 0; // Refresh
+ virtual int getinput(void) = 0; // Get user input
+ virtual void bell(void) = 0; // Beep
+- virtual void score(size_t p, const PLAYER& p) = 0; // Post current score
+- virtual void games(size_t p, const PLAYER& p) = 0; // Post games won
+- virtual void total(size_t p, const PLAYER& p) = 0; // Post total score
++ virtual void score(size_t s, const PLAYER& p) = 0; // Post current score
++ virtual void games(size_t s, const PLAYER& p) = 0; // Post games won
++ virtual void total(size_t s, const PLAYER& p) = 0; // Post total score
+ virtual void ties(const PLAYER& p) = 0; // Post tie games
+ };
+
+
diff --git a/games-misc/bsd-games/files/bsd-games-2.17-glibc2.10.patch b/games-misc/bsd-games/files/bsd-games-2.17-glibc2.10.patch
new file mode 100644
index 000000000000..2efdc57490d8
--- /dev/null
+++ b/games-misc/bsd-games/files/bsd-games-2.17-glibc2.10.patch
@@ -0,0 +1,185 @@
+--- boggle/boggle/bog.c
++++ boggle/boggle/bog.c
+@@ -336,7 +336,7 @@
+ }
+
+ while (1) {
+- if (getline(buf) == NULL) {
++ if (get_line(buf) == NULL) {
+ if (feof(stdin))
+ clearerr(stdin);
+ break;
+--- boggle/boggle/extern.h
++++ boggle/boggle/extern.h
+@@ -43,7 +43,7 @@
+ long dictseek(FILE *, long, int);
+ void findword(void);
+ void flushin(FILE *);
+-char *getline(char *);
++char *get_line(char *);
+ void getword(char *);
+ int help(void);
+ int inputch(void);
+--- boggle/boggle/mach.c
++++ boggle/boggle/mach.c
+@@ -168,7 +168,7 @@
+ * - doesn't accept words longer than MAXWORDLEN or containing caps
+ */
+ char *
+-getline(q)
++get_line(q)
+ char *q;
+ {
+ int ch, done;
+--- cribbage/cribbage.h
++++ cribbage/cribbage.h
+@@ -77,7 +77,7 @@
+ int fifteens(const CARD [], int);
+ void game(void);
+ void gamescore(void);
+-char *getline(void);
++char *get_line(void);
+ int getuchar(void);
+ int incard(CARD *);
+ int infrom(const CARD [], int, const char *);
+--- cribbage/crib.c
++++ cribbage/crib.c
+@@ -221,7 +221,7 @@
+ if (!rflag) { /* player cuts deck */
+ msg(quiet ? "Cut for crib? " :
+ "Cut to see whose crib it is -- low card wins? ");
+- getline();
++ get_line();
+ }
+ i = (rand() >> 4) % CARDS; /* random cut */
+ do { /* comp cuts deck */
+@@ -397,7 +397,7 @@
+ if (!rflag) { /* random cut */
+ msg(quiet ? "Cut the deck? " :
+ "How many cards down do you wish to cut the deck? ");
+- getline();
++ get_line();
+ }
+ i = (rand() >> 4) % (CARDS - pos);
+ turnover = deck[i + pos];
+--- cribbage/io.c
++++ cribbage/io.c
+@@ -245,7 +245,7 @@
+
+ retval = FALSE;
+ rnk = sut = EMPTY;
+- if (!(line = getline()))
++ if (!(line = get_line()))
+ goto gotit;
+ p = p1 = line;
+ while (*p1 != ' ' && *p1 != '\0')
+@@ -346,7 +346,7 @@
+
+ for (sum = 0;;) {
+ msg(prompt);
+- if (!(p = getline()) || *p == '\0') {
++ if (!(p = get_line()) || *p == '\0') {
+ msg(quiet ? "Not a number" :
+ "That doesn't look like a number");
+ continue;
+@@ -528,12 +528,12 @@
+ }
+
+ /*
+- * getline:
++ * get_line:
+ * Reads the next line up to '\n' or EOF. Multiple spaces are
+ * compressed to one space; a space is inserted before a ','
+ */
+ char *
+-getline()
++get_line()
+ {
+ char *sp;
+ int c, oy, ox;
+--- gomoku/bdisp.c
++++ gomoku/bdisp.c
+@@ -241,7 +241,7 @@
+ }
+
+ int
+-getline(buf, size)
++get_line(buf, size)
+ char *buf;
+ int size;
+ {
+--- gomoku/gomoku.h
++++ gomoku/gomoku.h
+@@ -263,7 +263,7 @@
+
+ void bdinit(struct spotstr *);
+ void init_overlap(void);
+-int getline(char *, int);
++int get_line(char *, int);
+ void ask(const char *);
+ void dislog(const char *);
+ void bdump(FILE *);
+--- gomoku/main.c
++++ gomoku/main.c
+@@ -155,7 +155,7 @@
+ if (inputfp == NULL && test == 0) {
+ for (;;) {
+ ask("black or white? ");
+- getline(buf, sizeof(buf));
++ get_line(buf, sizeof(buf));
+ if (buf[0] == 'b' || buf[0] == 'B') {
+ color = BLACK;
+ break;
+@@ -172,7 +172,7 @@
+ }
+ } else {
+ setbuf(stdout, 0);
+- getline(buf, sizeof(buf));
++ get_line(buf, sizeof(buf));
+ if (strcmp(buf, "black") == 0)
+ color = BLACK;
+ else if (strcmp(buf, "white") == 0)
+@@ -244,7 +244,7 @@
+ getinput:
+ if (interactive)
+ ask("move? ");
+- if (!getline(buf, sizeof(buf))) {
++ if (!get_line(buf, sizeof(buf))) {
+ curmove = RESIGN;
+ break;
+ }
+@@ -256,7 +256,7 @@
+ FILE *fp;
+
+ ask("save file name? ");
+- (void)getline(buf, sizeof(buf));
++ (void)get_line(buf, sizeof(buf));
+ if ((fp = fopen(buf, "w")) == NULL) {
+ glog("cannot create save file");
+ goto getinput;
+@@ -309,14 +309,14 @@
+ if (i != RESIGN) {
+ replay:
+ ask("replay? ");
+- if (getline(buf, sizeof(buf)) &&
++ if (get_line(buf, sizeof(buf)) &&
+ (buf[0] == 'y' || buf[0] == 'Y'))
+ goto again;
+ if (strcmp(buf, "save") == 0) {
+ FILE *fp;
+
+ ask("save file name? ");
+- (void)getline(buf, sizeof(buf));
++ (void)get_line(buf, sizeof(buf));
+ if ((fp = fopen(buf, "w")) == NULL) {
+ glog("cannot create save file");
+ goto replay;
+@@ -367,7 +367,7 @@
+ quit();
+ top:
+ ask("cmd? ");
+- if (!getline(fmtbuf, sizeof(fmtbuf)))
++ if (!get_line(fmtbuf, sizeof(fmtbuf)))
+ quit();
+ switch (*fmtbuf) {
+ case '\0':
diff --git a/games-misc/bsd-games/files/bsd-games-2.17-headers.patch b/games-misc/bsd-games/files/bsd-games-2.17-headers.patch
new file mode 100644
index 000000000000..953a5d35765a
--- /dev/null
+++ b/games-misc/bsd-games/files/bsd-games-2.17-headers.patch
@@ -0,0 +1,16 @@
+http://bugs.gentoo.org/128348
+
+--- include/stdio.h
++++ include/stdio.h
+@@ -35,5 +35,11 @@
+ #include_next <stdio.h>
+
+ #ifndef HAVE_fgetln
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern char *fgetln(FILE *stream, size_t *len);
++#ifdef __cplusplus
++}
++#endif
+ #endif
diff --git a/games-misc/bsd-games/files/config.params-gentoo b/games-misc/bsd-games/files/config.params-gentoo
new file mode 100644
index 000000000000..9d246d1865e9
--- /dev/null
+++ b/games-misc/bsd-games/files/config.params-gentoo
@@ -0,0 +1,39 @@
+
+# This file is read by configure for the Gentoo ebuild
+
+# Don't run configure interactively.
+bsd_games_cfg_non_interactive=y
+
+bsd_games_cfg_install_prefix=${D}
+
+# For gentoo,
+# banner used to be in util-linux. Gentoo might have an ebuild
+# fortune is "app-games/fortune-mod"
+# factor is in "sys-apps/sh-utils"
+# dm is not installed by debian, I don't know why
+bsd_games_cfg_no_build_dirs="dm banner fortune factor"
+
+# Gentoo's games eclass want everything in these places
+bsd_games_cfg_gamesdir=${GAMES_BINDIR}
+bsd_games_cfg_sbindir=${GAMES_BINDIR}
+bsd_games_cfg_sharedir=${GAMES_DATADIR}/${PN}
+bsd_games_cfg_varlibdir=${GAMES_STATEDIR}
+
+# We'll control all the permissions during install (via games eclass)
+bsd_games_cfg_do_chown=n
+
+# .so or symlink??? (Debian perfers symlinks for manpages)
+bsd_games_cfg_use_dot_so=symlinks
+
+# Gentoo'll handle manpage compressing.
+bsd_games_cfg_gzip_manpages=n
+
+# sys-apps/less is in system (even though more is in /bin)
+bsd_games_cfg_pager=/usr/bin/less
+
+# sys-apps/miscfiles might have too many words for boggle
+bsd_games_cfg_dictionary_src=/usr/share/dict/words
+
+# Acronym file for "wft"
+bsd_games_cfg_wtf_acronymfile=${GAMES_DATADIR}/${PN}/acronyms
+
diff --git a/games-misc/bsd-games/metadata.xml b/games-misc/bsd-games/metadata.xml
new file mode 100644
index 000000000000..d3c2cc926f0b
--- /dev/null
+++ b/games-misc/bsd-games/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>games</herd>
+</pkgmetadata>