~ruther/guix-exprs

ref: 4aef3e72981477f2521ac346d65f7d48c8210bf7 guix-exprs/modules/ruther/packages/radio.scm -rw-r--r-- 5.2 KiB
4aef3e72 — Rutherther fix: libiio python bindings a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
(define-module (ruther packages radio)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system cmake)
  #:use-module (guix packages)
  #:use-module (guix gexp)
  #:use-module (guix utils)
  #:use-module (guix git-download)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages flex)
  #:use-module (gnu packages bison)
  #:use-module (gnu packages python)
  #:use-module (gnu packages avahi)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages libusb)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages radio))

(define-public libiio
  (package
    (name "libiio")
    (version "0.26")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/analogdevicesinc/libiio")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "18cmaszfmn6kaa9gi26kkgjk506xqb8zsd4bq6yp8hzxr1qldfly"))))
    (arguments
     (list
      #:tests? #f
      #:configure-flags
      #~(list
         (string-append "-DUDEV_RULES_INSTALL_DIR=" #$output "/lib/udev/rules.d")
         "-DOSX_PACKAGE=off"
         "-DOSX_FRAMEWORK=off"
         (string-append "-DPython_EXECUTABLE=" (search-input-file %build-inputs "/bin/python3"))
         "-DPYTHON_BINDINGS=on")
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch
            (lambda _
              (substitute* "bindings/python/iio.py"
                (("_iiolib = \"iio\"") (string-append "_iiolib = \"" #$output "/lib/libiio.so\""))
                (("find_library\\(_iiolib\\)") "_iiolib"))
              ;; Libiio is not installed at the time of the build. The check is unnecessary,
              ;; to do it the upstream way, we would have to configure, build, install
              ;; without the bindings first, and then second time with the bindings...
              (substitute* "bindings/python/setup.py.cmakein"
                (("self._check_libiio_installed()") "")))))))
    (native-inputs
     (list
      pkg-config
      flex
      bison
      python
      avahi
      libaio))
    (inputs
     (list
      libxml2
      libusb))
    (build-system cmake-build-system)
    (license (list
              license:lgpl2.1
              license:gpl2))
    (home-page "https://github.com/analogdevicesinc/libiio")
    (synopsis "A cross platform library for interfacing with local and remote Linux IIO devices ")
    (description
     "Library for interfacing with Linux IIO devices
libiio is used to interface to the Linux Industrial Input/Output (IIO) Subsystem.
The Linux IIO subsystem is intended to provide support for devices that in some
sense are analog to digital or digital to analog converters (ADCs, DACs).
This includes, but is not limited to ADCs, Accelerometers, Gyros, IMUs,
Capacitance to Digital Converters (CDCs), Pressure Sensors, Color, Light and Proximity Sensors,
Temperature Sensors, Magnetometers, DACs, DDS (Direct Digital Synthesis), PLLs (Phase Locked Loops),
Variable/Programmable Gain Amplifiers (VGA, PGA), and RF transceivers. You can use libiio natively
on an embedded Linux target (local mode), or use libiio to communicate remotely to that same target
from a host Linux, Windows or MAC over USB or Ethernet or Serial.")))

(define-public libad9361
  (package
    (name "libad9361")
    (version "0.3")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/analogdevicesinc/libad9361-iio")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1inv39xfg8gqz1v7k1n2a7p9zzlb6gq98gcnnpdcr9fa5alvmvpm"))))
    (inputs
     (list libiio))
    (build-system cmake-build-system)
    (license (list
              license:lgpl2.1
              license:gpl2))
    (home-page "https://github.com/analogdevicesinc/libad9361-iio")
    (synopsis
     "IIO AD9361 library for filter design and handling, multi-chip sync, etc. ")
    (description "This is a simple library used for userspace,
which manages multi-chip sync (on platforms (FMCOMMS5) where multiple AD9361 devices are use)
can create AD9361 specific FIR filters on the fly.")))

(define-public sdr++/pluto
  (package
    (inherit sdr++)
    (name "sdr++-pluto")

    (arguments
     (substitute-keyword-arguments (package-arguments sdr++)
       ((#:configure-flags flags '())
        #~(cons*
           "-DOPT_BUILD_PLUTOSDR_SOURCE=ON"
           (delete "-DOPT_BUILD_PLUTOSDR_SOURCE=OFF" #$flags)))))
    (inputs
     (modify-inputs (package-inputs sdr++)
       (append libad9361)
       (append libiio)))))

(define-public sdrangel-pluto
  (package
   (inherit sdrangel)
   (name "sdrangel-pluto")
   (arguments
    (substitute-keyword-arguments (package-arguments sdrangel)
                                  ((#:configure-flags flags '())
                                   #~(cons*
                                      (string-append "-DIIO_DIR=" #$(this-package-input "libiio"))
                                      #$flags))))
   (inputs
    (modify-inputs (package-inputs sdrangel)
                   (append libad9361)
                   (append libiio)))))
Do not follow this link