[bug#36477,v4,07/23] gnu: eudev: Fix cross-compilation.
diff mbox series

Message ID 20191002095904.6325-8-m.othacehe@gmail.com
State New
Headers show
  • System cross-compilation
Related show

Commit Message

Mathieu Othacehe Oct. 2, 2019, 9:58 a.m. UTC
* gnu/packages/linux.scm (eudev)[arguments]: Look for xsltproc in both
native-inputs and inputs. Also, do not run udevadm when cross-compiling.

We need to find another way to generate hwdb.bin file for cross-built systems.
 gnu/packages/linux.scm | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff mbox series

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 461c019d64..c40072a706 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2576,7 +2576,7 @@  from the module-init-tools project.")
               (patches (search-patches "eudev-rules-directory.patch"))))
     (build-system gnu-build-system)
-     '(#:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'make-source-writable
            (lambda _
@@ -2585,19 +2585,25 @@  from the module-init-tools project.")
              (for-each make-file-writable (find-files "."))
          (add-before 'bootstrap 'patch-file-names
-           (lambda* (#:key inputs #:allow-other-keys)
+           (lambda* (#:key inputs native-inputs #:allow-other-keys)
             (substitute* "man/make.sh"
-                (string-append (assoc-ref inputs "xsltproc")
+               (string-append (assoc-ref
+                               (or native-inputs inputs) "xsltproc")
          (add-after 'install 'build-hwdb
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Build OUT/etc/udev/hwdb.bin.  This allows 'lsusb' and
              ;; similar tools to display product names.
+             ;;
+             ;; XXX: This can't be done when cross-compiling. Find another way
+             ;; to generate hwdb.bin for cross-built systems.
              (let ((out (assoc-ref outputs "out")))
-               (invoke (string-append out "/bin/udevadm")
-                       "hwdb" "--update")))))
+               ,@(if (%current-target-system)
+                     '(#t)
+                     '((invoke (string-append out "/bin/udevadm")
+                               "hwdb" "--update")))))))
        #:configure-flags (list "--enable-manpages")))
      `(("autoconf" ,autoconf)