diff mbox series

[bug#61865,3/8] gnu: libxtst: fix riscv64 cross-compile.

Message ID tencent_4654A90F590F7F003AE6E5E02507B5629B08@qq.com
State New
Headers show
Series fix some packages cross-compile | expand

Commit Message

Z572 Feb. 28, 2023, 8:33 a.m. UTC
* gnu/packages/xorg.scm(libxtst): fix riscv64 cross-compile
[arguments]: when target is riscv64, add phase to update config.{guess,sub}
[native-inputs]: when target is riscv64, add config.
---
 gnu/packages/xorg.scm | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 2b6f9fa369..2cc1523e3e 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -4658,13 +4658,28 @@  (define-public libxtst
             "012jpyj7xfm653a9jcfqbzxyywdmwb2b5wr1dwylx14f3f54jma6"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:configure-flags '("--disable-static")))
+     `(#:configure-flags '("--disable-static")
+       ,@(if (and (%current-target-system)
+                  (target-riscv64?))
+             `(#:phases
+               (modify-phases %standard-phases
+                 (add-after 'unpack 'update-config
+                   (lambda* (#:key native-inputs #:allow-other-keys)
+                     (install-file
+                      (search-input-file native-inputs "/bin/config.sub") ".")
+                     (install-file
+                      (search-input-file native-inputs "/bin/config.guess") ".")))))
+             '())))
     (propagated-inputs
      (list libxi xorgproto))
     (inputs
       (list libx11))
     (native-inputs
-      (list pkg-config))
+     `(,@(if (and (%current-target-system)
+                  (target-riscv64?))
+             (list config)
+             '())
+       ,pkg-config))
     (home-page "https://www.x.org/wiki/")
     (synopsis "Xorg library for Xtest and Record extensions")
     (description