diff options
| author | Tobias Geerinckx-Rice <me@tobias.gr> | 2023-07-16 02:00:01 +0200 |
|---|---|---|
| committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2023-07-16 02:00:02 +0200 |
| commit | f93605b32b2e356422cde043ea0f0ec3f7ac229d (patch) | |
| tree | 60cd74c471d97188113d3c7cc4c5a87223dda4f3 /gnu/packages/hardware.scm | |
| parent | 2349eb62e2dc10ad33d084ca635a648c1e840f17 (diff) | |
gnu: hwinfo: Use G-expressions.
* gnu/packages/hardware.scm (hwinfo)[source, arguments]:
Rewrite as G-expressions.
Diffstat (limited to 'gnu/packages/hardware.scm')
| -rw-r--r-- | gnu/packages/hardware.scm | 134 |
1 files changed, 65 insertions, 69 deletions
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm index cf2eb46ffb8..9445dd82d65 100644 --- a/gnu/packages/hardware.scm +++ b/gnu/packages/hardware.scm | |||
| @@ -346,78 +346,74 @@ operability and find drivers.") | |||
| 346 | (modules | 346 | (modules |
| 347 | '((guix build utils))) | 347 | '((guix build utils))) |
| 348 | (snippet | 348 | (snippet |
| 349 | `(begin | 349 | #~(begin |
| 350 | ;; Remove git2log program file. | 350 | ;; Remove git2log program file. |
| 351 | (delete-file "git2log") | 351 | (delete-file "git2log") |
| 352 | ;; Remove variables that depend on git2log. | 352 | ;; Remove variables that depend on git2log. |
| 353 | (substitute* "Makefile" | 353 | (substitute* "Makefile" |
| 354 | (("GIT2LOG.*\\:=.*$") "") | 354 | (("GIT2LOG.*\\:=.*$") "") |
| 355 | (("GITDEPS.*\\:=.*$") "") | 355 | (("GITDEPS.*\\:=.*$") "") |
| 356 | (("BRANCH.*\\:=.*$") "")) | 356 | (("BRANCH.*\\:=.*$") "")) |
| 357 | ;; Create version file. | 357 | ;; Create version file. |
| 358 | (call-with-output-file "VERSION" | 358 | (call-with-output-file "VERSION" |
| 359 | (lambda (port) | 359 | (lambda (port) (format port #$version))))))) |
| 360 | (format port ,version))))))) | ||
| 361 | (build-system gnu-build-system) | 360 | (build-system gnu-build-system) |
| 362 | (outputs '("out" "lib" "doc")) | 361 | (outputs '("out" "lib" "doc")) |
| 363 | (arguments | 362 | (arguments |
| 364 | `(#:tests? #f ; no test-suite available | 363 | (list |
| 365 | #:phases | 364 | #:tests? #f ; no test-suite available |
| 366 | (modify-phases %standard-phases | 365 | #:phases |
| 367 | (add-after 'unpack 'patch | 366 | #~(modify-phases %standard-phases |
| 368 | (lambda* (#:key outputs #:allow-other-keys) | 367 | (add-after 'unpack 'patch |
| 369 | (let* ((out (assoc-ref outputs "out")) | 368 | (lambda _ |
| 370 | (lib (assoc-ref outputs "lib")) | 369 | (let ((include (string-append #$output:lib "/include")) |
| 371 | (doc (assoc-ref outputs "doc")) | 370 | (lib (string-append #$output:lib "/lib")) |
| 372 | (incl-dir (string-append lib "/include")) | 371 | (sbin (string-append #$output "/sbin")) |
| 373 | (lib-dir (string-append lib "/lib")) | 372 | (share (string-append #$output "/share")) |
| 374 | (sbin-dir (string-append out "/sbin")) | 373 | (doc (string-append #$output:doc "/share/doc"))) |
| 375 | (share-dir (string-append out "/share")) | 374 | ;; Generate HTML documentation in the "doc" output. |
| 376 | (doc-dir (string-append doc "/share/doc"))) | 375 | (mkdir-p doc) |
| 377 | ;; Generate HTML documentation in the output "doc". | 376 | (substitute* "doc/libhd.doxy" |
| 378 | (mkdir-p doc-dir) | 377 | (("OUTPUT_DIRECTORY.*=.*libhd") |
| 379 | (substitute* "doc/libhd.doxy" | 378 | (string-append "OUTPUT_DIRECTORY = " doc "/libhd"))) |
| 380 | (("OUTPUT_DIRECTORY.*=.*libhd") | 379 | ;; Correct values of the version and install directories. |
| 381 | (string-append "OUTPUT_DIRECTORY = " doc-dir "/libhd"))) | 380 | (substitute* "Makefile" |
| 382 | ;; Correct values of the version and install directories. | 381 | (("VERSION.*\\:=.*$") |
| 383 | (substitute* "Makefile" | 382 | (string-append "VERSION := " #$version "\n")) |
| 384 | (("VERSION.*\\:=.*$") | 383 | (("LIBDIR.*\\?=.*$") |
| 385 | (string-append "VERSION := " ,version "\n")) | 384 | (string-append "LIBDIR ?= " lib "\n")) |
| 386 | (("LIBDIR.*\\?=.*$") | 385 | (("/usr/include") include) |
| 387 | (string-append "LIBDIR ?= " lib-dir "\n")) | 386 | (("/(usr|var)/(lib|lib64)") lib) |
| 388 | (("/usr/include") incl-dir) | 387 | (("/usr/sbin") sbin) |
| 389 | (("/(usr|var)/(lib|lib64)") lib-dir) | 388 | (("/usr/share") share) |
| 390 | (("/usr/sbin") sbin-dir) | 389 | (("\\$\\(DESTDIR\\)/sbin ") "")) |
| 391 | (("/usr/share") share-dir) | 390 | ;; Add the "lib" output to the run-path. |
| 392 | (("\\$\\(DESTDIR\\)/sbin ") "")) | 391 | (substitute* "Makefile.common" |
| 393 | ;; Add the "lib" output to the run-path. | 392 | (("-Lsrc") |
| 394 | (substitute* "Makefile.common" | 393 | (string-append "-Lsrc " "-Wl,-rpath=" lib))) |
| 395 | (("-Lsrc") | 394 | ;; Correct program name of the lexical analyzer. |
| 396 | (string-append "-Lsrc " "-Wl,-rpath=" lib-dir))) | 395 | (substitute* "src/isdn/cdb/Makefile" |
| 397 | ;; Correct program name of the lexical analyzer. | 396 | (("lex isdn_cdb.lex") "flex isdn_cdb.lex")) |
| 398 | (substitute* "src/isdn/cdb/Makefile" | 397 | ;; Patch pkg-config file to point to the "lib" output. |
| 399 | (("lex isdn_cdb.lex") "flex isdn_cdb.lex")) | 398 | (substitute* "hwinfo.pc.in" |
| 400 | ;; Patch pkg-config file to point to the "lib" output. | 399 | (("/usr") #$output:lib))))) |
| 401 | (substitute* "hwinfo.pc.in" | 400 | (delete 'configure) |
| 402 | (("/usr") lib))))) | 401 | (replace 'build |
| 403 | (delete 'configure) | 402 | (lambda* (#:key make-flags #:allow-other-keys) |
| 404 | (replace 'build | 403 | (setenv "CC" #$(cc-for-target)) |
| 405 | (lambda _ | 404 | (invoke "make" "shared") |
| 406 | (setenv "CC" ,(cc-for-target)) | 405 | (invoke "make" "doc"))) |
| 407 | (invoke "make" "shared") | 406 | (add-after 'install 'install-man-pages |
| 408 | (invoke "make" "doc"))) | 407 | (lambda _ |
| 409 | (add-after 'install 'install-manpages | 408 | (let* ((man (string-append #$output "/share/man")) |
| 410 | (lambda* (#:key outputs #:allow-other-keys) | 409 | (man1 (string-append man "/man1")) |
| 411 | (let* ((out (assoc-ref outputs "out")) | 410 | (man8 (string-append man "/man8"))) |
| 412 | (man-dir (string-append out "/share/man")) | 411 | (for-each |
| 413 | (man1-dir (string-append man-dir "/man1")) | 412 | (lambda (x) (install-file x man1)) |
| 414 | (man8-dir (string-append man-dir "/man8"))) | 413 | (find-files "doc" "\\.1$")) |
| 415 | (for-each | 414 | (for-each |
| 416 | (lambda (x) (install-file x man1-dir)) | 415 | (lambda (y) (install-file y man8)) |
| 417 | (find-files "doc" "\\.1$")) | 416 | (find-files "doc" "\\.8$")))))))) |
| 418 | (for-each | ||
| 419 | (lambda (y) (install-file y man8-dir)) | ||
| 420 | (find-files "doc" "\\.8$")))))))) | ||
| 421 | (native-inputs | 417 | (native-inputs |
| 422 | (list doxygen flex perl pkg-config)) | 418 | (list doxygen flex perl pkg-config)) |
| 423 | (inputs | 419 | (inputs |
