diff mbox series

[bug#48217,1/9] gnu: Add csdr.

Message ID 20210504085705.5298-1-glv@posteo.net
State Accepted
Headers show
Series Add sdrangel | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Guillaume Le Vaillant May 4, 2021, 8:56 a.m. UTC
* gnu/packages/radio.scm (csdr): New variable.
---
 gnu/packages/radio.scm | 54 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

Comments

Leo Famulari May 4, 2021, 8 p.m. UTC | #1
On Tue, May 04, 2021 at 08:56:57AM +0000, Guillaume Le Vaillant wrote:
> * gnu/packages/radio.scm (csdr): New variable.
> +       `(#:make-flags
> +         (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
> +               "PARSEVECT=no")

Can you document this parameter in a code comment?
Guillaume Le Vaillant May 4, 2021, 9:34 p.m. UTC | #2
Leo Famulari <leo@famulari.name> skribis:

> On Tue, May 04, 2021 at 08:56:57AM +0000, Guillaume Le Vaillant wrote:
>> * gnu/packages/radio.scm (csdr): New variable.
>> +       `(#:make-flags
>> +         (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
>> +               "PARSEVECT=no")
>
> Can you document this parameter in a code comment?

Yes, I'll add a comment.
For info, when 'PARSEVECT' is 'yes', after compiling the program a table
indicating which functions are optimized with SIMD instructions and
which are not is printed. As we don't do anything of this info
and it brings python2 in the dependencies, I disabled it.
diff mbox series

Patch

diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index e6d5ef0203..382fdf85e3 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -1575,3 +1575,57 @@  receiver.")
      "@code{welle.io} is a Digital Audio Broadcasting (DAB and DAB+) software
 defined radio with support for rtl-sdr.")
     (license license:gpl2+)))
+
+(define-public csdr
+  ;; No release since 2017, use commit directly.
+  (let ((commit "6ef2a74206887155290a54c7117636f66742f858")
+        (revision "1"))
+    (package
+      (name "csdr")
+      (version (git-version "0.15" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/ha7ilm/csdr")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0ic35130lf66lk3wawgc5bcg711l7chv9al1hzdc1xrmq9qf9hri"))))
+      (build-system gnu-build-system)
+      (inputs
+       `(("fftwf" ,fftwf)))
+      (arguments
+       `(#:make-flags
+         (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+               "PARSEVECT=no")
+         #:tests? #f  ; No check phase
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'configure
+             (lambda* (#:key outputs #:allow-other-keys)
+               (substitute* "Makefile"
+                 (("PARAMS_MISC = -Wno-unused-result" all)
+                  ;; The 'validate-runpath' phase fails without this.
+                  (string-append
+                   all " -Wl,-rpath=" (assoc-ref outputs "out") "/lib"))
+                 (("PARAMS_SIMD =.*")
+                  ;; Disable to make reproducibility and cross-compilation work.
+                  "")
+                 (("gcc ")
+                  ,(string-append (cc-for-target) " "))
+                 (("g\\+\\+ ")
+                  ,(string-append (cxx-for-target) " ")))))
+           (add-before 'install 'make-installation-directories
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (mkdir-p (string-append out "/bin"))
+                 (mkdir-p (string-append out "/lib"))))))))
+      (home-page "https://github.com/ha7ilm/csdr")
+      (synopsis "DSP for software defined radio")
+      (description
+       "This package includes the @code{libcsdr} library of
+@acronym{DSP, Digital Signal Processing} functions for
+@acronym{SDRs, Software Defined Radios}, and the @code{csdr} command line
+program that can be used to build simple signal processing flow graphs.")
+      (license license:gpl3+))))