all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Timotej Lazar <timotej.lazar@araneo.si>
To: 70235@debbugs.gnu.org
Cc: "Timotej Lazar" <timotej.lazar@araneo.si>,
	"Adam Faiz" <adam.faiz@disroot.org>,
	"Liliana Marie Prikler" <liliana.prikler@gmail.com>,
	宋文武 <iyzsong@envs.net>
Subject: [bug#70235] [PATCH 2/2] gnu: widelands: Improve package style.
Date: Sat,  6 Apr 2024 10:44:03 +0200	[thread overview]
Message-ID: <ce57cee3cbdf379c178d3475dac259255b0baaab.1712392636.git.timotej.lazar@araneo.si> (raw)
In-Reply-To: <cover.1712392635.git.timotej.lazar@araneo.si>

* gnu/packages/games.scm (widelands): Use new package style.
[snippet]: Simplify and drop trailing #t.
[arguments]: Use gexps. Tweak #:configure-flags to install the binary in bin/
instead of bin/games/ and data under share/ instead of bin/share/. Modify
'unbundle-fonts phase to not depend on input labels.
[inputs, native-inputs]: Drop input labels.
[home-page]: Drop trailing slash.

Change-Id: I75c535005ad1325ad170205b6e80b1039125619a
---
 gnu/packages/games.scm | 85 +++++++++++++++++++++---------------------
 1 file changed, 42 insertions(+), 43 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 78aedca434..b788c7c774 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -5791,58 +5791,57 @@ (define-public widelands
      (origin
        (method git-fetch)
        (uri (git-reference
-              (url "https://github.com/widelands/widelands")
-              (commit (string-append "v" version))))
+             (url "https://github.com/widelands/widelands")
+             (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
         (base32 "1m9hn1sh1siggribzsq79k7p0lggdw41ji7zdl6h648cjak9mdsp"))
        (modules '((guix build utils)))
        (snippet
-        '(begin
-           (delete-file-recursively "src/third_party/minizip")
-           #t))))
+        #~(delete-file-recursively "src/third_party/minizip"))))
     (build-system cmake-build-system)
     (arguments
-     `(#:configure-flags
-       (let* ((out (assoc-ref %outputs "out"))
-              (share (string-append out "/share")))
-         (list (string-append "-DCMAKE_INSTALL_PREFIX=" out "/bin")
-               (string-append "-DWL_INSTALL_BASEDIR=" share "/widelands")
-               (string-append "-DWL_INSTALL_DATADIR=" share "/widelands")
-               "-DOPTION_BUILD_WEBSITE_TOOLS=OFF"
-               ;; CMakeLists.txt does not handle properly RelWithDebInfo build
-               ;; type.  When used, no game data is installed!
-               "-DCMAKE_BUILD_TYPE=Release"))
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'unbundle-fonts
-           ;; Unbundle fonts already packaged in Guix.  XXX: missing fonts are
-           ;; amiri, Culmus, mmrCensus, Nakula, and Sinhala.
-           (lambda* (#:key inputs #:allow-other-keys)
-             (with-directory-excursion "data/i18n/fonts"
-               (for-each (lambda (font)
-                           (delete-file-recursively font)
-                           (symlink (string-append (assoc-ref inputs font)
-                                                   "/share/fonts/truetype")
-                                    font))
-                         '("DejaVu" "MicroHei")))
-             #t)))))
+     (list
+      #:configure-flags
+      #~(let ((share (string-append #$output "/share/widelands")))
+          (list (string-append "-DCMAKE_INSTALL_PREFIX=" #$output)
+                (string-append "-DWL_INSTALL_BINDIR=" #$output "/bin")
+                (string-append "-DWL_INSTALL_BASEDIR=" share)
+                (string-append "-DWL_INSTALL_DATADIR=" share)
+                "-DOPTION_BUILD_WEBSITE_TOOLS=OFF"
+                ;; CMakeLists.txt does not handle properly RelWithDebInfo build
+                ;; type.  When used, no game data is installed!
+                "-DCMAKE_BUILD_TYPE=Release"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'unbundle-fonts
+            ;; Unbundle fonts already packaged in Guix.  XXX: missing fonts are
+            ;; amiri, Culmus, mmrCensus, Nakula, and Sinhala.
+            (lambda* (#:key inputs #:allow-other-keys)
+              (for-each
+               (lambda (font)
+                 (let* ((path (string-append "share/fonts/truetype/" (basename font)))
+                        (target (false-if-exception (search-input-file inputs path))))
+                   (when target
+                     (delete-file font)
+                     (symlink target font))))
+               (find-files "data/i18n/fonts" "\\.tt[cf]$")))))))
     (native-inputs
-     `(("gettext" ,gettext-minimal)
-       ("pkg-config" ,pkg-config)
-       ("python" ,python)))
+     (list gettext-minimal pkg-config python))
     (inputs
-     `(("asio" ,asio)
-       ("glew" ,glew)
-       ("icu4c" ,icu4c)
-       ("libpng" ,libpng)
-       ("minizip" ,minizip)
-       ("sdl" ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))
-       ("zlib" ,zlib)
-       ;; Fonts for the ‘unbundle-fonts’ phase.  Case matters in name!
-       ("DejaVu" ,font-dejavu)
-       ("MicroHei" ,font-wqy-microhei)))
-    (home-page "https://www.widelands.org/")
+     (list asio
+           font-dejavu
+           font-wqy-microhei
+           glew
+           icu4c
+           libpng
+           minizip
+           sdl2
+           sdl2-image
+           sdl2-mixer
+           sdl2-ttf
+           zlib))
+    (home-page "https://www.widelands.org")
     (synopsis "Fantasy real-time strategy game")
     (description
      "In Widelands, you are the regent of a small clan.  You start out with
-- 
2.41.0





  parent reply	other threads:[~2024-04-06  8:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06  8:37 [bug#70235] [PATCH 0/2] Update widelands Timotej Lazar
2024-04-06  8:44 ` [bug#70235] [PATCH 1/2] gnu: widelands: Update to 1.2 Timotej Lazar
2024-04-06  8:44 ` Timotej Lazar [this message]
2024-04-15  9:51 ` bug#70235: [PATCH 0/2] Update widelands Christopher Baines

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=ce57cee3cbdf379c178d3475dac259255b0baaab.1712392636.git.timotej.lazar@araneo.si \
    --to=timotej.lazar@araneo.si \
    --cc=70235@debbugs.gnu.org \
    --cc=adam.faiz@disroot.org \
    --cc=iyzsong@envs.net \
    --cc=liliana.prikler@gmail.com \
    /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.