On Sat, Jan 21, 2017 at 04:34:55PM +0100, Ludovic Courtès wrote:

To make things more concrete, we could discuss specific packages you are
interested in and see how we could provide them in Guix{,SD}.

The package is the old bsd-games bundle. Some of the games need to write score files under /var/lib/bsdgames/
You can find attached my patch so far.

--
Thanks,
Georgi
>From aaac9e7f8d6bb088bc390099445e33135e6bfbc3 Mon Sep 17 00:00:00 2001
From: TwoFinger <two-fin...@users.noreply.github.com>
Date: Sat, 21 Jan 2017 18:13:48 +0200
Subject: [PATCH] gnu: Add bsd-games

* gnu/packages/games.scm (bsd-games): New variable
* gnu/packages/patches/bsd-games.patch: New file
---
 gnu/packages/games.scm               | 39 +++++++++++++++++++++++++++++++++++
 gnu/packages/patches/bsd-games.patch | 40 ++++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
 create mode 100644 gnu/packages/patches/bsd-games.patch

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index c449f5954..ad4b4f2da 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3068,3 +3068,42 @@ symbols, the game needs graphics to render the non-euclidean world.")
 for Un*x systems with X11.")
     (home-page "http://olofson.net/kobodl/";)
     (license license:gpl2+)))
+
+(define-public bsd-games
+  (let ((commit "1e6f16ee747a7c8b6a0b836b12847f79024d0ab6"))
+    (package
+      (name "bsd-games")
+      (version (git-version "2.17" "1" commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url (string-append "https://github.com/msharov/"; name ".git"))
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (patches
+                 (search-patches (string-append name ".patch")))
+                (sha256
+                 (base32
+                  "15hazzgy0z5c17rqzvahaw4z0c4n2sdq56mi8lsja56yr1w5n6y3"))))
+      (build-system gnu-build-system)
+      (inputs `(("ncurses" ,ncurses)))
+      (arguments
+       `(#:tests? #f
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'configure
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (setenv "CC" "gcc")
+                      (let* ((out (assoc-ref outputs "out"))
+                             (var (string-append out "/var")))
+                        (zero?
+                         (system* "./configure"
+                                  (string-append "--prefix=" out)
+                                  (string-append "--localstatedir=" var)))))))))
+      (home-page "https://www.polyomino.org.uk/computer/software/bsd-games/";)
+      (synopsis "Linux port of the collection of BSD command line games")
+      (description "Port of most of the games from NetBSD-current.
+Games included:
+atc battlestar caesar cribbage dab drop4 fish gomoku
+hack hangman klondike robots sail snake worm wump")
+      (license license:bsd-4))))
diff --git a/gnu/packages/patches/bsd-games.patch b/gnu/packages/patches/bsd-games.patch
new file mode 100644
index 000000000..9a153f535
--- /dev/null
+++ b/gnu/packages/patches/bsd-games.patch
@@ -0,0 +1,40 @@
+commit 5a7ed4b23b20b239b0788b2cefe1d2819c80aa1a
+Author: TwoFinger <two-fin...@users.noreply.github.com>
+Date:   Sat Jan 21 14:22:30 2017 +0200
+
+    No chgrp /var/lib/bsdgames
+
+diff --git a/Config.mk.in b/Config.mk.in
+index fbdae93..851421a 100644
+--- a/Config.mk.in
++++ b/Config.mk.in
+@@ -13,7 +13,7 @@ INSTALL		:= @INSTALL@
+ 
+ INSTALLEXE	:= ${INSTALL} -D -p -m 755 -s
+ INSTALLDATA	:= ${INSTALL} -D -p -m 644
+-INSTALLSCORE	:= ${INSTALL} -D -p -m 664 -g users
++INSTALLSCORE	:= ${INSTALL} -D -p -m 664
+ RMPATH		:= rmdir -p --ignore-fail-on-non-empty
+ 
+ ################ Destination #########################################
+@@ -21,7 +21,7 @@ RMPATH		:= rmdir -p --ignore-fail-on-non-empty
+ prefix		:= @prefix@
+ BINDIR		:= @bindir@
+ MANDIR		:= @mandir@
+-STATEDIR	:= @localstatedir@/${NAME}
++STATEDIR	:= @localstatedir@/lib/${NAME}
+ DATADIR		:= @datadir@/${NAME}
+ 
+ WORDLIST	:= @wordlist@
+diff --git a/hack/Module.mk b/hack/Module.mk
+index 971bcf1..4ab0eb6 100644
+--- a/hack/Module.mk
++++ b/hack/Module.mk
+@@ -51,7 +51,6 @@ ${hack/SCOREI}:	${STATEDIR}/hack
+ ${STATEDIR}/hack:
+ 	@echo "Creating hack dir and score files ..."
+ 	@mkdir -m 755 ${STATEDIR}/hack
+-	@chgrp users ${STATEDIR}/hack
+ 	@${INSTALLSCORE} /dev/null ${STATEDIR}/hack/perm
+ 	@${INSTALLSCORE} /dev/null ${STATEDIR}/hack/record
+ 
-- 
2.11.0

Reply via email to