aboutsummaryrefslogtreecommitdiff
path: root/gnu.scm
blob: 2c29b6dc3f0c6aa8a19bb9d46b050925d54659bd (about) (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2015, 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Joshua S. Grant <jgrant@parenthetical.io>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; 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)
  #:use-module (guix i18n)
  #:use-module (guix utils)
  #:use-module (srfi srfi-34)
  #:use-module (srfi srfi-35)
  #:use-module (ice-9 match)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (gnu services)
  #:export (use-package-modules
            use-service-modules
            use-system-modules))

;;; Commentary:
;;;
;;; This composite module re-exports core parts the (gnu …) public modules.
;;;
;;; Code:

(eval-when (eval load compile)
  (begin
    (define %public-modules
      '((gnu system)
        (gnu system mapped-devices)
        (gnu system file-systems)
        (gnu bootloader)
        (gnu bootloader grub)
        (gnu system keyboard)
        (gnu system pam)
        (gnu system shadow)                       ; 'user-account'
        (gnu system linux-initrd)
        (gnu system nss)
        (gnu services)
        (gnu services base)
        (gnu packages)
        (gnu packages base)
        (guix gexp)))                             ; so gexps can be used

    (for-each (let ((i (module-public-interface (current-module))))
                (lambda (m)
                  (module-use! i (resolve-interface m))))
              %public-modules)))

(define (%try-use-modules modules location make-hint)
  "Attempt to load all of MODULES.  Report errors as coming from LOCATION, a
<location> record, and use MAKE-HINT to produce a fix hint."
  (define (location->string loc)
    (match loc
      (#f "")
      (($ <location> file line column)
       (format #f "~a:~a:~a: " file line column))))

  (for-each (lambda (module)
              (catch 'misc-error
                (lambda ()
                  (process-use-modules `((,module))))
                (lambda _
                  (raise
                   (apply
                    make-compound-condition
                    (condition
                     (&message
                      (message (format #f (G_ "module ~a not found")
                                       module))))
                    (condition
                     (&error-location (location location)))
                    (or (and=> (make-hint module) list)
                        '()))))))
            modules))

(define (package-module-hint module)
  (define last-name
    (match module
      ((_ ... last)
       (symbol->string last))))

  (match (find-packages-by-name last-name)
    (()
     (condition
      (&fix-hint
       (hint (G_ "\
You may use @command{guix package --show=foo | grep location} to search
for the location of package @code{foo}.
If you get the line @code{location: gnu/packages/bar.scm:174:2},
add @code{bar} to the @code{use-package-modules} form.")))))
    ((package _ ...)
     (condition
      (&fix-hint
       (hint (format #f (G_ "\
Try adding @code{(use-package-modules ~a)}.")
                     (basename (location-file (package-location package))
                               ".scm"))))))))

(define (service-module-hint module)
  (define last-name
    (match module
      ((_ ... last)
       last)))

  (match (lookup-service-types last-name)
    (()
     (condition
      (&fix-hint
       (hint (format #f (G_ "\
You may use @command{guix system search ~a} to search for a service
matching @code{~a}.
If you get the line @code{location: gnu/services/foo.scm:188:2},
add @code{foo} to the @code{use-service-modules} form.")
                     last-name last-name)))))
    ((package _ ...)
     (condition
      (&fix-hint
       (hint (format #f (G_ "\
Try adding @code{(use-service-modules ~a)}.")
                     (basename (location-file (service-type-location package))
                               ".scm"))))))))

(define-syntax-rule (try-use-modules hint modules ...)
  (eval-when (expand load eval)
    (%try-use-modules '(modules ...)
                      (source-properties->location
                       (current-source-location))
                      hint)))

(define-syntax-rule (use-package-modules module ...)
  (try-use-modules package-module-hint
                   (gnu packages module) ...))

(define-syntax-rule (use-service-modules module ...)
  (try-use-modules service-module-hint
                   (gnu services module) ...))

(define-syntax-rule (use-system-modules module ...)
  (try-use-modules (const #f)                     ;no hint
                   (gnu system module) ...))

;;; gnu.scm ends here
): Adjust accordingly. * gnu/packages/electronics.scm (libsigrokdecode)[native-inputs]: Add automake, autoconf. [source](patches): New field. Danny Milosavljevic 2022-01-15gnu: Add python-piexif....* gnu/packages/python-xyz.scm (python-piexif): New variable. * gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch: New file. * gnu/packages/python-xyz.scm (dist_patch_DATA): Add it. Hartmut Goebel 2022-01-15gnu: tree: Fix problem with no output when fd3 is present....* gnu/packages/patches/tree-disable-stddata.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/admin.scm (tree)[source](patches): New field. Marius Bakke 2022-01-14gnu: jami: Fix crash on exit....* gnu/packages/patches/jami-fix-crash-on-quit.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/jami.scm (jami): Apply it. Maxim Cournoyer 2022-01-14gnu: Add myrddin....* gnu/local.mk (GNU_SYSTEM_MODULES): Add myrddin.scm. * gnu/packages/myrddin.scm: New file. Co-authored-by: jgart <jgart@dismail.de> Co-authored-by: Jorge Acereda <jacereda@gmail.com> Co-authored-by: Raghav Gururajan <rg@raghavgururajan.name> Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Guix Together 2022-01-14gnu: Calibre: Fix a build failure with recent zeroconf....Fixes <https://issues.guix.gnu.org/53247>. * gnu/packages/patches/calibre-fix-zeroconf.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/ebook.scm (calibre)[source]: Use it. Leo Famulari 2022-01-14gnu: quassel: Update to 0.14.0....* gnu/packages/irc.scm (quassel): Update to 0.14.0. [source]: Remove patch. [inputs]: Add boost, perl, sonnet. * gnu/packages/patches/quassel-qt-514-compat.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. Efraim Flashner 2022-01-13gnu: lua: Add version 5.4.3....* gnu/packages/lua.scm (lua-5.4): New variable. * gnu/packages/patches/lua-5.4-liblua-so.patch, gnu/packages/patches/lua-5.4-pkgconfig.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Alex Devaure 2022-01-13gnu: bubblewrap: Update to 0.5.0....* gnu/packages/patches/bubblewrap-fix-locale-in-tests.patch: Add it. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/virtualization.scm (bubblewrap): Update to 0.5.0. [source]: Add patch. [arguments]: Adjust test substitutions. [inputs]: Remove labels. [native-inputs]: Remove labels. Signed-off-by: Ludovic Courtès <ludo@gnu.org> kiasoc5 2022-01-13gnu: jami: Update to 20211223.2.37be4c3....* gnu/packages/patches/pjproject-correct-the-cflags-field.patch: Delete file. * gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch: Likewise. * gnu/local.mk (dist_patch_DATA): De-register them. * gnu/packages/jami.scm (%jami-version): Update version string. (%jami-sources): Adjust snippet. (jami-apply-custom-patches): Use G-Exp. (pjproject-jami): Use Savoir-faire Linux's fork and update to 2.11-0.e1f389d. [phases]: Adjust and update accordingly. (%ffmpeg-default-configure-flags): Capitalize and reword comments. (ffmpeg-jami)[native-inputs]: Delete field. [tests?]: Add comment and move into the SUBSTITUTE-KEYWORD-ARGUMENTS use. [phases]: Use G-Exp and update the list of patches. (libring): Deprecate and rename to... (libjami): ... this. Move the arguments field before the inputs. [tests?]: Add explanatory comment. [configure-flags]: Add '--disable-agent', with explanatory comment. [phases]{change-directory}: Rename to... {change-directory/maybe}: ... this, to attempt but not enforce a directory change so as to also support using a Git checkout as source. {add-lib-dir}: Remove phase. [inputs]: Use new style. [native-inputs]: Add cppunit. (libringclient): Deprecate and rename to... {jami-libclient}: ... this. [configure-flags]: Enable LIBWRAP. [phases]{change-directory/maybe}: Renamed from change-directory, for reasons described above. [inputs]: Adjust accordingly. (jami-gnome): Move the input fields below the arguments field. [phases]{change-directory/maybe}: Renamed from change-directory, for reasons described above. [inputs]: Rename libringclient to jami-libclient and use new style. [native-inputs]: Use new style. [propagated-inputs]: Delete field. (jami-qt): Deprecate and rename to... (jami): ... this. [phases]{change-directory/maybe}: Renamed from change-directory, for reasons described above. [native-inputs]: Add python. [inputs]: Adjust accordingly. [propagated-inputs]: Delete field. Maxim Cournoyer 2022-01-13gnu: pjproject: Apply patch to install the libpjsua2 shared library....* gnu/packages/patches/pjproject-install-libpjsua2.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/telephony.scm (pjproject): Apply it. Maxim Cournoyer 2022-01-11gnu: nautilus: Fix build with libportal-0.5....* gnu/packages/patches/nautilus-add-libportal-gtk3.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/gnome.scm (nautilus)[source]: Use it. Pierre Langlois 2022-01-11gnu: QEMU: Update to 6.2.0....* gnu/packages/patches/qemu-CVE-2021-20203.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/virtualization.scm (qemu): Update to 6.2.0. [source](patches): Remove obsolete patch. Marius Bakke 2022-01-11gnu: epiphany: Fix build with libportal-0.5....* gnu/packages/patches/epiphany-update-libportal-usage.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/gnome.scm (epiphany)[source]: Use it. Guillaume Le Vaillant 2022-01-11gnu: eog: Fix build with libportal-0.5....After the update to libportal-0.5 in 294476022f19139e290acb448d4575de0f851673 eog fails with: ../eog-40.3/src/eog-util.c:48:10: fatal error: libportal/portal-gtk3.h: No such file or directory This was already fixed upstream and this commits extracts the patch. * gnu/packages/patches/eog-update-libportal-usage.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/gnome.scm(eog)[origin]: Add new patch. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Daniel Meißner 2022-01-11gnu: Add htslib-for-stringtie....* gnu/packages/bioinformatics.scm (htslib-for-stringtie): New variable. * gnu/packages/patches/htslib-for-stringtie.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Ricardo Wurmus 2022-01-11gnu: Add gpaste....* gnu/packages/gnome-xyz.scm (gpaste): New variable. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Attila Lendvai 2022-01-11gnu: dealii: Update to 9.3.2....* gnu/packages/maths.scm (dealii): Update to 9.3.2. [source]: Add dealii-fix-compiliation-with-boost-1.78.patch and dealii-fix-sundials.patch. [inputs]: Use simplified format. [native-inputs]: Use simplified format. * gnu/packages/patches/dealii-fix-compiliation-with-boost-1.78.patch: New file. * gnu/packages/patches/dealii-fix-sundials.patch: New file. * gnu/local.mk: Add new patch files. Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Felix Gruber 2022-01-09gnu: chez-scheme: Update to 9.5.6....* gnu/packages/chez.scm (chez-scheme): Update to 9.5.6. [source]: Remove patch. [arguments]: Don't explicitly return #t from phases. * gnu/packages/patches/chez-scheme-build-util-paths-backport.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. Tobias Geerinckx-Rice 2022-01-07gnu: ungoogled-chromium: Update to 97.0.4692.71-1....* gnu/packages/patches/ungoogled-chromium-system-ffmpeg.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/chromium.scm (%guix-patches): Add it. (%chromium-version): Set to 97.0.4692.71-1. (%ungoogled-origin, ungoogled-chromium): Update hashes. Marius Bakke 2022-01-07gnu: xpra: Install Cython-built libraries....xpra would fail to start, because shared objects were not installed. It’s not clear why it stopped working, but it seems it was not the upgrade I reverted in commit ab6d56d01d62757caa66fe0a23e8864c9122f0e6 to fix #52869. Sorry for the confusion :( * gnu/packages/patches/xpra-4.2-install_libs.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/xorg.scm (xpra)[source]: Add new patch. [arguments]: Ensure 'build phase runs and passes #:configure-flags to setup.py. Lars-Dominik Braun 2022-01-06gnu: tremc: Fix execution with recent Python....* gnu/packages/bittorrent.scm (tremc)[source]: Add patch. * gnu/packages/patches/tremc-fix-decodestring.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Reported by gnoo in #guix Tobias Geerinckx-Rice 2022-01-06gnu: Add openrgb....* gnu/packages/hardware.scm (openrgb): New variable. * gnu/packages/patches/openrgb-unbundle-hueplusplus.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Leo Famulari <leo@famulari.name> John Kehayias 2022-01-06gnu: Add hueplusplus....* gnu/packages/hardware.scm (hueplusplus): New variable. * gnu/packages/patches/hueplusplus-mbedtls.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. John Kehayias 2022-01-05gnu: tootle: Fix build....* gnu/packages/patches/tootle-glib-object-naming.patch, gnu/packages/patches/tootle-reason-phrase.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/mastodon.scm (tootle)[source]: Use them. [inputs]: Use LIBSOUP-MINIMAL-2 instead of LIBSOUP. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Taiju HIGASHI