summaryrefslogtreecommitdiff
path: root/digilent-agent.scm
blob: 103c0ab1ad19084eb89cd8c59965f7c051f3dd7f (plain)
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
(define-module (digilent-agent)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system cmake)
  #:use-module (gnu packages qt))

(define-public digilent-agent
  (let ((commit-ref "0d0e8c791dda4d6c913f4ec4297f4401af1bbb25"))
    (package
      (name "digilent-agent")
      (version "v1.0.1")
      (source (origin
                (method git-fetch)
                (uri (git-reference
                       (url "https://github.com/ekaitz-zarraga/digilent-agent.git")
                       (commit commit-ref)
                       (recursive? #t)))
                (sha256
                  (base32 "0chrmjbp4h4wvqb1nrg9n0sxfy0bn8hcc3lqh480jzxcjxr5zvpx"))))
      (build-system cmake-build-system)
      (native-inputs
        `(("qtserialport" ,qtserialport)
          ("qtbase" ,qtbase)))
      (arguments
        `(#:tests? #f
          #:phases
            (modify-phases
              %standard-phases
              (replace
                'configure
                (lambda* (#:key outputs #:allow-other-keys)
                         (let ((out (assoc-ref outputs "out")))
                           ; Need o overwrite stuff in digilent-agent.pro from:
                           ; 8< ----
                           ; TARGET = digilent-agent
                           ; target.path = /usr/bin
                           ;
                           ; wwwRoot.path = /usr/share/digilent-agent/www
                           ; wwwRoot.files = www/*
                           ;
                           ; INSTALLS += target
                           ; INSTALLS += wwwRoot
                           ; ---- >8
                           ; Where it says /usr/ we need to add our output dir
                           (substitute* "digilent-agent.pro"
                                        (("\\/usr\\/bin")
                                         (string-append out "/bin"))
                                        (("\\/usr\\/share")
                                         (string-append out "/share")))
                           (substitute* "src/main.cpp"
                                        (("\\/usr\\/share")
                                         (string-append out "/share")))
                           (invoke "qmake")))))))
      (synopsis "The Digilent Agent is a service that runs in the system tray
                and enables browser based applications to communicate with
                Digilent hardware.")
                (home-page
                  "https://reference.digilentinc.com/reference/software/digilent-agent/start")
                (description
                  "Digilent connector for Digilent devices such as OpenScope MZ.")
                (license license:lgpl3))))