summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParnikkapore <poomklao@yahoo.com>2024-04-21 01:02:50 +0200
committerGuix Patches Tester <>2024-05-19 02:13:44 +0200
commitab1c0c014132931f1da022c007901bf0edc31f42 (patch)
treec7466a59e2fd580fb3d2fd0906b4002b6d81baa4
parentb7a33c3c0c9b9e42ed3f0bdf5aaa647b7db5e86c (diff)
downloadguix-patches-issue-70487.tar
guix-patches-issue-70487.tar.gz
gnu: lsp-plugins: Test with lv2lint and lv2_validate.issue-70487
* gnu/packages/music.scm (lsp-plugins): Add more tests. [arguments]: Add (guix build json) to the environment. [phases]: Run lv2_validate and lv2lint. [native-inputs]: Add lv2 (for lv2_validate) and lv2lint. Change-Id: Ie73c5943298611dd0f8b42455151306d86a29a1e
-rw-r--r--gnu/packages/music.scm79
1 files changed, 53 insertions, 26 deletions
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index db54afe0ac..ab38656e5a 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -91,6 +91,7 @@
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix git-download)
+ #:use-module (guix modules)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (gnu packages)
@@ -6207,31 +6208,57 @@ and reverb.")
#:make-flags
#~(list (string-append "CC=" #$(cc-for-target)))
#:phases
- #~(modify-phases %standard-phases
- (replace 'configure
- (lambda _
- (invoke "make" "config"
- "STRICT=1"
- "TEST=1"
- "FEATURES=clap doc jack ladspa lv2 vst2 xdg"
- (string-append "PREFIX=" #$output)
- (string-append "ETCDIR=" #$output "/etc"))))
- (replace 'check
- (lambda* (#:key tests? #:allow-other-keys)
- (when tests?
- (invoke ".build/host/lsp-plugin-fw/lsp-plugins-test" "utest"))))
- (add-after 'install 'move-large-subdirs
- (lambda _
- (define (move-to-output output path)
- (let ((source (string-append #$output path))
- (target (string-append output path)))
- (mkdir-p (dirname target))
- (rename-file source target)))
- (move-to-output #$output:doc "/share/doc") ; 29MB
- (move-to-output #$output:lv2 "/lib/lv2") ; 32MB
- (move-to-output #$output:bin "/bin") ; Avoid cluttering xdg menu
- (move-to-output #$output:bin "/share")
- (move-to-output #$output:bin "/etc"))))))
+ (with-imported-modules (source-module-closure '((guix build json)))
+ #~(modify-phases %standard-phases
+ (replace 'configure
+ (lambda _
+ (invoke "make" "config"
+ "STRICT=1"
+ "TEST=1"
+ "FEATURES=clap doc jack ladspa lv2 vst2 xdg"
+ (string-append "PREFIX=" #$output)
+ (string-append "ETCDIR=" #$output "/etc"))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke ".build/host/lsp-plugin-fw/lsp-plugins-test" "utest"))))
+ (add-after 'install 'move-large-subdirs
+ (lambda _
+ (define (move-to-output output path)
+ (let ((source (string-append #$output path))
+ (target (string-append output path)))
+ (mkdir-p (dirname target))
+ (rename-file source target)))
+ (move-to-output #$output:doc "/share/doc") ; 29MB
+ (move-to-output #$output:lv2 "/lib/lv2") ; 32MB
+ (move-to-output #$output:bin "/bin") ; Avoid cluttering xdg menu
+ (move-to-output #$output:bin "/share")
+ (move-to-output #$output:bin "/etc")))
+ (add-after 'move-large-subdirs 'postinstall-check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (use-modules (guix build json))
+ (let* ((plugins-json
+ (call-with-input-file
+ ".build/target/lsp-plugin-fw/plugins.json"
+ read-json))
+ (plugin-objects
+ (assoc-ref plugins-json "plugins"))
+ (plugin-urls
+ (map (lambda (obj) (assoc-ref obj "lv2_uri"))
+ plugin-objects))
+ (plugin-urls (filter ->bool plugin-urls)))
+ (setenv
+ "LV2_PATH"
+ (string-append #$output:lv2 "/lib/lv2:" #$lv2 "/lib/lv2"))
+ (for-each
+ (lambda (url)
+ (invoke "lv2lint" "-Mpack" "-t" "* Symbols" url))
+ plugin-urls))
+ (system
+ (string-append "lv2_validate "
+ #$output:lv2
+ "/usr/lib/lv2/lsp-*.lv2/*.ttl")))))))))
(inputs
(list cairo
freetype
@@ -6240,7 +6267,7 @@ and reverb.")
libx11
libxrandr
mesa))
- (native-inputs (list pkg-config php))
+ (native-inputs (list pkg-config php lv2 lv2lint))
(outputs '("out" "doc" "lv2" "debug"))
(synopsis "Audio plugin collection")
(description "LSP (Linux Studio Plugins) is a collection of audio