all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vinicius Monego <monego@posteo.net>
To: 48952@debbugs.gnu.org
Cc: Vinicius Monego <monego@posteo.net>
Subject: [bug#48952] [PATCH v2 2/6] gnu: superstarfighter: Use godot-build-system.
Date: Tue, 21 Dec 2021 23:55:44 +0000	[thread overview]
Message-ID: <20211221235548.130808-3-monego@posteo.net> (raw)
In-Reply-To: <20211221235548.130808-1-monego@posteo.net>

* gnu/packages/games.scm (superstarfighter)[build-system]: Use
godot-build-system.
[arguments]: Remove #:tests?. <#:game, #:project-directory>: New fields.
<#:phases>: Do not replace configure, build and install. Add phase
'install-desktop-file after 'install.
---
 gnu/packages/games.scm | 54 +++++++++---------------------------------
 1 file changed, 11 insertions(+), 43 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 6258d65f97..a701f7aa94 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -67,6 +67,7 @@
 ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
 ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2021 Christopher Baines <mail@cbaines.net>
+;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -209,6 +210,7 @@
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
+  #:use-module (guix build-system godot)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
@@ -2562,59 +2564,25 @@ modify quests for the Solarus engine.")))
              (commit "32521f467616bb390e3929d07e1936ff43fe64da")))
        (file-name (git-file-name name version))
        (sha256
+
         (base32 "1ckghzrfgvk9z1n5f4ivnamm6s8h9sbv0a3aq9pp4a3yrhkgld0k"))))
-    (build-system gnu-build-system)
+    (build-system godot-build-system)
     (arguments
-     `(#:tests? #f                      ;there are no tests
+     `(#:game ,name
+       #:project-directory "godot"
        #:phases
        (modify-phases %standard-phases
-         (replace 'configure
-           (lambda _
-             (chdir "godot")
-             (setenv "HOME" (getcwd))
-             (with-output-to-file "export_presets.cfg"
-               (lambda ()
-                 (display
-                  "[preset.0]
-name=\"Guix\"
-platform=\"Linux/X11\"
-runnable=true
-[preset.0.options]")))
-             #t))
-         (replace 'build
-           (lambda _
-             (let ((godot (assoc-ref %build-inputs "godot-headless")))
-               (invoke (string-append godot "/bin/godot_server")
-                       "--export-pack" "Guix"
-                       "superstarfighter.pck" "project.godot"))
-             #t))
-         (replace 'install
-           (lambda* (#:key inputs outputs #:allow-other-keys)
+         (add-after 'install 'install-desktop-file
+           (lambda* (#:key inputs outputs game #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin"))
-                    (share (string-append out "/share"))
-                    (data (string-append share "/superstarfighter"))
-                    (icons (string-append share "/icons/hicolor/256x256/apps")))
-               (install-file "superstarfighter.pck" data)
-               (mkdir-p bin)
-               (call-with-output-file (string-append bin "/superstarfighter")
-                 (lambda (port)
-                   (format port
-                           "#!/bin/sh~@
-                            exec ~a/bin/godot --main-pack ~a/superstarfighter.pck~%"
-                           (assoc-ref inputs "godot")
-                           data)
-                   (chmod port #o755)))
-               (mkdir-p icons)
-               (copy-file "icon.png" (string-append icons "/" ,name ".png"))
+                    (share (string-append out "/share")))
                (make-desktop-entry-file
-                (string-append share "/applications/" ,name ".desktop")
+                (string-append share "/applications/" game ".desktop")
                 #:name "SuperStarfighter"
                 #:comment "Fast-paced arcade combat game"
                 #:exec ,name
                 #:icon ,name
-                #:categories '("Game" "ArcadeGame")))
-             #t)))))
+                #:categories '("Game" "ArcadeGame"))))))))
     (native-inputs
      `(("godot-headless" ,godot "headless")))
     (inputs
-- 
2.30.2





  parent reply	other threads:[~2021-12-21 23:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11  0:53 [bug#48952] [PATCH 0/3] build-system: Add godot-build-system Vinicius Monego
2021-06-11  0:55 ` [bug#48952] [PATCH 1/3] " Vinicius Monego
2021-06-11  0:55   ` [bug#48952] [PATCH 2/3] gnu: superstarfighter: Use godot-build-system Vinicius Monego
2021-06-11  0:55   ` [bug#48952] [PATCH 3/3] gnu: Add librerama Vinicius Monego
2021-12-21 23:55 ` [bug#48952] [PATCH v2 0/6] Add godot-build-system (v2) Vinicius Monego
2021-12-21 23:55   ` [bug#48952] [PATCH v2 1/6] build-system: Add godot-build-system Vinicius Monego
2021-12-21 23:55   ` Vinicius Monego [this message]
2021-12-21 23:55   ` [bug#48952] [PATCH v2 3/6] gnu: Add librerama Vinicius Monego
2021-12-21 23:55   ` [bug#48952] [PATCH v2 4/6] gnu: Add material-maker Vinicius Monego
2021-12-21 23:55   ` [bug#48952] [PATCH v2 5/6] gnu: Add pixelorama Vinicius Monego
2021-12-21 23:55   ` [bug#48952] [PATCH v2 6/6] gnu: Add lorien Vinicius Monego
2021-12-30  9:43   ` [bug#48952] [PATCH v2 0/6] Add godot-build-system (v2) Nicolas Goaziou
2021-12-30 15:28     ` Vinicius Monego
2022-01-28  9:49   ` Nicolas Goaziou

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=20211221235548.130808-3-monego@posteo.net \
    --to=monego@posteo.net \
    --cc=48952@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.