guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: gnu: libkmahjongg: Make its tilset available to games.


From: guix-commits
Subject: 02/02: gnu: libkmahjongg: Make its tilset available to games.
Date: Sat, 5 Aug 2023 07:44:10 -0400 (EDT)

iyzsong pushed a commit to branch kde-updates
in repository guix.

commit 4c0a6635d81970da2f461757ff891f2528a57b5c
Author: 宋文武 <iyzsong@member.fsf.org>
AuthorDate: Sat Aug 5 19:36:49 2023 +0800

    gnu: libkmahjongg: Make its tilset available to games.
    
    * gnu/packages/kde-games.scm (libkmahjongg)[arguments]: Add a phase
    to add its "$out/share" to XDG_DATA_DIRS.
---
 gnu/packages/kde-games.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/kde-games.scm b/gnu/packages/kde-games.scm
index 9e2b885c2b..8ed530d83e 100644
--- a/gnu/packages/kde-games.scm
+++ b/gnu/packages/kde-games.scm
@@ -27,6 +27,7 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system qt)
+  #:use-module (guix gexp)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages gl)
@@ -184,6 +185,24 @@ This package is part of the KDE games module.")
       (sha256
        (base32 "1a0c0q34h5yxwx76y6934ibn6hm1ip1hc2xvl11q1kaazq0alca3"))))
     (build-system qt-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-tileset-dir
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              ;; Add "$out/share" to XDG_DATA_DIRS so that the default tileset
+              ;; is always available.
+              (substitute* "src/kmahjonggtileset.cpp"
+                (("_inited = true;")
+                 (format #f "QByteArray x = qgetenv(\"XDG_DATA_DIRS\");
+if (!x.isEmpty()) {
+  QString datadirs = QString::fromLocal8Bit(x) + QLatin1String(\":~a\");
+  qputenv(\"XDG_DATA_DIRS\", datadirs.toLocal8Bit());
+}
+_inited = true;"
+                         (string-append
+                          (assoc-ref outputs "out") "/share")))))))))
     (native-inputs
      (list extra-cmake-modules))
     (inputs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]