summaryrefslogtreecommitdiff
path: root/gnu/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-12-09 22:06:53 +0100
committerLudovic Courtès <ludo@gnu.org>2023-12-09 22:32:08 +0100
commit190eff1d201a099542cc1d3406bcc1eda6a980da (patch)
tree3fe324ef1a9087dd5706c455073378251cdae5bd /gnu/build
parent5cf6c96ad9ffafccf180ec2d44c740b6999c02ac (diff)
parent61f2d84e75c340c2ba528d392f522c51b8843f34 (diff)
Merge branch 'master' into core-updates
Change-Id: Iea8f10db98256f1c6cfac8bfcc82e2d44695ef3d
Diffstat (limited to 'gnu/build')
-rw-r--r--gnu/build/accounts.scm12
-rw-r--r--gnu/build/icecat-extension.scm70
-rw-r--r--gnu/build/linux-modules.scm3
3 files changed, 82 insertions, 3 deletions
diff --git a/gnu/build/accounts.scm b/gnu/build/accounts.scm
index 1247fc640c..fa6f454b5e 100644
--- a/gnu/build/accounts.scm
+++ b/gnu/build/accounts.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2019, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2021, 2023 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -525,7 +525,15 @@ password from USERS."
(lookup-procedure current-shadow shadow-entry-name))
(define now
- (days-since-epoch current-time))
+ ;; On machines without a real-time clock (typically Arm SBCs), the system
+ ;; clock may be at 1970-01-01 while booting, which would lead us to define
+ ;; NOW as zero.
+ ;;
+ ;; However, the 'isexpired' function in Shadow interprets the combination
+ ;; uninitialized password + last-change = 0 as "The password has expired,
+ ;; it must be changed", which prevents logins altogether. To avoid that,
+ ;; never set 'last-change' to zero.
+ (max (days-since-epoch current-time) 1))
(map (lambda (user passwd)
(or (previous-entry (password-entry-name passwd))
diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.scm
new file mode 100644
index 0000000000..1e6a9a54e4
--- /dev/null
+++ b/gnu/build/icecat-extension.scm
@@ -0,0 +1,70 @@
+;;; 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 (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))))))))
diff --git a/gnu/build/linux-modules.scm b/gnu/build/linux-modules.scm
index 3b1f512663..12cb9c4ba6 100644
--- a/gnu/build/linux-modules.scm
+++ b/gnu/build/linux-modules.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2014, 2016, 2018, 2019, 2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
+;;; Copyright © 2023 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -208,7 +209,7 @@ modules that can be postloaded, of the soft dependencies of module FILE."
(string-take filename extension)
filename)))
-(define (dot-ko name compression)
+(define* (dot-ko name #:optional compression)
(let ((suffix (match compression
('xz ".ko.xz")
('gzip ".ko.gz")