nongnu: sdrplay: Use gexps.

* nongnu/packages/radio.scm (sdrplay)[arguments]: Rewrite 'patchelf-plan',
  'install-plan' and 'phases' using gexps.

Signed-off-by: Jonathan Brielmaier <jonathan.brielmaier@web.de>
This commit is contained in:
Guillaume Le Vaillant 2022-06-14 14:23:12 +02:00 committed by Jonathan Brielmaier
parent 9d133a1e99
commit 0d38919a2e
No known key found for this signature in database
GPG key ID: ECFC83988B4E4B9F

View file

@ -19,6 +19,7 @@
#:use-module (gnu packages radio) #:use-module (gnu packages radio)
#:use-module (guix build-system cmake) #:use-module (guix build-system cmake)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix licenses) #:use-module (guix licenses)
#:use-module (guix packages) #:use-module (guix packages)
@ -44,47 +45,45 @@
`(("eudev" ,eudev) `(("eudev" ,eudev)
("gcc:lib" ,gcc "lib"))) ("gcc:lib" ,gcc "lib")))
(arguments (arguments
`(#:patchelf-plan (let ((arch (match (or (%current-target-system)
(let ((arch ,(match (or (%current-target-system) (%current-system)) (%current-system))
("i686-linux" "i686") ("i686-linux" "i686")
("x86_64-linux" "x86_64") ("x86_64-linux" "x86_64")
(_ "UNSUPPORTED"))) (_ "UNSUPPORTED")))
(major-minor ,(version-major+minor version))) (major (version-major version))
`((,(string-append arch "/libsdrplay_api.so." major-minor) (major-minor (version-major+minor version)))
("gcc:lib")) (list
(,(string-append arch "/sdrplay_apiService") #:patchelf-plan
("eudev" "gcc:lib")))) #~(list
(list (string-append #$arch "/libsdrplay_api.so." #$major-minor)
'("gcc:lib"))
(list (string-append #$arch "/sdrplay_apiService")
'("eudev" "gcc:lib")))
#:install-plan #:install-plan
(let ((arch ,(match (or (%current-target-system) (%current-system)) #~(list '("66-mirics.rules" "lib/udev/rules.d/66-mirics.rules")
("i686-linux" "i686") '("inc" "include")
("x86_64-linux" "x86_64") (list (string-append #$arch "/libsdrplay_api.so." #$major-minor)
(_ "UNSUPPORTED"))) (string-append "lib/libsdrplay_api.so." #$major-minor))
(major-minor ,(version-major+minor version))) (list (string-append #$arch "/sdrplay_apiService")
`(("66-mirics.rules" "lib/udev/rules.d/66-mirics.rules")
("inc" "include")
(,(string-append arch "/libsdrplay_api.so." major-minor)
,(string-append "lib/libsdrplay_api.so." major-minor))
(,(string-append arch "/sdrplay_apiService")
"bin/sdrplay_apiService") "bin/sdrplay_apiService")
("sdrplay_license.txt" (list "sdrplay_license.txt"
,(string-append "share/doc/sdrplay-" ,version "/license.txt")))) (string-append "share/doc/sdrplay-" #$version
"/license.txt")))
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'unpack (replace 'unpack
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((source-script (assoc-ref inputs "source"))) (let ((source-script (assoc-ref inputs "source")))
(invoke "sh" source-script "--noexec" "--target" "source") (invoke "sh" source-script
"--noexec" "--target" "source")
(chdir "source")))) (chdir "source"))))
(add-after 'install 'create-library-links (add-after 'install 'create-library-links
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let* ((major ,(version-major version)) (let* ((lib (string-append #$output "/lib/libsdrplay_api.so"))
(major-minor ,(version-major+minor version)) (lib-major (string-append lib "." #$major))
(lib (string-append (assoc-ref outputs "out") (lib-major-minor (string-append lib "." #$major-minor)))
"/lib/libsdrplay_api.so"))
(lib-major (string-append lib "." major))
(lib-major-minor (string-append lib "." major-minor)))
(symlink lib-major-minor lib-major) (symlink lib-major-minor lib-major)
(symlink lib-major lib))))))) (symlink lib-major lib))))))))
(home-page "https://www.sdrplay.com") (home-page "https://www.sdrplay.com")
(synopsis "API for SDRplay RSP devices") (synopsis "API for SDRplay RSP devices")
(description (description