diff options
Diffstat (limited to 'manifest.scm')
| -rw-r--r-- | manifest.scm | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/manifest.scm b/manifest.scm new file mode 100644 index 0000000..91100f3 --- /dev/null +++ b/manifest.scm | |||
| @@ -0,0 +1,114 @@ | |||
| 1 | (use-modules (guix packages) | ||
| 2 | (guix git-download) | ||
| 3 | (guix build-system cmake) | ||
| 4 | (guix build-system copy) | ||
| 5 | (guix utils) | ||
| 6 | (guix gexp) | ||
| 7 | (gnu packages racket) | ||
| 8 | (gnu packages emacs-xyz) | ||
| 9 | ((guix licenses) #:prefix license:)) | ||
| 10 | |||
| 11 | (define paho-mqtt-c | ||
| 12 | (package | ||
| 13 | (name "paho-mqtt-c") | ||
| 14 | (version "1.3.13") | ||
| 15 | (source (origin | ||
| 16 | (method git-fetch) | ||
| 17 | (uri (git-reference | ||
| 18 | (url "https://github.com/eclipse/paho.mqtt.c") | ||
| 19 | (commit (string-append "v" version)))) | ||
| 20 | (file-name (git-file-name name version)) | ||
| 21 | (sha256 | ||
| 22 | (base32 "1y5lsh41kszyjcrxrjshs838l23ncdyssxk848ij1bq0jix2g93l")))) | ||
| 23 | (build-system cmake-build-system) | ||
| 24 | (arguments | ||
| 25 | '(#:tests? #f)) ;; Disable tests | ||
| 26 | (synopsis "Eclipse Paho MQTT C client library") | ||
| 27 | (description | ||
| 28 | "Eclipse Paho MQTT C client library.") | ||
| 29 | (home-page "https://www.eclipse.org/paho/") | ||
| 30 | (license license:epl1.0))) | ||
| 31 | |||
| 32 | (define (make-racket! package-to-inherit) | ||
| 33 | (package | ||
| 34 | (inherit package-to-inherit) | ||
| 35 | (arguments | ||
| 36 | (substitute-keyword-arguments (package-arguments package-to-inherit) | ||
| 37 | ((#:phases those-phases #~%standard-phases) | ||
| 38 | #~(modify-phases #$those-phases | ||
| 39 | (add-after 'install 'wrap-racket | ||
| 40 | (lambda* (#:key outputs inputs #:allow-other-keys) | ||
| 41 | (let* ((out (assoc-ref outputs "out")) | ||
| 42 | (bin (string-append out "/bin/racket")) | ||
| 43 | (libpaho (string-append (assoc-ref inputs "paho-mqtt-c") | ||
| 44 | "/lib"))) | ||
| 45 | (wrap-program bin | ||
| 46 | `("LD_LIBRARY_PATH" ":" prefix | ||
| 47 | ,(list libpaho)))))))))) | ||
| 48 | (inputs | ||
| 49 | (modify-inputs (package-inputs package-to-inherit) | ||
| 50 | (prepend paho-mqtt-c))))) | ||
| 51 | |||
| 52 | (define racket-minimal! (make-racket! racket-minimal)) | ||
| 53 | (define racket! (make-racket! racket)) | ||
| 54 | |||
| 55 | (define smart-relay | ||
| 56 | (package | ||
| 57 | (name "smart-relay") | ||
| 58 | (version "0.1.0") | ||
| 59 | (source | ||
| 60 | (local-file "src" #:recursive? #t)) | ||
| 61 | (build-system copy-build-system) | ||
| 62 | (arguments | ||
| 63 | `(#:phases | ||
| 64 | (modify-phases %standard-phases | ||
| 65 | (add-before 'install 'change-paths | ||
| 66 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 67 | (let ((out (assoc-ref outputs "out"))) | ||
| 68 | (substitute* "smart-relay.sh" | ||
| 69 | (("smart-relay.rtk") | ||
| 70 | (string-append out "/share/smart-relay.rtk")))))) | ||
| 71 | (add-before 'install 'move-files | ||
| 72 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 73 | (let* ((out (assoc-ref outputs "out")) | ||
| 74 | (bin (string-append out "/bin/")) | ||
| 75 | (share (string-append out "/share/"))) | ||
| 76 | (mkdir-p bin) | ||
| 77 | (mkdir-p share) | ||
| 78 | (chmod "smart-relay.sh" #o555) | ||
| 79 | (copy-recursively "smart-relay.sh" | ||
| 80 | (string-append bin "smart-relay")) | ||
| 81 | (copy-recursively "smart-relay.rtk" | ||
| 82 | (string-append share "smart-relay.rtk")) | ||
| 83 | (delete-file-recursively "smart-relay.sh") | ||
| 84 | (delete-file-recursively "smart-relay.rtk"))))))) | ||
| 85 | (synopsis "Lisp program to control usb relay over mqtt") | ||
| 86 | (description "Lisp program to control usb relay over mqtt") | ||
| 87 | (home-page "https://git.jdlugosz.com/hsp/smart-relay") | ||
| 88 | (license license:unlicense))) | ||
| 89 | |||
| 90 | (define emacs-geiser-racket! | ||
| 91 | (package | ||
| 92 | (inherit emacs-geiser-racket) | ||
| 93 | (inputs | ||
| 94 | (modify-inputs (package-inputs emacs-geiser-racket) | ||
| 95 | (delete "racket") | ||
| 96 | (prepend racket!))))) | ||
| 97 | |||
| 98 | |||
| 99 | (if (getenv "DEV_SHELL") | ||
| 100 | (concatenate-manifests | ||
| 101 | (list (packages->manifest | ||
| 102 | (list racket! | ||
| 103 | emacs-geiser-racket!)) | ||
| 104 | (specifications->manifest | ||
| 105 | (list "racket" | ||
| 106 | "emacs-racket-mode" | ||
| 107 | "emacs")))) | ||
| 108 | (concatenate-manifests | ||
| 109 | (list (packages->manifest | ||
| 110 | (list racket! | ||
| 111 | smart-relay)) | ||
| 112 | (specifications->manifest | ||
| 113 | (list "bash" | ||
| 114 | "nss-certs"))))) | ||
