gnu: hwinfo: Make with flags.

* gnu/packages/hardware.scm (hwinfo)[arguments]: Move CC, LIBDIR, and
VERSION from hacky substitutions to superior #:make-flags.  Honour them
in the 'build phase.
This commit is contained in:
Tobias Geerinckx-Rice 2023-07-16 02:00:01 +02:00
parent 84779e6271
commit 4c20d7a661
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -362,6 +362,10 @@ operability and find drivers.")
(arguments (arguments
(list (list
#:tests? #f ; no test-suite available #:tests? #f ; no test-suite available
#:make-flags
#~(list (string-append "CC=" #$(cc-for-target))
(string-append "LIBDIR=" #$output:lib "/lib")
(string-append "VERSION=" #$version))
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'patch (add-after 'unpack 'patch
@ -378,10 +382,6 @@ operability and find drivers.")
(string-append "OUTPUT_DIRECTORY = " doc "/libhd"))) (string-append "OUTPUT_DIRECTORY = " doc "/libhd")))
;; Correct values of the version and install directories. ;; Correct values of the version and install directories.
(substitute* "Makefile" (substitute* "Makefile"
(("VERSION.*\\:=.*$")
(string-append "VERSION := " #$version "\n"))
(("LIBDIR.*\\?=.*$")
(string-append "LIBDIR ?= " lib "\n"))
(("/usr/include") include) (("/usr/include") include)
(("/(usr|var)/(lib|lib64)") lib) (("/(usr|var)/(lib|lib64)") lib)
(("/usr/sbin") sbin) (("/usr/sbin") sbin)
@ -400,9 +400,8 @@ operability and find drivers.")
(delete 'configure) (delete 'configure)
(replace 'build (replace 'build
(lambda* (#:key make-flags #:allow-other-keys) (lambda* (#:key make-flags #:allow-other-keys)
(setenv "CC" #$(cc-for-target)) (apply invoke "make" "shared" make-flags)
(invoke "make" "shared") (apply invoke "make" "doc" make-flags)))
(invoke "make" "doc")))
(add-after 'install 'install-man-pages (add-after 'install 'install-man-pages
(lambda _ (lambda _
(for-each (for-each