all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: nee <nee@cock.li>
To: Arun Isaac <arunisaac@systemreboot.net>
Cc: 26488@debbugs.gnu.org
Subject: bug#26488: [PATCH] gnu: Add crawl.
Date: Mon, 17 Apr 2017 06:46:09 +0200	[thread overview]
Message-ID: <8ac92fe4-14dd-3933-8901-bea4ff8673ac@cock.li> (raw)
In-Reply-To: <c09ea559.AEMAJMF3UlcAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABY8Q9P@mailjet.com>

[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]

Am 14.04.2017 um 20:04 schrieb Arun Isaac:
> Try (setenv "HOME" "/tmp") as Danny mentioned.
> 
Works, thanks to both of you.

> Only a matter of aesthetics, but you could split "-C" and "source" into
> separate strings.
> 
All the packages in games.scm do it as one string, so I didn't change it
for now. It should be changed for all packages at once.

> Put 'check on the same line as replace. In emacs, you can use
> guix-devel-mode from emacs-guix to help you with indenting correctly.
> 
Thanks, I installed emacs-guix and it indents correctly now.
Previously I assumed the .dir-locals.el would be enough.

> Looking good so far! Only the check phase remains...
> 
Good news everyone, I managed to package the check phase and all the
tests pass! The downside is that in order to run the tests the whole
game must be rebuild with a -DDEBUG define that seems to enable asserts
and debug outputs, otherwise the tests won't run. So the build times are
doubled.
That rebuild overwrites the objects, executable, and the .cflags file
from the build phase, so install would build it a 3rd time.
I worked around this by moving the check phase before the build phase.

I also added myself to the copyright header, since you mentioned that in
the mcomix thread.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-crawl.patch --]
[-- Type: text/x-patch; name="0001-gnu-Add-crawl.patch", Size: 4970 bytes --]

From 72aa4b81e767edd451c5859be7e1d67f3c4ceedf Mon Sep 17 00:00:00 2001
From: nee <nee.git@cock.li>
Date: Thu, 13 Apr 2017 22:45:18 +0200
Subject: [PATCH] gnu: Add crawl.

* gnu/packages/games.scm (crawl): New variable.
---
 gnu/packages/games.scm | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 710b2746c..502fa74ce 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -27,6 +27,7 @@
 ;;; Copyright © 2017 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017 nee <nee-git@hidamari.blue>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -115,6 +116,8 @@
   #:use-module (gnu packages messaging)
   #:use-module (gnu packages upnp)
   #:use-module (gnu packages wxwidgets)
+  #:use-module (gnu packages bison)
+  #:use-module (gnu packages flex)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
   #:use-module (guix build-system python)
@@ -3649,3 +3652,79 @@ small robot living in the nano world, repair its maker.")
     ;; kiki-the-nano-bot/kiki-the-nano-bot_1.0.2+dfsg1-4_copyright>
     ;; for a statement from the author.
     (license license:public-domain)))
+
+(define-public crawl
+  (package
+    (name "crawl")
+    (version "0.19.5")
+    (source (origin
+              (method url-fetch)
+              (uri (list
+                    ;; Older releases get moved into a versioned directory
+                    (string-append "http://crawl.develz.org/release/"
+                                   (version-major+minor version) "/stone_soup-"
+                                   version "-nodeps.tar.xz")
+                    ;; Only the latest release is in this directory
+                    (string-append "http://crawl.develz.org/release/stone_soup-"
+                                   version "-nodeps.tar.xz")))
+              (sha256
+               (base32
+                "00yl2lb2shglxlxzpyk99zvglfx4amjybqwnzdcasvbiggb4cj18"))))
+    (arguments
+     '(#:make-flags
+       (let* ((sqlite (assoc-ref %build-inputs "sqlite"))
+              (out (assoc-ref %outputs "out")))
+         (list (string-append "SQLITE_INCLUDE_DIR=" sqlite "/include")
+               (string-append "prefix=" out)
+               "SAVEDIR=~/.crawl"
+               "TILES="
+               "BUILD_LUA="
+               "BUILD_SQLITE="
+               "BUILD_ZLIB="
+               "-Csource"))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'check)
+         ;; Test cases require the source to be rebuild with the -DDEBUG define.
+         ;; Do 'check before 'build to avoid a 3rd build on make install.
+         (add-before 'build 'check
+           (lambda* (#:key inputs outputs make-flags
+                     parallel-build? parallel-tests? #:allow-other-keys)
+             (let* ((parallel-flag (format #f "-j~d" (parallel-job-count)))
+                    (test-flags-build (if parallel-build?
+                                          (cons parallel-flag
+                                                make-flags)
+                                          make-flags))
+                    (test-flags-run (if parallel-tests?
+                                        (cons parallel-flag
+                                              make-flags)
+                                        make-flags)))
+               (setenv "HOME" (getcwd))
+               ;; Fake a terminal for the test cases.
+               (setenv "TERM" "xterm-256color")
+               (setenv "COLUMNS" "80")
+               (setenv "LINES" "24")
+               (apply system* (cons* "make" "debug" test-flags-build))
+               (zero? (apply system* (cons* "make" "test" test-flags-run)))))))))
+    (build-system gnu-build-system)
+    (inputs `(("ncurses" ,ncurses)
+              ("sqlite" ,sqlite)
+              ("bison" ,bison)
+              ("flex" ,flex)
+              ("zlib" ,zlib)
+              ("lua51" ,lua-5.1)))
+    (native-inputs `(("pkg-config" ,pkg-config)
+                     ("perl" ,perl)))
+    (synopsis "Roguelike dungeon crawler game")
+    (description "Dungeon Crawl Stone Soup is a roguelike adventure through
+dungeons filled with dangerous monsters in a quest to find the mystifyingly
+fabulous Orb of Zot.")
+    (home-page "https://crawl.develz.org")
+    (license (list license:gpl2+
+                   license:bsd-2
+                   license:bsd-3
+                   license:cc0
+                   license:x11
+                   license:zlib
+                   license:asl2.0))))
-- 
2.12.2


  parent reply	other threads:[~2017-04-17  2:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-13 21:26 bug#26488: [PATCH] gnu: Add crawl nee
     [not found] ` <cu7shlbed1g.fsf@systemreboot.net>
2017-04-14  8:07   ` Arun Isaac
2017-04-14 16:10     ` nee
2017-04-14 17:23       ` Danny Milosavljevic
2017-04-14 18:04       ` Arun Isaac
     [not found]       ` <c09ea559.AEMAJMF3UlcAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABY8Q9P@mailjet.com>
2017-04-17  4:46         ` nee [this message]
2017-04-17 18:37           ` Arun Isaac
2017-04-18 22:15             ` nee
2017-04-19  6:11               ` Arun Isaac
2017-04-21 17:10                 ` Christopher Allan Webber
2017-04-21 20:25                   ` Arun Isaac
2017-04-17 19:29           ` Arun Isaac
2017-04-17 21:29             ` nee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ac92fe4-14dd-3933-8901-bea4ff8673ac@cock.li \
    --to=nee@cock.li \
    --cc=26488@debbugs.gnu.org \
    --cc=arunisaac@systemreboot.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.