| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 |
|
| 20 | (define-module (gnu build icecat-extension)
|
| 21 | #:use-module (guix gexp)
|
| 22 | #:use-module (guix packages)
|
| 23 | #:use-module (guix build-system trivial)
|
| 24 | #:export (make-icecat-extension))
|
| 25 |
|
| 26 | (define* (make-icecat-extension pkg #:optional (pkg-output "out"))
|
| 27 | "Create an Icecat extension from package PKG and return a package that,
|
| 28 | when installed, will make the extension contained in PKG available as an
|
| 29 | Icecat browser extension. PKG-OUTPUT specifies which output of PKG to use."
|
| 30 | (package
|
| 31 | (inherit pkg)
|
| 32 | (location (package-location pkg))
|
| 33 | (name (string-append (package-name pkg) "-icecat"))
|
| 34 | (native-inputs '())
|
| 35 | (inputs '())
|
| 36 | (propagated-inputs (package-propagated-inputs pkg))
|
| 37 | (outputs '("out"))
|
| 38 | (build-system trivial-build-system)
|
| 39 | (arguments
|
| 40 | (list
|
| 41 | #:modules '((guix build utils))
|
| 42 | #:builder
|
| 43 | #~(begin
|
| 44 | (use-modules (guix build utils))
|
| 45 | (let* ((addon-id #$(assq-ref (package-properties pkg) 'addon-id))
|
| 46 | (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}")
|
| 47 | (search-dir (string-append #$output "/lib/icecat/extensions/"
|
| 48 | moz-app-id)))
|
| 49 | |
| 50 | |
| 51 | |
| 52 |
|
| 53 | |
| 54 | |
| 55 | |
| 56 |
|
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 |
|
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 |
|
| 69 | (mkdir-p search-dir)
|
| 70 | (symlink (in-vicinity (ungexp pkg pkg-output) addon-id)
|
| 71 | (in-vicinity search-dir addon-id))))))))
|