aboutsummaryrefslogtreecommitdiff
;;; 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)
    (location (package-location pkg))
    (name (string-append (package-name pkg) "-icecat"))
    (native-inputs '())
    (inputs '())
    (propagated-inputs (package-propagated-inputs pkg))
    (outputs '("out"))
    (build-system trivial-build-system)
    (arguments
     (list
      #:modules '((guix build utils))
      #:builder
      #~(begin
          (use-modules (guix build utils))
          (let* ((addon-id #$(assq-ref (package-properties pkg) 'addon-id))
                 (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}")
                 (search-dir (string-append #$output "/lib/icecat/extensions/"
                                            moz-app-id)))
            ;; Icecat's iterates over `search-dir` for directories.  If a
            ;; directory's name is not a valid add-on ID, it is ignored.  See
            ;; `DirectoryLocation::readAddons()` in XPIProvider.jsm.

            ;; This directory has to be a symlink, because Icecat's
            ;; `_readLinkFile(aFile)` calls `normalize()` only if `aFile` is a
            ;; symlink.

            ;; Normalizing is required because Icecat compares the add-on path
            ;; against its local database to know if there is an extension
            ;; update.  We want the add-on path to be the package store path,
            ;; so that a path change is detected every time the package is
            ;; updated.  See `updateExistingAddon()` in XPIDatabase.jsm, with
            ;; our patch `icecat-compare-paths.patch`.

            ;; We don't want the add-on path to be the profile store path,
            ;; which would change too often.  We don't want the add-on path to
            ;; be hard-coded either because it would never change (but it
            ;; wouldn't make sense anyway).

            (mkdir-p search-dir)
            (symlink (in-vicinity (ungexp pkg pkg-output) addon-id)
                     (in-vicinity search-dir addon-id))))))))
Change-Id: I1b0319358778c7aee650bc843e021a6803a1cf3a Signed-off-by: Ludovic Courtès <ludo@gnu.org> Nigko Yerden 2024-10-07services: networking: Add 'version' field to dhcp-client-configuration....* gnu/services/networking.scm (<dhcp-client-configuration>) [version]: New field. (dhcp-client-shepherd-service): Use 'match-record' instead of various accessors. Honor the new 'version field'. Include the version the PID file name when a non-default version is used. * doc/guix.texi (Networking Setup) <dhcp-client-configuration> [version]: Document it. Change-Id: I6236ae160967c95fe7a2c1785821cc9b0c183e77 Maxim Cournoyer 2024-06-24services: networking: Allow dhcp-client to use a config file....* gnu/services/networking.scm (dhcp-client-configuration) [config-file]: New field. (dhcp-client-configuration-config-file): New accessor. (dhcp-client-shepherd-service): Use the config file when invoking dhclient if supplied. * doc/guix.texi: Document it. Change-Id: I286de4ddf59c5e606bf1fe0a7510570869e62b1a Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Richard Sent 2024-06-02services: tor: Log to stderr rather than syslog....* gnu/services/networking.scm (tor-configuration->torrc): Change ‘Log’ directive to ‘stderr’. (tor-shepherd-service): Remove /dev/log file system mapping. Change-Id: I2e33ad8033f884ce59d929a4181172325331efe0 Ludovic Courtès 2024-02-18services: block-facebook-hosts: Use proper unroutable addresses....This is safer and more appropriate than redirecting to localhost. * gnu/services/networking.scm (%unroutable-ipv4, %unroutable-ipv6): New variables. (facebook-host-aliases): Use them. Change-Id: Idd4b1fec903c52d542d177a52fec1814eded4119 Ludovic Courtès 2024-01-22services: connman: Add 'connman-general-configuration'....Currently connman has no main.conf as specified in 'man 5 connman.conf' which would allow setting NetworkInterfaceBalcklist and other useful options. This patch adds connman-general-configuration, serializes it and passes to connmad with --config= flag. All configuration fields are 'maybe-*' deliberately, to not disturb current users and not require supporting configuration changes for connmand. * gnu/services/networking.scm (<connman-general-configuration>): New configuration record to represent main.conf for connmand. (<connman-configuration>)[general-configuration]: New field. (connman-shepherd-service): Honor it. *doc/guix.texi (Networking Services): Add generated configuration. Change-Id: I5d78f49e8b2d5e0b3cbd7b8b604e8a254b6397e8 Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> muradm 2023-12-22services: pagekite: Add ‘configuration’ action....* gnu/services/networking.scm (pagekite-shepherd-service): Add ‘actions’ field. Change-Id: I04daa846d505b0700b574a82472ecd99b492d7c4 Ludovic Courtès 2023-12-22services: pagekite: Use ‘least-authority-wrapper’....* gnu/services/networking.scm (pagekite-shepherd-service): Define ‘config-file’ and ‘mappings’; define ‘pagekite’ in terms of ‘least-authority-wrapper’. Remove now-unneeded ‘with-imported-modules’ form and ‘modules’ field. Use ‘make-forkexec-constructor’ instead of ‘make-forkexec-constructor/container’. Change-Id: I7c6c6266785f6a0f81a69d85f070779a0d6edd91 Ludovic Courtès