Subject: [PATCH v4 5/5] gnu: satdump: Fix RUNPATH for a plugin.

From: David Elsing <[email-masked]>
Date: Mon, 14 Apr 2025 17:09:28 +0000

* gnu/packages/radio.scm (satdump)[arguments]: Add 'fix-runpath phase.
---
 gnu/packages/radio.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index 3724988ce4..24ae6ec821 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -3245,7 +3245,22 @@ (define-public satdump
            volk
            (list zstd "lib")))
     (arguments
-     (list #:tests? #f)) ; No test suite
+     (list
+      #:tests? #f ; No test suite
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; The RUNPATH of this shared library is missing the
+          ;; .../lib/satdump/plugins directory, which fails the
+          ;; 'validate-runpath' phase.
+          (add-after 'unpack 'fix-runpath
+            (lambda _
+              (substitute* "plugins/official_products_support/CMakeLists.txt"
+                (("add_library\\(official_products_loader_support.*" orig)
+                 (string-append
+                  orig "\n" "set_target_properties("
+                  "official_products_loader_support"
+                  " PROPERTIES INSTALL_RPATH \""
+                  #$output "/lib:" #$output "/lib/satdump/plugins\")\n"))))))))
     (home-page "https://www.satdump.org/")
     (synopsis "Satellite data processing software")
     (description "SatDump is a generic satellite data processing software.
-- 
2.48.1