Commit Graph

6747 Commits

Author SHA1 Message Date
Maxim Cournoyer
5dd3acd0a0
import: gnome: Improve version handling logic.
Before this change, we'd get:

    $ guix refresh gedit
    updating from version 40.1 to version 43.alpha...

This is because the new GNOME version scheme introduced in 2021 with GNOME 40
was not treated correctly.  Also, no longer ignore odd numbered minor
versions, as this appears to be a declining practice in GNOME.

* guix/import/gnome.scm (latest-gnome-release)
<pre-release-text?>: New predicate.
<even-minor-version?>: Rename to...
<release-version?>: ...this.  Return #f in case the version corresponds to a
development release.
* guix/import/gnome.scm (latest-gnome-release): Adjust accordingly.
2022-09-13 02:04:36 -04:00
Morgan Smith
58d0453aa7
build-system: emacs: Use new function for autoloads generation
* guix/build/emacs-utils.scm (emacs-generate-autoloads): Use
'loaddefs-generate' to create autoloads instead of
'update-directory-autoloads' if we are using a new enough Emacs

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2022-09-11 15:46:32 +02:00
Liliana Marie Prikler
630c9b6e01
build-system: emacs: Use native compilation.
* guix/build/emacs-build-system.scm (add-install-to-native-load-path):
New variable.
(build): Replace ‘emacs-byte-compile-directory’ with ‘emacs-compile-directory’.
Delete already compiled files in the working directory prior to compilation.
(%standard-phases): Add ‘add-install-to-native-load-path’ after
‘expand-load-path’.
2022-09-11 15:46:32 +02:00
Liliana Marie Prikler
b54724b2ac
guix: emacs-utils: Add emacs-compile-directory.
* guix/build/emacs-utils.scm (emacs-compile-directory): New variable.
2022-09-11 15:46:32 +02:00
Ludovic Courtès
8f53630f2f
syscalls: Avoid repeated calls to 'syscall->procedure'.
Commit 7df4d3465d305271d4fdf4e6f886a248d63b82c4 and others changed
'mount', 'umount', & co. so they would call 'syscall->procedure' at each
call.  This change reverts to the previous behavior, where
'syscall->procedure' is called once.

* guix/build/syscalls.scm (mount, umount, reboot, load-linux-module):
Call 'syscall->procedure' only once.
2022-09-08 16:22:21 +02:00
Ludovic Courtès
392e97ed08
import: gnome: Reject version strings such as "43.alpha".
Reported by Maxim Cournoyer.
This is a followup to 61b63e7fa73be8828af2b36d196c3676c974e119.

* guix/import/gnome.scm (latest-gnome-release)[even-minor-version?]:
Reject VERSION is the minor or micro part is not an integer.
2022-09-08 16:22:21 +02:00
Ludovic Courtès
69d72c553f
search-paths: Tweak $SSL_CERT_DIR comment.
* guix/search-paths.scm ($SSL_CERT_DIR): Fix typos and tweak comment.
2022-09-08 16:22:21 +02:00
Ludovic Courtès
2f5f539b60
search-paths: Clarify $GUIX_EXTENSIONS_PATH comment.
* guix/search-paths.scm ($GUIX_EXTENSIONS_PATH): Clarify comment.
2022-09-08 16:22:21 +02:00
Ludovic Courtès
e7b8e83670
search-paths: Remove redundant uses of 'define-public'.
* guix/search-paths.scm ($GUIX_EXTENSIONS_PATH, $SSL_CERT_DIR,
$SSL_CERT_FILE): Use 'define', not 'define-public'.
2022-09-08 16:22:20 +02:00
Mathieu Othacehe
e0c1124a48
guix: platform: Use #false instead of #f.
* guix/platform.scm (<platform>): Adapt it.
2022-09-07 14:24:52 +02:00
(unmatched-parenthesis
bbc1735be2
profiles: Implicitly set GUIX_EXTENSIONS_PATH.
* guix/build/profiles.scm (manifest-sexp->inputs+search-paths):
Always return a search path for GUIX_EXTENSIONS_PATH.
* guix/search-paths.scm ($GUIX_EXTENSIONS_PATH): New variable.

This allows Guix to find extensions without any need for users to
set GUIX_EXTENSIONS_PATH manually.

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2022-09-07 11:30:31 +03:00
Ludovic Courtès
61b63e7fa7
import: gnome: Do not require even minor for two-number version strings.
That way, "guix refresh gnome-keyring" will properly return "42.1"
instead of "42.0".

Reported by Maxim Cournoyer.

* guix/import/gnome.scm (latest-gnome-release)[even-minor-version?]:
Tweak for GNOME applications.
2022-09-06 16:58:12 +02:00
Ludovic Courtès
7a2acbdc5a
store: Open daemon connections with SOCK_CLOEXEC.
Previously, 'guix shell' for example would leak the socket that's
connected to the daemon.

* guix/store.scm (open-unix-domain-socket, open-inet-socket): Pass
SOCK_CLOEXEC to 'socket'.
* tests/guix-shell.sh: Add test.
2022-09-04 23:10:10 +02:00
Ludovic Courtès
2028419e30
store: Remove unused variable and 'socket' call.
* guix/store.scm (open-inet-socket): Remove unused 'sock' variable.
2022-09-04 23:10:10 +02:00
Ludovic Courtès
aaf7820d57
read-print: Improve declaration of integer bases.
This is a followup to c3b1cfe76b7038f4030d7d207ffc417fed9a7ead.

* guix/read-print.scm (%symbols-followed-by-octal-integers)
(%symbols-followed-by-hexadecimal-integers): Remove.
* guix/read-print.scm (%integer-forms): New variable.
(integer->string)[form-base, octal?]: New procedures.
Rewrite accordingly.
2022-09-02 10:49:35 +02:00
Ludovic Courtès
82968362ea
read-print: Define forms for which \n, \t, etc. are not escaped.
Previously, the pretty-printer would unconditionally leave everything
but double-quotes and backslashes unescaped when rendering a string.
With this change, the previous behavior only applies to forms listed in
%NATURAL-WHITESPACE-STRING-FORMS.

* guix/read-print.scm (%natural-whitespace-string-forms): New variable.
(printed-string): New procedure.
(pretty-print-with-comments): Use it instead of 'escaped-string'.
* tests/read-print.scm: Add test.
2022-09-02 10:49:35 +02:00
Ludovic Courtès
c3b1cfe76b
read-print: Guess the base to use for integers being printed.
Fixes <https://issues.guix.gnu.org/57090>.
Reported by Christopher Rodriguez <yewscion@gmail.com>.

* guix/read-print.scm (%symbols-followed-by-octal-integers)
(%symbols-followed-by-hexadecimal-integers): New variables.
* guix/read-print.scm (integer->string): New procedure.
(pretty-print-with-comments): Use it.
* tests/read-print.scm: Add test.
2022-09-01 18:31:26 +02:00
Ludovic Courtès
67a6828b2b
pull: Create a version 3 manifest.
This makes the profile readable by older Guix instances.  This is a
followup to c9fbd40785a99e13a59d8e530830ce85220a9871.

Fixes <https://issues.guix.gnu.org/57306>.
Reported by Arun Isaac <arunisaac@systemreboot.net>.

* guix/profiles.scm (%manifest-format-version): Export.
* guix/scripts/package.scm (build-and-use-profile): Add #:format-version
and pass it to 'profile-derivation'.
* guix/scripts/pull.scm (build-and-install): Pass #:format-version 3.
2022-08-31 12:34:10 +02:00
Ludovic Courtès
270e1b9e1e
reconfigure: Use 'current-channels' to obtain provenance data.
This reinstates a modified version of
b08439809f0868a74d0bd0e14d45cb3e5dd46a8c, which contained a thinko.

Previously, build-time metadata from (guix config) would be ignored when
available--e.g., when running /run/current-system/profile/bin/guix.

This is a followup to 316fc2acbb112bfa572ae30f95a93bcd56621234.

* guix/scripts/system/reconfigure.scm (check-forward-update): Use
'current-channels' rather than 'current-profile' + 'profile-channels'.
2022-08-31 11:40:06 +02:00
Mathieu Othacehe
6454164412
scripts: system: Check the image operating-system.
* guix/scripts/system.scm (process-action): Check that the provided image has
a defined operating-system.
2022-08-30 19:29:58 +02:00
Thiago Jung Bauermann
65ce5fe2fb
guix system: Use standard cross and native build options.
This change prevents guix system from erroring out with an ugly backtrace
when it's passed an invalid value to the “--system” or “--target”
option. It also adds the “--list-systems” and “--list-targets” options.

The manual section about guix system doesn't mention the “--target” option,
so add it there.

* guix/scripts/system (show-help): Call show-cross-build-options-help and
show-native-build-options-help.
(%options): Remove own implementation of “system” and “target” options and
use the ones in %standard-cross-build-options and
%standard-native-build-options.
* doc/guix.texi (Invoking guix system): Document “--target” option.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-08-30 08:55:16 +02:00
宋文武
e214e87cc5
Revert "reconfigure: Use 'current-channels' to obtain provenance data."
This fixes <https://issues.guix.gnu.org/57480>.

This reverts commit b08439809f0868a74d0bd0e14d45cb3e5dd46a8c.
2022-08-30 14:44:07 +08:00
Ludovic Courtès
b08439809f
reconfigure: Use 'current-channels' to obtain provenance data.
Previously, build-time metadata from (guix config) would be ignored when
available--e.g., when running /run/current-system/profile/bin/guix.

This is a followup to 316fc2acbb112bfa572ae30f95a93bcd56621234.

* guix/scripts/system/reconfigure.scm (check-forward-update): Use
'current-channels' rather than 'current-profile' + 'profile-channels'.
2022-08-30 00:40:04 +02:00
Maxim Cournoyer
ba0dbe3bf2
gexp: directory-union: Fix documentation.
* guix/gexp.scm (directory-union): Fix documentation.
2022-08-28 21:14:18 -04:00
Marius Bakke
ada35de38f
gnu: scons: Move to (gnu packages build-tools).
* gnu/packages/python-xyz.scm (scons, scons-python2): Move from here ...
* gnu/packages/build-tools.scm (scons, scons-python2): ... to here.
* gnu/packages/direct-connect.scm, gnu/packages/disk.scm,
gnu/packages/game-development.scm, gnu/packages/gps.scm,
gnu/packages/image.scm, gnu/packages/installers.scm, gnu/packages/web.scm,
gnu/packages/xdisorg.scm: Adjust module imports accordingly.
* guix/build-system/scons.scm (default-scons): Likewise.
2022-08-27 23:48:56 +02:00
Ricardo Wurmus
b0c9f03248
import/utils: beautify-description: Add case for "Implements".
* guix/import/utils.scm (beautify-description): Add case to transform
sentences beginning with "Implements".
2022-08-25 11:55:12 +02:00
Andrew Tropin
aac1065930
build-system/gnu: Fix docstring.
* guix/build-system/gnu.scm (dist-package): Fix docstring.
2022-08-19 18:55:42 +03:00
Liliana Marie Prikler
37cd553679
ui: Describe package outputs.
* guix/ui.scm (package->recutils): Output outputs with their descriptions,
one per line.
* po/packages/Makevars (XGETTEXT_OPTIONS): Add ‘output-synopsis’ as keyword.
2022-08-16 21:25:25 +02:00
Ludovic Courtès
a817064947
build-system/channel: Correctly handle store file name from (gnu ci).
This is a followup to cf60a0a906440ccb007bae1243c3e0397c3a0aba.

Reported by Mathieu Othacehe <othacehe@gnu.org>.

* guix/build-system/channel.scm (build-channels): Add 'string?' case.
2022-08-11 15:57:35 +02:00
Ludovic Courtès
b21d05d232
read-print: Remove unused procedure.
* guix/read-print.scm (combine-vertical-space): Remove.
2022-08-10 16:53:58 +02:00
Ludovic Courtès
ebda12e1d2
read-print: Report missing closing parens instead of looping.
Fixes <https://issues.guix.gnu.org/57093>.
Reported by Mohammed AMAR-BENSABER <renken@shione.net>.

Previously 'read-with-comments' would enter an infinite loop.

* guix/read-print.scm (read-with-comments)[missing-closing-paren-error]:
New procedure.
Call it when 'loop' as called from 'liip' returns EOF.
* tests/read-print.scm ("read-with-comments: missing closing paren"):
New test.
2022-08-10 16:53:58 +02:00
Ludovic Courtès
06ce4e3c06
ssh: 'open-ssh-session' gracefully handles connection timeouts.
* guix/ssh.scm (open-ssh-session): Add case for 'again.
2022-08-10 16:53:58 +02:00
Oleg Pykhalov
4b49487838
gnu: system: file-systems: Add shared flag.
* gnu/build/file-systems.scm (mount-flags->bit-mask, mount-file-system):
Handle shared flag.
* gnu/system/file-systems.scm (invalid-file-system-flags): Add shared to known
flags.
* guix/build/syscalls.scm (MS_SHARED): New variable.
* doc/guix.texi (File Systems): Document shared flag.
2022-08-10 07:12:25 +03:00
Ludovic Courtès
60e0aae89c
channels: Consider news files as UTF-8-encoded by default.
Partly fixes <https://issues.guix.gnu.org/57039>.
Reported by Pierre-Henry Fröhring <contact@phfrohring.com>.

Previously, news file would be read using the current locale encoding.
This could lead to a test failure in 'tests/channels.scm' (in a test
that expects some Unicode-capable encoding) in case tests were run in a
non-Unicode locale.

* guix/channels.scm (channel-news-for-commit): Make port for NEWS-FILE
UTF-8 by default.
2022-08-09 15:59:09 +02:00
Ludovic Courtès
e1b8bace8c
tests: git: Write files as UTF-8.
* guix/tests/git.scm (populate-git-repository): Add call to
'set-port-encoding!' in 'add' case.
2022-08-09 15:58:14 +02:00
Ludovic Courtès
64a070717c
channels: Add 'repository->guix-channel'.
* guix/channels.scm (repository->guix-channel): New procedure.
* guix/scripts/describe.scm (display-checkout-info): Use it instead of
the (git) interface, and adjust accordingly.
2022-08-09 15:16:06 +02:00
Ludovic Courtès
cf60a0a906
build-system/channel: Accept a channel or instance as the source.
* guix/build-system/channel.scm (latest-channel-instances*): New
variable.
(build-channels): New procedure, with code formerly in
'channel-build-system', augmented with clauses for when SOURCE is a
channel instance or a channel.
* doc/guix.texi (Build Systems): Adjust accordingly.
2022-08-09 15:16:06 +02:00
Ludovic Courtès
5bce4c8242
build-system: Add 'channel-build-system'.
* gnu/ci.scm (channel-build-system, channel-source->package): Remove.
* gnu/packages/package-management.scm (channel-source->package): New
procedure, moved from (gnu ci).
* guix/build-system/channel.scm: New file, with code moved from (gnu ci).
* doc/guix.texi (Build Systems): Document it.
2022-08-09 15:16:06 +02:00
Ludovic Courtès
6db3b34d72
read-print: Add 'case' and 'cond' special forms.
* guix/read-print.scm (%special-forms): Add 'case' and 'cond'.
* tests/read-print.scm: Add tests.
2022-08-08 11:54:25 +02:00
Ludovic Courtès
445a0d134c
read-print: Support printing multi-line comments.
* guix/read-print.scm (%not-newline): New variable.
(print-multi-line-comment): New procedure.
(pretty-print-with-comments): Use it.
* tests/read-print.scm ("pretty-print-with-comments, multi-line
comment"): New test.
2022-08-08 11:54:24 +02:00
Ludovic Courtès
a15542d26d
style: Add '--whole-file' option.
* guix/scripts/style.scm (format-whole-file): New procedure.
(%options, show-help): Add '--whole-file'.
(guix-style): Honor it.
* tests/guix-style.sh: New file.
* Makefile.am (SH_TESTS): Add it.
* doc/guix.texi (Invoking guix style): Document it.
2022-08-08 11:53:33 +02:00
Ludovic Courtès
90ef692e9b
read-print: 'canonicalize-comment' leaves top-level comments unchanged.
This lets users use three leading semicolons, for instance, in top-level
comments.

* guix/read-print.scm (canonicalize-comment): Add INDENT parameter and
honor it.
(pretty-print-with-comments): Change default value of #:format-comment.
Call FORMAT-COMMENT with INDENT as the second argument.
* tests/read-print.scm: Adjust test accordingly.
2022-08-08 11:22:32 +02:00
Ludovic Courtès
9b00c97de4
read-print: Add code to read and write sequences of expressions/blanks.
* guix/read-print.scm (read-with-comments): Add #:blank-line? and honor it.
(read-with-comments/sequence, pretty-print-with-comments/splice): New
procedures.
* tests/read-print.scm (test-pretty-print/sequence): New macro.
Add tests using it.
2022-08-08 11:22:32 +02:00
Ludovic Courtès
077324a16f
read-print: Recognize page breaks.
* guix/read-print.scm (<page-break>, page-break?, page-break)
(char-set:whitespace-sans-page-break): New variables.
(space?): New procedure.
(read-vertical-space): Use it.
(read-until-end-of-line): New procedure.
(read-with-comments): Add #\page case.
(pretty-print-with-comments): Add 'page-break?' case.
* tests/read-print.scm ("read-with-comments: top-level page break"): New
test.
Add round-trip test with page break within an sexp.
2022-08-08 11:22:32 +02:00
Ludovic Courtès
f687e27e03
read-print: Read and render vertical space.
* guix/read-print.scm (<vertical-space>, vertical-space?)
(vertical-space, vertical-space-height): New variables.
(combine-vertical-space, canonicalize-vertical-space)
(read-vertical-space): New procedures.
(read-with-comments): Use it in the #\newline case.
(pretty-print-with-comments): Add #:format-vertical-space and honor it.
Add case for 'vertical-space?'.
* guix/scripts/style.scm (format-package-definition): Pass
 #:format-vertical-space to 'object->string*'.
* tests/read-print.scm ("read-with-comments: list with blank line")
("read-with-comments: list with multiple blank lines")
("read-with-comments: top-level blank lines")
("pretty-print-with-comments, canonicalize-vertical-space"): New tests.
Add a couple of additional round-trip tests.
2022-08-08 11:22:32 +02:00
Ludovic Courtès
5b273e7c77
read-print: Introduce <blank> parent class of <comment>.
* guix/read-print.scm (<blank>, blank?): New record type.
(<comment>): Redefine using the record interface.
(read-with-comments, pretty-print-with-comments): Change some uses of
'comment?' to 'blank?'.
* guix/scripts/style.scm (simplify-inputs)[simplify-expressions]: Use
'blank?' instead of 'comment?'.
2022-08-08 11:22:32 +02:00
Ludovic Courtès
38f1fb843c
read-print: Expose comment constructor.
* guix/read-print.scm (<comment>): Rename constructor to
'string->comment'.
(comment): New procedure.
(read-with-comments, canonicalize-comment): Use 'string->comment'
instead of 'comment'.
2022-08-08 11:22:32 +02:00
Ludovic Courtès
632d4ccc0b
read-print: Add System and Home special forms.
* guix/read-print.scm (%special-forms): Add System and Home forms.
(%newline-forms): Add 'services'.
2022-08-08 11:22:31 +02:00
Ludovic Courtès
5817e222fa
style: Move reader and printer to (guix read-print).
* guix/scripts/style.scm (<comment>, read-with-comments)
(vhashq, %special-forms, %newline-forms, prefix?)
(special-form-lead, newline-form?, escaped-string)
(string-width, canonicalize-comment, pretty-print-with-comments)
(object->string*): Move to...
* guix/read-print.scm: ... here.  New file.
* guix/scripts/import.scm: Adjust accordingly.
* tests/style.scm: Move 'test-pretty-print' and tests to...
* tests/read-print.scm: ... here.  New file.
* Makefile.am (MODULES): Add 'guix/read-print.scm'.
(SCM_TESTS): Add 'tests/read-print.scm'.
2022-08-08 11:22:31 +02:00
Ludovic Courtès
ad8beb6325
lint: Add '-e'.
* guix/scripts/lint.scm (show-help, %options): Add '-e'.
(guix-lint): Call 'specification->package' while traversing OPTS.  Add
case for 'expression pair.  Adjust 'for-each' loop to expect packages.
* doc/guix.texi (Invoking guix lint): Document it.
2022-08-08 11:22:31 +02:00