unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: 71067@debbugs.gnu.org
Cc: ngraves@ngraves.fr
Subject: [bug#71067] [PATCH 2/2] gnu: godot-lts: Improve package style.
Date: Sun, 19 May 2024 18:16:06 +0200	[thread overview]
Message-ID: <20240519161612.700-2-ngraves@ngraves.fr> (raw)
In-Reply-To: <20240519161612.700-1-ngraves@ngraves.fr>

* gnu/packages/game-development.scm (godot-lts): Re-indent and ensure
max column length to 79.
  [arguments]: Use gexp.

Change-Id: I0bedb66a4e7e0ebe6242df885f1e687ce3a43ce0
---
 gnu/packages/game-development.scm | 166 ++++++++++++++++--------------
 1 file changed, 88 insertions(+), 78 deletions(-)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 9591fae7f9e..03b6f1df8b9 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
 ;;; Copyright © 2022 dan <i@dan.games>
 ;;; Copyright © 2023 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1972,86 +1973,95 @@ (define-public godot-lts
                               "vhacd"
                               "xatlas")))
                       (for-each delete-file-recursively
-                                (lset-difference string=?
-                                                 (scandir ".")
-                                                 (cons* "." ".." preserved-files)))))))))
+                                (lset-difference
+                                 string=?
+                                 (scandir ".")
+                                 (cons* "." ".." preserved-files)))))))))
     (build-system scons-build-system)
     (arguments
-     `(#:scons-flags (list "platform=x11" "target=release_debug"
-                           ;; Avoid using many of the bundled libs.
-                           ;; Note: These options can be found in the SConstruct file.
-                           "builtin_bullet=no"
-                           "builtin_freetype=no"
-                           "builtin_glew=no"
-                           "builtin_libmpdec=no"
-                           "builtin_libogg=no"
-                           "builtin_libpng=no"
-                           "builtin_libtheora=no"
-                           "builtin_libvorbis=no"
-                           "builtin_libvpx=no"
-                           "builtin_libwebp=no"
-                           "builtin_mbedtls=no"
-                           "builtin_opus=no"
-                           "builtin_pcre2=no"
-                           "builtin_wslay=no"
-                           "builtin_zlib=no"
-                           "builtin_zstd=no")
-       #:tests? #f                      ; There are no tests
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'scons-use-env
-           (lambda _
-             ;; Scons does not use the environment variables by default,
-             ;; but this substitution makes it do so.
-             (substitute* "SConstruct"
-               (("env_base = Environment\\(tools=custom_tools\\)")
-                (string-append
-                 "env_base = Environment(tools=custom_tools)\n"
-                 "env_base = Environment(ENV=os.environ)")))))
-         ;; Build headless tools, used for packaging games without depending on X.
-         (add-after 'build 'build-headless
-           (lambda* (#:key scons-flags #:allow-other-keys)
-             (apply invoke "scons"
-                    `(,(string-append "-j" (number->string (parallel-job-count)))
-                      "platform=server" ,@(delete "platform=x11" scons-flags)))))
-         (replace 'install
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (headless (assoc-ref outputs "headless"))
-                    (zenity (assoc-ref inputs "zenity")))
-               ;; Strip build info from filenames.
-               (with-directory-excursion "bin"
-                 (for-each
-                  (lambda (file)
-                    (let ((dest (car (string-split (basename file) #\.))))
-                      (rename-file file dest)))
-                  (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
-                 (install-file "godot" (string-append out "/bin"))
-                 (install-file "godot_server" (string-append headless "/bin")))
-               ;; Tell the editor where to find zenity for OS.alert().
-               (wrap-program (string-append out "/bin/godot")
-                 `("PATH" ":" prefix (,(string-append zenity "/bin")))))))
-         (add-after 'install 'wrap-ld-path
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (pulseaudio_path (string-append (assoc-ref inputs "pulseaudio") "/lib"))
-                    (alas_lib_path (string-append (assoc-ref inputs "alsa-lib") "/lib")))
-               (wrap-program (string-append out "/bin/godot")
-                 `("LD_LIBRARY_PATH" ":" prefix (,pulseaudio_path ,alas_lib_path))))))
-         (add-after 'install 'install-godot-desktop
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (applications (string-append out "/share/applications"))
-                    (icons (string-append out "/share/icons/hicolor")))
-               (mkdir-p applications)
-               (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
-                          (string-append applications "/godot.desktop"))
-               (for-each (lambda (icon dest)
-                           (mkdir-p (dirname dest))
-                           (copy-file icon dest))
-                         '("icon.png" "icon.svg")
-                         `(,(string-append icons "/256x256/apps/godot.png")
-                           ,(string-append icons "/scalable/apps/godot.svg")))))))))
+     (list
+      ;; Avoid using many of the bundled libs.
+      ;; Note: These options can be found in the SConstruct file.
+      #:scons-flags #~(list "platform=x11" "target=release_debug"
+                            "builtin_bullet=no"
+                            "builtin_freetype=no"
+                            "builtin_glew=no"
+                            "builtin_libmpdec=no"
+                            "builtin_libogg=no"
+                            "builtin_libpng=no"
+                            "builtin_libtheora=no"
+                            "builtin_libvorbis=no"
+                            "builtin_libvpx=no"
+                            "builtin_libwebp=no"
+                            "builtin_mbedtls=no"
+                            "builtin_opus=no"
+                            "builtin_pcre2=no"
+                            "builtin_wslay=no"
+                            "builtin_zlib=no"
+                            "builtin_zstd=no")
+      #:tests? #f                      ; There are no tests
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'scons-use-env
+            (lambda _
+              ;; Scons does not use the environment variables by default,
+              ;; but this substitution makes it do so.
+              (substitute* "SConstruct"
+                (("env_base = Environment\\(tools=custom_tools\\)")
+                 (string-append
+                  "env_base = Environment(tools=custom_tools)\n"
+                  "env_base = Environment(ENV=os.environ)")))))
+          ;; Build headless tools, to package games without depending on X.
+          (add-after 'build 'build-headless
+            (lambda* (#:key scons-flags #:allow-other-keys)
+              (apply invoke "scons"
+                     `(,(string-append
+                         "-j" (number->string (parallel-job-count)))
+                       "platform=server"
+                       ,@(delete "platform=x11" scons-flags)))))
+          (replace 'install
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (headless (assoc-ref outputs "headless"))
+                     (zenity (assoc-ref inputs "zenity")))
+                ;; Strip build info from filenames.
+                (with-directory-excursion "bin"
+                  (for-each
+                   (lambda (file)
+                     (let ((dest (car (string-split (basename file) #\.))))
+                       (rename-file file dest)))
+                   (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
+                  (install-file "godot" (string-append out "/bin"))
+                  (install-file "godot_server"
+                                (string-append headless "/bin")))
+                ;; Tell the editor where to find zenity for OS.alert().
+                (wrap-program (string-append out "/bin/godot")
+                  `("PATH" ":" prefix (,(string-append zenity "/bin")))))))
+          (add-after 'install 'wrap-ld-path
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (pulseaudio_path (string-append
+                                       (assoc-ref inputs "pulseaudio") "/lib"))
+                     (alas_lib_path (string-append
+                                     (assoc-ref inputs "alsa-lib") "/lib")))
+                (wrap-program (string-append out "/bin/godot")
+                  `("LD_LIBRARY_PATH" ":" prefix
+                    (,pulseaudio_path ,alas_lib_path))))))
+          (add-after 'install 'install-godot-desktop
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (applications (string-append out "/share/applications"))
+                     (icons (string-append out "/share/icons/hicolor")))
+                (mkdir-p applications)
+                (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
+                           (string-append applications "/godot.desktop"))
+                (for-each (lambda (icon dest)
+                            (mkdir-p (dirname dest))
+                            (copy-file icon dest))
+                          '("icon.png" "icon.svg")
+                          `(,(string-append icons "/256x256/apps/godot.png")
+                            ,(string-append icons
+                                            "/scalable/apps/godot.svg")))))))))
     (outputs '("out" "headless"))
     (native-inputs
      (list pkg-config))
-- 
2.41.0





      reply	other threads:[~2024-05-19 16:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-19 14:55 [bug#71067] [PATCH 0/2] Update godot-lts to 3.5.3 Nicolas Graves via Guix-patches via
2024-05-19 16:16 ` [bug#71067] [PATCH 1/2] gnu: godot-lts: Update " Nicolas Graves via Guix-patches via
2024-05-19 16:16   ` Nicolas Graves via Guix-patches via [this message]

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20240519161612.700-2-ngraves@ngraves.fr \
    --to=guix-patches@gnu.org \
    --cc=71067@debbugs.gnu.org \
    --cc=ngraves@ngraves.fr \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).