summary refs log tree commit diff
path: root/gnu/packages/slang.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-08-11 23:36:10 +0200
committerMarius Bakke <marius@gnu.org>2022-08-11 23:36:10 +0200
commit77eb3008e350c069e0ae8df6a91bf0ebdcfc2ac0 (patch)
treeb899e65aa79099be3f4b27dfcd565bb143681211 /gnu/packages/slang.scm
parentf7e8be231806a904e6817e8ab3404b32f2511db2 (diff)
parentb50eaa67642ebc25e9c896f2e700c08610e0a5da (diff)
downloadguix-77eb3008e350c069e0ae8df6a91bf0ebdcfc2ac0.tar.gz
Merge branch 'staging' into core-updates
Diffstat (limited to 'gnu/packages/slang.scm')
-rw-r--r--gnu/packages/slang.scm49
1 files changed, 28 insertions, 21 deletions
diff --git a/gnu/packages/slang.scm b/gnu/packages/slang.scm
index f335dc1a39..885fcf8c15 100644
--- a/gnu/packages/slang.scm
+++ b/gnu/packages/slang.scm
@@ -147,34 +147,41 @@ to inspect different parts of the same file, at the same time.")
     (inputs
      (list slang popt python fribidi))
     (arguments
-     `(#:tests? #f    ; no test suite
+     (list
+       #:tests? #f    ; no test suite
        #:configure-flags
        ;; Set the correct RUNPATH in binaries.
-       (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
+       #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
        #:make-flags
        ;; configure uses a hard-coded search of /usr/include/python* to set
        ;; this variable, and does not allow us to override it from the
        ;; command line.  Fortunately, the Makefile does, so provide it here.
-       (list (string-append "PYTHONVERS=python"
-                            ,(version-major+minor (package-version python))))
+       #~(list
+          (string-append "PYTHONVERS=python"
+                         #$(version-major+minor (package-version python))))
        #:phases
-       (modify-phases %standard-phases
-         (add-after
-          'unpack 'patch-/usr/bin/install
-          (lambda _
-            (substitute* "po/Makefile"
-              (("/usr/bin/install") "install"))
-            #t))
-         (add-after
-          'install 'move-python
-          (lambda* (#:key outputs #:allow-other-keys)
-            (let ((out  (assoc-ref outputs "out"))
-                  (py   (assoc-ref outputs "python"))
-                  (ver ,(version-major+minor (package-version python))))
-              (mkdir-p (string-append py "/lib"))
-              (rename-file (string-append out "/lib/python" ver)
-                           (string-append py  "/lib/python" ver))
-              #t))))))
+       #~(modify-phases %standard-phases
+           (add-after 'unpack 'patch-/usr/bin/install
+             (lambda _
+               (substitute* "po/Makefile"
+                 (("/usr/bin/install") "install"))))
+           (add-before 'build 'add-python-config-to-path
+             (lambda* (#:key target #:allow-other-keys)
+               ;; When cross-compiling python-config is not present in $PATH.
+               ;;
+               ;; It is a shell script without dependencies on target binaries
+               ;; so it can be run on the host to allow cross-compilation.
+               (when target
+                 (let ((path (getenv "PATH"))
+                       (py (string-append #$python "/bin")))
+                   (setenv "PATH" (string-append path ":" py))))))
+           (add-after 'install 'move-python
+             (lambda* _
+               (let ((ver #$(version-major+minor (package-version python))))
+                 (mkdir-p (string-append #$output:python "/lib"))
+                 (rename-file
+                   (string-append #$output "/lib/python" ver)
+                   (string-append #$output:python  "/lib/python" ver))))))))
     (home-page "https://pagure.io/newt")
     (synopsis "Not Erik's Windowing Toolkit - text mode windowing with slang")
     (description