[PATCH] gnu: Add roguebox-adventures.

  • Done
  • quality assurance status badge
Details
2 participants
  • Kei Kebreau
  • Leo Famulari
Owner
unassigned
Submitted by
Kei Kebreau
Severity
normal

Debbugs page

Kei Kebreau wrote 7 years ago
(address . guix-patches@gnu.org)(name . Kei Kebreau)(address . kei@openmailbox.org)
20171125210928.24879-1-kkebreau@posteo.net
From: Kei Kebreau <kei@openmailbox.org>

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

Toggle diff (97 lines)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index b1ba28a62..5b1558c6f 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -580,6 +580,90 @@ utilizing the art assets from the @code{SuperTux} project.")
license:gpl2+
license:gpl3+))))
+(define-public roguebox-adventures
+ (let ((commit "19a2c340b34d5b4e7cc89118c7aedc058babbd93")
+ (revision "1"))
+ (package
+ (name "roguebox-adventures")
+ (version (string-append "2.1.2." revision "." (string-take commit 7)))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.postactiv.com/themightyglider/RogueBoxAdventures")
+ (commit commit)))
+ (sha256
+ (base32
+ "0afmg8fjdcs3sqdp5rc7irgr7riil8jwysfjn1imfxslf1wcx5ah"))))
+ (build-system python-build-system)
+ (arguments
+ '(#:tests? #f ; no check target
+ #:phases
+ (modify-phases %standard-phases
+ ;; no setup.py script
+ (replace 'build
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (data (string-append
+ out "/share/games/roguebox-adventures")))
+ ;; Use the correct data directory.
+ (substitute* '("main.py" "LIB/getch.py" "LIB/getch_gcwz.py")
+ (("basic_path + os\\.sep + 'DATA'")
+ (string-append "'" data "'"))
+ (("^basic_path.*$")
+ (string-append "basic_path ='" data "'\n")))
+ (substitute* "LIB/gra_files.py"
+ (("basic_path = b_path\\.replace\\('/LIB',''\\)")
+ (string-append "basic_path ='" data "'\n")))
+
+ ;; The game must save in the user's home directory because
+ ;; the store is read-only.
+ (substitute* "main.py"
+ (("home_save = False") "home_save = True")
+ (("'icon_small.png'")
+ (string-append "'" data "/icon_small.png'"))))
+ #t))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (data (string-append
+ out "/share/games/roguebox-adventures"))
+ (doc (string-append out "/share/doc")))
+ (mkdir-p bin)
+ (mkdir-p doc)
+
+ (copy-file "main.py"
+ (string-append bin "/roguebox-adventures"))
+ (chmod (string-append bin "/roguebox-adventures") #o555)
+
+ (for-each (lambda (file)
+ (copy-recursively file
+ (string-append data "/" file)))
+ '("AUDIO" "FONT" "GRAPHIC" "LIB" "LICENSE"
+ "icon_big.png" "icon_small.png"))
+
+ (copy-file "DOC" (string-append doc "/roguebox-adventures"))
+
+ (wrap-program (string-append bin "/roguebox-adventures")
+ `("PYTHONPATH" ":" prefix (,(string-append data "/LIB")))))
+ #t)))))
+ (inputs
+ `(("python-pygame" ,python-pygame)
+ ("python-tmx" ,python-tmx)))
+ (home-page "https://rogueboxadventures.tuxfamily.org")
+ (synopsis "A classical roguelike/sandbox game")
+ (description
+ "RogueBox Adventures is a graphical roguelike with strong influences
+from sandbox games like Minecraft or Terraria. The main idea of RogueBox
+Adventures is to offer the player a kind of roguelike toy-world. This world
+can be explored and changed freely.")
+ ;; The GPL3+ is for code, the rest are for art.
+ (license (list license:cc0
+ license:cc-by3.0
+ license:gpl3+
+ license:silofl1.1)))))
+
(define-public xshogi
(package
(name "xshogi")
--
2.15.0
Leo Famulari wrote 7 years ago
(name . Kei Kebreau)(address . kkebreau@posteo.net)
20171126231316.GA22939@jasmine.lan
On Sat, Nov 25, 2017 at 04:09:28PM -0500, Kei Kebreau wrote:

Thanks! Overall LGTM, but I have some nitpicks...

Toggle quote (4 lines)
> + (package
> + (name "roguebox-adventures")
> + (version (string-append "2.1.2." revision "." (string-take commit 7)))

How about (version (git-version "2.1.2" revision commit)) ?

Toggle quote (7 lines)
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://git.postactiv.com/themightyglider/RogueBoxAdventures")
> + (commit commit)))

And similarly, (file-name (git-file-name name version))

Toggle quote (4 lines)
> + (replace 'build
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let* ((out (assoc-ref outputs "out"))
> + (data (string-append
^
There are too many spaces here --| and also in the install phase.

Toggle quote (15 lines)
> + (mkdir-p bin)
> + (mkdir-p doc)
> +
> + (copy-file "main.py"
> + (string-append bin "/roguebox-adventures"))
> + (chmod (string-append bin "/roguebox-adventures") #o555)
> +
> + (for-each (lambda (file)
> + (copy-recursively file
> + (string-append data "/" file)))
> + '("AUDIO" "FONT" "GRAPHIC" "LIB" "LICENSE"
> + "icon_big.png" "icon_small.png"))
> +
> + (copy-file "DOC" (string-append doc "/roguebox-adventures"))

And we could simplify a bit by using install-file instead of mkdir-p and
copy-file.
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlobSosACgkQJkb6MLrK
fwiUXhAA6i5jS3qy1GB2XEX8AmSyS54HFcTydjq0k9ghJ8z6/SO0a1F6cbIlgsKv
mYBKVepb2X9U9j3cl+gVr5hNc7pPNnGNwjtNFAO5wT+Wdv/CntFVJm9Ekid/arzW
TGrX1Zy+akXZTA8Go2zyO/C71bUWzwfLimtRqDhIpK97vwXpFlQpRmmkAbWiLhjA
/D1B/fj4r3HK1YA2FRS6ZKulDKR7fQF75NPDy+zKqMvY6/35fHh2h0/z+H2xKhXU
BeapeuoYNHAvj2tDUkb509CeNSIsizzQFmdzDJCRZEIntkW9EvfuoBg8FRrsRI1G
M290la7ddY7+groKbIv2FAYj8mZFz81NlGktbjPzvMs6YVbv49xUooFXN4LEsUWL
ibudELRXGKsYOiWo62ljN7L0b1WveKiJSUfxAjDsfdTfAxJZVT5KJWUJC03p4ON/
4wsPRdsOKysVS9pW2ENWljieUNXsORdfpfcxXP8FuXh0v0CmWEirON6tpGOcTRwg
8nBcCjycJR6axvBdmyA+mwj1xUe+397H1YnHfRovbp5BrU6Bi5IPAVUm/3T6OEyH
iapvBn6v2zzVehVkSBrH7Zo0fF6HzSIlqsOI7HxU98+ktTTSQMr7Z1Zd8Sb3hc+P
CqxAG1+0D16tR4fto0+z02NjaRCY7pZ5hMCp8R0VA/ENXGogEJA=
=TNPp
-----END PGP SIGNATURE-----


Kei Kebreau wrote 7 years ago
(name . Leo Famulari)(address . leo@famulari.name)(address . 29445@debbugs.gnu.org)
87zi7741nf.fsf@posteo.net
Leo Famulari <leo@famulari.name> writes:

Toggle quote (46 lines)
> On Sat, Nov 25, 2017 at 04:09:28PM -0500, Kei Kebreau wrote:
>
> Thanks! Overall LGTM, but I have some nitpicks...
>
>> + (package
>> + (name "roguebox-adventures")
>> + (version (string-append "2.1.2." revision "." (string-take commit
>> 7)))
>
> How about (version (git-version "2.1.2" revision commit)) ?
>
>> + (source
>> + (origin
>> + (method git-fetch)
>> + (uri (git-reference
>> + (url
>> "https://git.postactiv.com/themightyglider/RogueBoxAdventures")
>> + (commit commit)))
>
> And similarly, (file-name (git-file-name name version))
>
>> + (replace 'build
>> + (lambda* (#:key outputs #:allow-other-keys)
>> + (let* ((out (assoc-ref outputs "out"))
>> + (data (string-append
> ^
> There are too many spaces here --| and also in the install phase.
>
>> + (mkdir-p bin)
>> + (mkdir-p doc)
>> +
>> + (copy-file "main.py"
>> + (string-append bin "/roguebox-adventures"))
>> + (chmod (string-append bin "/roguebox-adventures") #o555)
>> +
>> + (for-each (lambda (file)
>> + (copy-recursively file
>> + (string-append data "/" file)))
>> + '("AUDIO" "FONT" "GRAPHIC" "LIB" "LICENSE"
>> + "icon_big.png" "icon_small.png"))
>> +
>> + (copy-file "DOC" (string-append doc "/roguebox-adventures"))
>
> And we could simplify a bit by using install-file instead of mkdir-p and
> copy-file.

Is there a way to rename the file when using install-file? It's a bit
weird to have to run "main.py" to launch the game.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEg7ZwOtzKO2lLzi2m5qXuPBlGeg0FAlocv6UACgkQ5qXuPBlG
eg0hqhAAhA3xcDmJM1wiQWDDX3wgeqiC8mxSnAfn/BN9nrez0B/VbsPO2VubAdTT
UN9epHTBvFTAmRHjYnSjWjVf3yVMl0vKnCELPti6vMDmOHCY15GVJeME3t9/v8Wo
bc8tPHBm/sfou9LtkM+03Q7TZ4Eri0EeWif9lQA7sDKXEriE46sy3vwAIwOK1YgF
ogd2NDEe2viSG8Zh4BUKF70JkgCtXmkBusr5igmPP5UwvE1ePnsToWaox9sicZkW
0PUdV9MVtNizDKBY7QZONFC5NHgtQrTwJDNhBNWrpaxiurqOabdpYenUUyrPsMeM
QixxzgqQn0UIebgWE/UACpbMnlYKsKevSbxFOAqZBj4iAXwG2adbHah6KlAv4btP
tCH9MWscYGrMOCDrBJ7Ve8IloNGF5QpwEtXJYBhLZgDGHoCxYPOCnScAQSDb8dbb
pjkadGf1kaXWfWXZVTpqA/DtzdCKuk8rvV2jriKGpVEGgzGyPvuCa1zXTarH/++M
cr3Mq2YcfCrE3kOYH50eBNpTXSoWqwth0dpPfOJNMFiDuv/eWmu2XrnQJW9hAhWh
tu5lquoXiCX5o600lhFHNwxS3+iLEmyEgzoWx6P1KlTQ3WT4Z2oeJo9uTY7uD8EO
GyusWo3fhzixmGzGoW/Qq6FZ1r5TFOW3xJvykfMITdNmHRM+pNA=
=leoC
-----END PGP SIGNATURE-----

Leo Famulari wrote 7 years ago
(name . Kei Kebreau)(address . kkebreau@posteo.net)(address . 29445@debbugs.gnu.org)
20171128021708.GA6171@jasmine.lan
On Mon, Nov 27, 2017 at 07:12:54PM -0500, Kei Kebreau wrote:
Toggle quote (11 lines)
> Leo Famulari <leo@famulari.name> writes:
> > On Sat, Nov 25, 2017 at 04:09:28PM -0500, Kei Kebreau wrote:
> >> + (copy-file "main.py"
> >> + (string-append bin "/roguebox-adventures"))
> >
> > And we could simplify a bit by using install-file instead of mkdir-p and
> > copy-file.
>
> Is there a way to rename the file when using install-file? It's a bit
> weird to have to run "main.py" to launch the game.

Oh, I missed that we were renaming things here. No, install-file doesn't
let you rename the file, so mkdir-p and copy-file are the way to go.
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlocxyQACgkQJkb6MLrK
fwgXohAA1Zj482Jx9BsIpufHf9XHMKqsjiT+G07G7Og0FdpV1FQtdcNwWRK6LpBF
0pnt4ARM0QU3ZRJ/BPj56kISQs8DAc/0F/Ph33UMkL6JM2fmOBtdEqSdWsh6iGrI
aC1ldv+PB1s39o3lDJo1G2GjmbpryMOZqFzbMS2aW+xi9RhEWJS1EasJIRaLWn+D
XgCahpwjswArpl2NXCvcbQ6gBUtwGYzwArJXpNG23/2XBZAVfgk6ZlvWpJXf0Jbv
X8pworoAMBISUS7wV5kGIXhBOfYj4p7jousgQNSjuur5oSf5SHR6Mrxd8wb8eQGt
hlClVJLZm7UGt2PehqMG3XxOGFw7E90L3xQQhjWxWATITmzF+Qka/srbWvODN5Qi
uYnbyYFvU4Wtc9C6L5njwu++lw4ovs0svqzhUCXjLyiNKOdHOmp+EyllEib4Qw00
qw4uz5H/gHKa5+K+ekHtbFYkHYTOcDo58kG2/sg9EVeoMqGciEsYtR9WsDcZwbHC
VNSlQiThfjC3Qkbt+quQsIDlwizw908MpJ2z6Btk0yGEkAiYIQHrImorALcrdgUi
OX8EG55SZbsxJbO25AikD/7ZJhGOY+E/m39bDAWUfoPT6Xo/TBcIbLCwPYvoDyuq
tLkdW7rpInM2r10QIOFZuMh2wyHMx7bqpssgRkdq22pbP+7C/0k=
=xdtT
-----END PGP SIGNATURE-----


Kei Kebreau wrote 7 years ago
(name . Leo Famulari)(address . leo@famulari.name)(address . 29445-done@debbugs.gnu.org)
87vahu4fna.fsf@posteo.net
Leo Famulari <leo@famulari.name> writes:

Toggle quote (15 lines)
> On Mon, Nov 27, 2017 at 07:12:54PM -0500, Kei Kebreau wrote:
>> Leo Famulari <leo@famulari.name> writes:
>> > On Sat, Nov 25, 2017 at 04:09:28PM -0500, Kei Kebreau wrote:
>> >> + (copy-file "main.py"
>> >> + (string-append bin "/roguebox-adventures"))
>> >
>> > And we could simplify a bit by using install-file instead of mkdir-p and
>> > copy-file.
>>
>> Is there a way to rename the file when using install-file? It's a bit
>> weird to have to run "main.py" to launch the game.
>
> Oh, I missed that we were renaming things here. No, install-file doesn't
> let you rename the file, so mkdir-p and copy-file are the way to go.

Alright, thank you for the review!
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEg7ZwOtzKO2lLzi2m5qXuPBlGeg0FAlodeMkACgkQ5qXuPBlG
eg2O6A//RB4XpKjwwV5/y/C095y9yhrM21zNfKbEicCMzpiBaI/a7JzXgurU0fhO
jEQQu9feoPT6DKJ1aUv4WHusyth4qTzmGc2jgcU63N4XfXLwnAegDSFibuCqTjIJ
77/3NWgBg8tUpAcAaMk9O69zmFlF084u+jvnO37/0hEZS26t5GP3cZL1CMMiy2LR
BA8/Smi9iqLoSaIu9jGkVOHNQwYwWxJxRGZb4DAvLbjf04qnLVahcf8/PxILdp+f
2DRj7mDlgKxwI1lKz5zQ+PiNnh6c0aOkQWb2wiKYxAnGXZWsvauj2NCmp8hulsON
TDHJvKMSYIJzQWY/4SYvS39usSiLhf/xusfnlo7A5aO1MLlX9sFH0tWzF+f3QzVy
FzzsjgTq5YrdR0oCokr7fWCRk3YaGGjJgie8zsdFkBoR4kU0h7xf9+cPUohIOypg
j0ICIiKNPW91xwOwk43mkTimitOzZrLx5zQnPCgbqZDn7tuwuK0gOrwhkc7bhrVe
6wGAyYwiijpslAA51pz7y9PiaAV2WQIDg1kAn+OpFWzUT6ClX8Q4gQKVuLVCcZwk
0sTW13eAAUeMHOomAKDIP7muSc52lqGNPaWWLesyLt3sj13H3Wd/A697mcOM5J81
bq2o+SsHm1hkKm33iRNiBuEPS4teDtsWnjQoteaiLMQ9l77+H0k=
=+Yk5
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 29445@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 29445
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help