From 0d38919a2ee9cd355394d8709d39d62dbb1022dc Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Tue, 14 Jun 2022 14:23:12 +0200 Subject: [PATCH] nongnu: sdrplay: Use gexps. * nongnu/packages/radio.scm (sdrplay)[arguments]: Rewrite 'patchelf-plan', 'install-plan' and 'phases' using gexps. Signed-off-by: Jonathan Brielmaier --- nongnu/packages/radio.scm | 81 +++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/nongnu/packages/radio.scm b/nongnu/packages/radio.scm index d2e938e..d697bdc 100644 --- a/nongnu/packages/radio.scm +++ b/nongnu/packages/radio.scm @@ -19,6 +19,7 @@ #:use-module (gnu packages radio) #:use-module (guix build-system cmake) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix licenses) #:use-module (guix packages) @@ -44,47 +45,45 @@ `(("eudev" ,eudev) ("gcc:lib" ,gcc "lib"))) (arguments - `(#:patchelf-plan - (let ((arch ,(match (or (%current-target-system) (%current-system)) - ("i686-linux" "i686") - ("x86_64-linux" "x86_64") - (_ "UNSUPPORTED"))) - (major-minor ,(version-major+minor version))) - `((,(string-append arch "/libsdrplay_api.so." major-minor) - ("gcc:lib")) - (,(string-append arch "/sdrplay_apiService") - ("eudev" "gcc:lib")))) - #:install-plan - (let ((arch ,(match (or (%current-target-system) (%current-system)) - ("i686-linux" "i686") - ("x86_64-linux" "x86_64") - (_ "UNSUPPORTED"))) - (major-minor ,(version-major+minor version))) - `(("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") - ("sdrplay_license.txt" - ,(string-append "share/doc/sdrplay-" ,version "/license.txt")))) - #:phases - (modify-phases %standard-phases - (replace 'unpack - (lambda* (#:key inputs #:allow-other-keys) - (let ((source-script (assoc-ref inputs "source"))) - (invoke "sh" source-script "--noexec" "--target" "source") - (chdir "source")))) - (add-after 'install 'create-library-links - (lambda* (#:key outputs #:allow-other-keys) - (let* ((major ,(version-major version)) - (major-minor ,(version-major+minor version)) - (lib (string-append (assoc-ref outputs "out") - "/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 lib))))))) + (let ((arch (match (or (%current-target-system) + (%current-system)) + ("i686-linux" "i686") + ("x86_64-linux" "x86_64") + (_ "UNSUPPORTED"))) + (major (version-major version)) + (major-minor (version-major+minor version))) + (list + #:patchelf-plan + #~(list + (list (string-append #$arch "/libsdrplay_api.so." #$major-minor) + '("gcc:lib")) + (list (string-append #$arch "/sdrplay_apiService") + '("eudev" "gcc:lib"))) + #:install-plan + #~(list '("66-mirics.rules" "lib/udev/rules.d/66-mirics.rules") + '("inc" "include") + (list (string-append #$arch "/libsdrplay_api.so." #$major-minor) + (string-append "lib/libsdrplay_api.so." #$major-minor)) + (list (string-append #$arch "/sdrplay_apiService") + "bin/sdrplay_apiService") + (list "sdrplay_license.txt" + (string-append "share/doc/sdrplay-" #$version + "/license.txt"))) + #:phases + #~(modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key inputs #:allow-other-keys) + (let ((source-script (assoc-ref inputs "source"))) + (invoke "sh" source-script + "--noexec" "--target" "source") + (chdir "source")))) + (add-after 'install 'create-library-links + (lambda _ + (let* ((lib (string-append #$output "/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 lib)))))))) (home-page "https://www.sdrplay.com") (synopsis "API for SDRplay RSP devices") (description