From: "Aurélien Coussat" <acoussat@mail.fr>
To: 53235@debbugs.gnu.org
Subject: [bug#53235] [PATCH] gnu: Add brogue-ce.
Date: Thu, 13 Jan 2022 20:02:01 +0100 [thread overview]
Message-ID: <20220113190202.83806A0709@smtp02.mail.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 314 bytes --]
Hello Guix,
Before anything else, sorry if I made obvious mistakes: this is my first package ever, and my very first Guix contribution.
This patch adds BrogueCE to games.scm. BrogueCE is the community edition of Brogue, a minimalist roguelike game released under the AGPL-3.0 license.
Thank you very much!
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-brogue-ce.patch --]
[-- Type: text/x-diff; name="0001-gnu-Add-brogue-ce.patch", Size: 5776 bytes --]
From cc67e0e0d482ab9c88cbfd8d509329ff98ec5670 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Coussat?= <acoussat@mail.fr>
Date: Thu, 13 Jan 2022 17:33:55 +0100
Subject: [PATCH] gnu: Add brogue-ce.
---
gnu/packages/games.scm | 92 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index bfd566aac0..497d8e6002 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -68,6 +68,7 @@
;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
;;; Copyright © 2021 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 Aurélien Coussat <acoussat@mail.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -12588,3 +12589,94 @@ (define-public fheroes2
Magic II (aka HOMM2) game engine. It requires assets and game resources to
play; it will look for them at @file{~/.local/share/fheroes2} folder.")
(license license:gpl2)))
+
+(define-public brogue-ce
+ (package
+ (name "brogue-ce")
+ (version "1.10.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tmewett/BrogueCE.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0hgqr6gf0sxi9fv6ahd4rh3dgysbxm2i9yx998mdmw6my7h2756p"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f
+ #:phases (modify-phases %standard-phases
+ (delete 'configure)
+ (add-before 'build 'prepare-build
+ ;; Set correct environment for SDL.
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "CPATH"
+ (string-append (assoc-ref inputs "sdl")
+ "/include/SDL2:"
+ (or (getenv "CPATH") "")))))
+ (add-before 'build 'setenv-cc
+ (lambda _ (setenv "CC" "gcc")))
+ (add-before 'build 'fix-datadir
+ ;; Set path to reach the correct asset directory.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (substitute* "src/platform/tiles.c"
+ (("(\"%s/assets/[^\"]+\"), dataDirectory" all filepath)
+ (string-append filepath ", \""
+ (assoc-ref outputs "out") "/bin\"")))))
+ (replace 'install
+ ;; Upstream provides no install phase.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (executable ,name)
+ (real-executable
+ (string-append "." executable "-real"))
+ (userdir (string-append "." ,name))
+ (share (string-append out "/share"))
+ (apps (string-append share "/applications")))
+ (copy-recursively "bin" bin)
+ ;; Create a "fake" executable that calls the actual
+ ;; executable from a good location.
+ (with-directory-excursion bin
+ (rename-file "brogue" real-executable)
+ (call-with-output-file executable
+ (lambda (p)
+ (format p
+ "#!~a~@
+ cd $HOME~@
+ mkdir -p ~a~@
+ cd ~a~@
+ exec ~a/~a $*"
+ (which "bash")
+ userdir
+ userdir
+ bin
+ real-executable)))
+ (chmod executable #o555))
+ ;; Create desktop file.
+ (mkdir-p apps)
+ (make-desktop-entry-file
+ (string-append apps "/" ,name ".desktop")
+ #:name "Brogue"
+ #:exec ,name
+ #:categories '("RolePlaying" "Game")
+ #:keywords
+ '("adventure" "singleplayer")
+ #:comment
+ '((#f "Brave the Dungeons of Doom!")))
+ #t))))))
+ (inputs
+ `(("sdl" ,(sdl-union (list sdl2 sdl2-image)))))
+ (home-page "https://github.com/tmewett/BrogueCE")
+ (synopsis "Community-lead fork of the much-loved minimalist roguelike game")
+ (description "Brogue is a single-player strategy game set in the halls of a
+mysterious and randomly-generated dungeon. The objective is simple enough --
+retrieve the fabled Amulet of Yendor from the 26th level -- but the dungeon is
+riddled with danger. Horrifying creatures and devious, trap-ridden terrain
+await. Yet it is also riddled with weapons, potions, and artifacts of forgotten
+power. Survival demands strength and cunning in equal measure as you descend,
+making the most of what the dungeon gives you. You will make sacrifices, narrow
+escapes, and maybe even some friends along the way -- but will you be one of the
+lucky few to return alive?")
+ (license license:agpl3)))
--
2.34.0
next reply other threads:[~2022-01-13 20:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-13 19:02 Aurélien Coussat [this message]
2022-01-14 12:48 ` [bug#53235] [PATCH] gnu: Add brogue-ce Maxime Devos
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=20220113190202.83806A0709@smtp02.mail.de \
--to=acoussat@mail.fr \
--cc=53235@debbugs.gnu.org \
/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.