unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob ccc6a1ece7fbb446fd4eaf70d657bc00190d8da5 2744 bytes (raw)
name: gnu/build/icecat-extension.scm 	 # note: path name is non-authoritative(*)

 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
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2023 Clément Lassieur <clement@lassieur.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu build icecat-extension)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix build-system trivial)
  #:export (make-icecat-extension))

(define* (make-icecat-extension pkg #:optional (pkg-output "out"))
  "Create an Icecat extension from package PKG and return a package that,
when installed, will make the extension contained in PKG available as an
Icecat browser extension.  PKG-OUTPUT specifies which output of PKG to use."
  (package
    (inherit pkg)
    (name (string-append (package-name pkg) "-icecat"))
    (native-inputs '())
    (inputs '())
    (propagated-inputs '())
    (outputs '("out"))
    (build-system trivial-build-system)
    (arguments
     (list
      #:modules '((guix build utils))
      #:builder
      #~(begin
          (use-modules (guix build utils))
          (let* ((id #$(assq-ref (package-properties pkg) 'id))
                 (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}")
                 (search-dir (string-append #$output
                                            "/share/icecat/extensions/"
                                            moz-app-id)))
            ;; Icecat's XPIProvider.jsm looks within `search-dir` for a
            ;; directory named after the add-on id.

            ;; This directory has to be a symlink, because Icecat's
            ;; GetNativeTarget checks S_ISLNK before canonicalizing it like
            ;; `readlink -f` would do.

            ;; Canonicalizing is required because Icecat compares the path
            ;; against its local database to know if there is an extension
            ;; update.  A path that contains the store path will change every
            ;; time the package is updated.
            (mkdir-p search-dir)
            (symlink (in-vicinity (ungexp pkg pkg-output) id)
                     (in-vicinity search-dir id))))))))

debug log:

solving ccc6a1ece7fb ...
found ccc6a1ece7fb in https://yhetil.org/guix-patches/f497f0a1831906861201bb4cc799b6b70cd83049.1696782417.git.clement@lassieur.org/

applying [1/1] https://yhetil.org/guix-patches/f497f0a1831906861201bb4cc799b6b70cd83049.1696782417.git.clement@lassieur.org/
diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.scm
new file mode 100644
index 000000000000..ccc6a1ece7fb

Checking patch gnu/build/icecat-extension.scm...
Applied patch gnu/build/icecat-extension.scm cleanly.

index at:
100644 ccc6a1ece7fbb446fd4eaf70d657bc00190d8da5	gnu/build/icecat-extension.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).