guix_mirror_bot pushed a commit to branch misc-world-rebuild
in repository guix.

commit 43d768d964a85b1849a8b0fd04487f3d465736bc
Author: Nicolas Graves <[email protected]>
AuthorDate: Tue Apr 14 02:34:49 2026 +0200

    gnu: tk: Improve style.
    
    * gnu/packages/tcl.scm (tk)[arguments]: Re-order keywords.
      <#:phases>: Rewrite phases to use #$output and search-input-file.
      [inputs]: Drop input labels.
    
    Change-Id: Ia00d370d1281d566380af79addb7ae3c0e15f768
    Signed-off-by: Nguyễn Gia Phong <[email protected]>
---
 gnu/packages/tcl.scm | 71 ++++++++++++++++++++++++----------------------------
 1 file changed, 33 insertions(+), 38 deletions(-)

diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
index 8741548329..e35dcb8b1a 100644
--- a/gnu/packages/tcl.scm
+++ b/gnu/packages/tcl.scm
@@ -216,45 +216,40 @@ X11 GUIs.")
              (patches (search-patches "tk-find-library.patch"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases (modify-phases %standard-phases
-                  (add-before 'configure 'pre-configure
-                    (lambda _ (chdir "unix")))
-                  (add-after 'install 'create-wish-symlink
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      (let ((out (assoc-ref outputs "out")))
-                        (symlink (string-append out "/bin/wish"
-                                                ,(version-major+minor
-                                                  (package-version tk)))
-                                 (string-append out "/bin/wish")))))
-                  (add-after 'install 'add-fontconfig-flag
-                    (lambda* (#:key inputs outputs #:allow-other-keys)
-                      ;; Add the missing -L flag for Fontconfig in 'tk.pc' and
-                      ;; 'tkConfig.sh'.
-                      (let ((out        (assoc-ref outputs "out"))
-                            (fontconfig (assoc-ref inputs "fontconfig")))
-                        (substitute* (find-files out
-                                                 "^(tkConfig\\.sh|tk\\.pc)$")
-                          (("-lfontconfig")
-                           (string-append "-L" fontconfig
-                                          "/lib -lfontconfig")))))))
-
-       #:configure-flags
-       (list (string-append "--with-tcl="
-                            (assoc-ref %build-inputs "tcl")
-                            "/lib")
-             ;; This is needed when cross-compiling, see:
-             ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
-             ,@(if (%current-target-system)
-                   '("tcl_cv_strtod_buggy=1"
-                     "ac_cv_func_strtod=yes")
-                   '()))
-
-       ;; The tests require a running X server, so we just skip them.
-       #:tests? #f))
+     (list
+      ;; The tests require a running X server, so we just skip them.
+      #:tests? #f
+      #:configure-flags
+      #~(list (string-append "--with-tcl="
+                             (assoc-ref %build-inputs "tcl") "/lib")
+              ;; This is needed when cross-compiling, see:
+              ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
+              #$@(if (%current-target-system)
+                     '("tcl_cv_strtod_buggy=1" "ac_cv_func_strtod=yes")
+                     '()))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'configure 'pre-configure
+            (lambda _
+              (chdir "unix")))
+          (add-after 'install 'create-wish-symlink
+            (lambda _
+              (let ((version #$(version-major+minor (package-version tk)))
+                    (dest (string-append #$output "/bin/wish")))
+                (symlink (string-append dest version)
+                         dest))))
+          (add-after 'install 'add-fontconfig-flag
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              ;; Add the missing -L flag for Fontconfig in 'tk.pc' and
+              ;; 'tkConfig.sh'.
+              (let ((fontconfig (search-input-file inputs
+                                                   "lib/libfontconfig.so")))
+                (substitute* (find-files #$output "^(tkConfig\\.sh|tk\\.pc)$")
+                  (("-lfontconfig")
+                   (string-append "-L" (dirname fontconfig)
+                                  " -lfontconfig")))))))))
     (native-inputs (list pkg-config))
-    (inputs `(("libxft" ,libxft)
-              ("fontconfig" ,fontconfig)
-              ("tcl" ,tcl)))
+    (inputs (list libxft fontconfig tcl))
     ;; tk.h refers to X11 headers, hence the propagation.
     (propagated-inputs (list libx11 libxext))
 

Reply via email to