Commit Graph

7160 Commits

Author SHA1 Message Date
Ricardo Wurmus
8525c26499
import/cran: Remove directory-needs-zlib? in favor of needed-libraries-in-directory.
* guix/import/cran.scm (directory-needs-zlib?): Remove procedure.
(source-dir->dependencies): Use needed-libraries-in-directory instead of
directory-needs-zlib?.
2023-02-18 19:56:30 +01:00
Ricardo Wurmus
049cff91ac
import/cran: Add generic way to detect needed libraries.
* guix/import/cran.scm (needed-libraries-in-directory): New procedure.
(libraries-pattern, packages-for-matches): New variables.
2023-02-18 19:56:30 +01:00
Ricardo Wurmus
271c0bfcf2
import/cran: Process all vignette builders.
* guix/import/cran.scm (needs-knitr?): Remove procedure.
(vignette-builders): New procedure.
(description->package): Use vignette-builders instead of needs-knitr?.
2023-02-18 19:56:30 +01:00
Ricardo Wurmus
c0507e9f1e
import/cran: Add name mapping for libjpeg.
* guix/import/cran.scm (transform-sysname): Add mapping from libjpeg to
libjpeg-turbo.
2023-02-18 19:56:29 +01:00
Ricardo Wurmus
6ce68a7a83
import/cran: Add directory-needs-esbuild?.
* guix/import/cran.scm (directory-needs-esbuild?): New procedure.
(source-dir->dependencies): Use it.
2023-02-18 19:56:29 +01:00
Tobias Geerinckx-Rice
df5a358f67
licenses: Update NPSL (nmap licence).
The previous URL does not resolve.  The new URL contains an updated
licence text (version 0.95 at time of this commit) that is strictly less
worse than previous versions, and applies retroactively to older nmaps:

  “Versions of Nmap released under previous versions of the NPSL may
   also be used under the NPSL 0.95 terms.”
     -- <https://nmap.org/changelog>

* guix/licenses.scm (nmap): Update.
2023-02-12 01:00:00 +01:00
Pierre Langlois
dbd4d2d070
build-system: Add tree-sitter-build-system.
* guix/build-system/tree-sitter.scm: New module.
* guix/build/tree-sitter-build-system.scm: Likewise.
* Makefile.am (MODULES): Add them.
* doc/guix.texi: Document it.

Signed-off-by: Andrew Tropin <andrew@trop.in>
2023-02-12 11:32:20 +04:00
Ludovic Courtès
a68229b9a0
syscalls: 'with-file-lock' removes lock file upon exit.
Fixes <https://issues.guix.gnu.org/57501>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/build/syscalls.scm (call-with-file-lock)
(call-with-file-lock/no-wait): Add call to 'delete-file' in unwind
handler.
2023-02-12 01:48:53 +01:00
Christopher Baines
7d0ebe040d
download: Add bordeaux.guix.gnu.org as a content addressed mirror.
bordeaux.guix.gnu.org now provides access to some files by hash. This is done
through the nar-herder finding a nar produced by a fixed output derivation for
the requested content, and then providing the content stored inside that nar.

I've put this new entry at the start of the list, as I think it's more likely
to have content than the others. Because bordeaux.guix.gnu.org stores nars
indefinitely, my suspicion is that it's going to be able to fulfil more
requests than ci.guix.gnu.org, which relies on the file requested being in the
store (so the now frequent garbage collection is going to limit the files
available).

* guix/download.scm (%content-addressed-mirrors): Add bordeaux.guix.gnu.org.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2023-02-11 20:34:22 +00:00
Ludovic Courtès
3ab8559436
status: Print a hint when a 'package-cache' hook fails to build.
* guix/channels.scm (package-cache-file): Add 'channels' to the #:properties
list.
* guix/status.scm (print-build-event): Upon failure, display a hint when
the derivation is a 'package-cache' hook.
2023-02-11 00:09:40 +01:00
Philip McGrath
a89aa4523b
utils: Add target-little-endian?.
* guix/utils.scm (target-little-endian?): New function.
* guix/build-system/meson.scm (make-machine-alist): Use it.
* gnu/packages/chez.scm (nix-system->pbarch-machine-type): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-02-11 00:09:40 +01:00
Ludovic Courtès
25947bbc32
build-system: Always pass #:graft? #f to 'gexp->derivation'.
Fixes <https://issues.guix.gnu.org/60947>.

Fixes a bug whereby packages referred via 'ungexp' in package arguments
would be "double-grafted": 'gexp->derivation' would first replace those
references by references to the grafted package, only to repeat the
grafting process on the result.

Build systems such as 'gnu', 'cmake', and 'pyproject' were already doing
this.  Only the rest of them is affected.

* guix/build-system/cargo.scm (cargo-build): Pass #:graft? #f to
'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/guile.scm (guile-build): Likewise.
(guile-cross-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/ruby.scm (ruby-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/waf.scm (waf-build): Likewise.
2023-02-03 16:26:20 +01:00
Efraim Flashner
4cf1acc7f3
Merge remote-tracking branch 'origin/master' into core-updates
Conflicts:
	doc/guix.texi
	gnu/local.mk
	gnu/packages/admin.scm
	gnu/packages/base.scm
	gnu/packages/chromium.scm
	gnu/packages/compression.scm
	gnu/packages/databases.scm
	gnu/packages/diffoscope.scm
	gnu/packages/freedesktop.scm
	gnu/packages/gnome.scm
	gnu/packages/gnupg.scm
	gnu/packages/guile.scm
	gnu/packages/inkscape.scm
	gnu/packages/llvm.scm
	gnu/packages/openldap.scm
	gnu/packages/pciutils.scm
	gnu/packages/ruby.scm
	gnu/packages/samba.scm
	gnu/packages/sqlite.scm
	gnu/packages/statistics.scm
	gnu/packages/syndication.scm
	gnu/packages/tex.scm
	gnu/packages/tls.scm
	gnu/packages/version-control.scm
	gnu/packages/xml.scm
	guix/build-system/copy.scm
	guix/scripts/home.scm
2023-01-30 12:39:40 +02:00
Jonathan Brielmaier
3e8dd0df8c
build-system: copy: Add substitutable keyword.
* guix/build-system/copy.scm (copy-build): Add substitutable keyword.
2023-01-29 20:31:29 +01:00
Ludovic Courtès
52eb3db19c
container: Correctly report exit status.
* gnu/build/linux-container.scm (container-excursion): Return the raw
status value.
* tests/containers.scm ("container-excursion, same namespaces"): Add
'status:exit-val' call.
* guix/scripts/container/exec.scm (guix-container-exec): Correctly
handle the different cases.
2023-01-30 22:24:27 +01:00
Tobias Geerinckx-Rice
be97c7ed11
download: Remove dead SourceForge mirrors.
* guix/download.scm (%mirrors): Remove dl.sourceforge.net subdomains
that no longer resolve.
2023-01-22 01:01:01 +01:00
Ludovic Courtès
fed3953d70
inferior: Use 'spawn' on Guile 3.0.9+.
* guix/inferior.scm (open-bidirectional-pipe): When 'spawn' is defined,
use it instead of 'primitive-fork'.
2023-01-26 11:11:18 +01:00
Ludovic Courtès
852908d24d
ui: Add "error-reporting wrapper" for 'mkdir'.
* guix/ui.scm <top level>: Change 'mkdir' to use an error-reporting
wrapper.
2023-01-25 22:53:20 +01:00
Ludovic Courtès
e6c01420db
channels: 'channel->code' emits 'channel' field only when necessary.
* guix/channels.scm (channel->code): Emit 'commit' field only when it is
true.
2023-01-23 23:23:07 +01:00
Ludovic Courtès
a8792bc796
import: opam: Do not crash when description is missing.
Previous 'guix import opam coccinelle' would crash due to the lack of a
description.

* guix/import/opam.scm (opam->guix-package): Call 'beautify-description'
only when "description" metadata is available.
2023-01-23 23:23:07 +01:00
Maxim Cournoyer
10e51d6dde
platforms: Raise an exception when no suitable platform is found.
This was motivated by #60786, which produced a cryptic, hard to understand
backtrace.

Given the following reproducer:
    (use-modules (guix packages)
                 (gnu packages cross-base))

    (define linux-libre-headers-cross-mips64el-linux-gnuabi64
      (cross-kernel-headers "mips64el-linux-gnuabi64"))

    (package-arguments linux-libre-headers-cross-mips64el-linux-gnuabi64)

Before this change:
    ice-9/boot-9.scm:1685:16: In procedure raise-exception:
    In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f

After this change:
    ice-9/boot-9.scm:1685:16: In procedure raise-exception:
    ERROR:
      1. &platform-not-found-error: "mips64el-linux-gnuabi64"

* guix/platform.scm (&platform-not-found-error): New condition.
(platform-not-found-error?): New predicate.
(false-if-platform-not-found): New syntax.
(lookup-platform-by-system): Raise an exception when no platform is found.
Update documentation.
(lookup-platform-by-target): Likewise.
(lookup-platform-by-target-or-system): Likewise, and guard lookup calls with
false-if-platform-not-found.
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Handle
lookup-platform-by-system call to preserve existing behavior.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-01-18 20:53:15 -05:00
Ludovic Courtès
c4a8762e52
debug-link: Protect against dangling symlinks.
Fixes <https://issues.guix.gnu.org/60584>.
Reported by Greg Hogan <code@greghogan.com>
and Sébastien Rey-Coyrehourcq <sebastien.rey-coyrehourcq@univ-rouen.fr>.

* guix/build/debug-link.scm (find-elf-files): Wrap 'elf-file?' call in 'catch'.
2023-01-17 16:05:20 +01:00
Mathieu Othacehe
34c7dd7e09
build-system/meson: Add mips64el cross compilation support.
* guix/build-system/meson.scm (make-machine-alist): Add it.
2023-01-17 10:50:58 +01:00
Antero Mejr
93e683a952
scripts: repl: Add -i, --interactive flag.
* guix/scripts/repl.scm (%options): Add -i, --interactive flag.
(guix-repl): Honor -i, --interactive flag.
* doc/guix.texi (Invoking guix repl): Add documentation for -i, --interactive.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-01-16 09:00:03 -05:00
Antero Mejr
abd9569571
scripts: repl: Add --list-types flag.
* guix/scripts/repl.scm (%options): Add --list-types.
* doc/guix.texi (Invoking guix repl): Add documentation for --list-types.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-01-16 08:50:05 -05:00
Ludovic Courtès
20c923c40d
transformations: Let users know when '--with-latest' has no effect.
* guix/transformations.scm (package-with-upstream-version): Print a
message when VERSION is false and SOURCE has the same version as P.
2023-01-16 13:41:27 +01:00
Ludovic Courtès
137b91f03b
transformations: Add '--with-version'.
This is a followup to 8aeccc6240.

* guix/transformations.scm (package-with-upstream-version): New procedure.
(transform-package-latest)[package-with-latest-upstream]: Remove.
Use 'package-with-upstream-version' instead.
(transform-package-version): New procedure.
(%transformations, %transformation-options)
(show-transformation-options-help/detailed): Add '-with-version'.
* tests/transformations.scm ("options->transformation, with-version"):
New test.
* doc/guix.texi (Package Transformation Options): Document '--with-version'.
(Defining Package Variants): Mention it.
2023-01-16 13:41:27 +01:00
Ludovic Courtès
99e255d04b
guix graph: '--path' defaults to "out" in the case of multiple outputs.
Previously, "guix graph -t references --graph guix guile" would fail
with:

  no path from '/gnu/store/…-guix-1.4.0-1.9fe5b49' to '/gnu/store/…-guile-3.0.8-debug'

simply because the "debug" happened to be the first one, getting bound
to NODE2.  With this change it will instead pick the "out" output of
each.

* guix/scripts/graph.scm (guix-graph)[shorter?, length-sorted]: New
procedures.
In the 'path?' case, use the latter to store node lists.
2023-01-16 00:06:56 +01:00
Ludovic Courtès
a4a35e123b
guix graph: 'guix graph --path' correctly handles multiple outputs.
Previously, "guix graph -t references --path guix guile" would fail
with:

  error: '--path' option requires exactly two nodes (given 2)

This is because '_' in the 'match' clause wouldn't match the
placeholder and would instead be interested as a variable name, thereby
meaning NODES is expected to have two lists with the same tail.

* guix/scripts/graph.scm (guix-graph): Rename '_' in 'mlet' to '_g' so
that the literal '_' used in 'match' below matches.
2023-01-16 00:06:55 +01:00
John Kehayias
3bfbfa2946
environment: Fix '--emulate-fhs' option overriding $PATH.
Fixes <https://issues.guix.gnu.org/60566> where even if "--preserve='^PATH$'"
was passed to 'guix shell' it would be replaced by just the FHS directories
when '--emulate-fhs' was also set.

* gnu/scripts/environment.scm (launch-environment): Add the FHS directories to
$PATH rather than overriding $PATH completely.
* tests/guix-environment-container.sh: Test that FHS directories are in $PATH
in the container and that $PATH can be preserved.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-01-15 17:54:14 -05:00
pukkamustard
79bf3b54a6
guix: dune-build-system: Do not use `test-target' argument.
This lets dune run all tests for a given package.

* guix/build/dune-build-system.scm (check): Do not use `test-target' argument.
* gnu/package/ocaml.scm (ocaml-cohttp)[native-inputs]: Add
  ocaml-crowbar.
(ocaml-cudf, opam, ocaml-frontc, ocaml-qcheck, ocaml-qtest)
(ocaml-stringext, ocaml4.07-ppx-tools-versioned, ocaml-result)
(ocaml4.09-result, ocaml5.0-result, ocaml-csv, ocaml-alcotest)
(ocaml4.07-alcotest, ocaml-ssl, ocaml-optint, ocaml-eio)
(ocaml-eio-luv, ocaml-uring, ocaml-eio-linux, ocaml-eio-main)
(ocaml-gen, ocaml-ocp-indent, ocaml-benchmark, ocaml-re)
(ocaml4.07-re, ocaml-ocplib-endian, ocaml-cstruct, ocaml-hex)
(ocaml-ezjsonm, ocaml-uri, ocaml4.07-uri, ocaml-camomile, ocaml-zed)
(ocaml-lambda-term, ocaml-utop, ocaml-ansiterminal, dedukti, ocaml-bindlib)
(ocaml-earley, ocaml-timed, ocaml-yojson, ocaml-gsl, ocaml-ppx-deriving)
(ocaml-ppx-cold, ocaml-ppx-typerep-conv, ocaml-ppx-stable)
(ocaml-ppx-base, ocaml-ppx-disable-unused-warnings, ocaml-ppx-jane)
(ocaml4.07-jane-street-headers, ocaml4.07-bisect-ppx, ocaml-fftw3)
(ocaml-cairo2, lablgtk3, ocaml-lablgtk3-sourceview3, ocaml-bigstringaf)
(ocaml-angstrom, ocaml-uri-sexp, ocaml-cohttp, js-of-ocaml)
(ocaml-monolith, ocaml-crowbar): Remove test-target argument.

Signed-off-by: Julien Lepiller <julien@lepiller.eu>
2023-01-15 15:57:49 +01:00
Ricardo Wurmus
6e75790fc0
import/cran: Fix Bioconductor updater.
* guix/import/cran.scm (latest-bioconductor-release): Use LATEST-VERSION
instead of VERSION, which is always #F.
2023-01-09 22:32:58 +01:00
Ludovic Courtès
6c343d0d0f
read-print: Do not use extended notation when printing '1+', '1-', etc.
* guix/read-print.scm (%special-non-extended-symbols): New variable.
(symbol->display-string): New procedure.
(pretty-print-with-comments): Use it in lieu of 'string->symbol'.
* tests/read-print.scm: Add test.
2023-01-09 17:40:54 +01:00
Ludovic Courtès
5d24e57a61
derivations: 'read-derivation' correctly handles case with empty hash.
Reported by Stephen Paul Weber <singpolyma@singpolyma.net> at
<https://lists.gnu.org/archive/html/guix-devel/2023-01/msg00035.html>.

* guix/derivations.scm (read-derivation)[outputs->alist]: Treat the
empty hash case as non-fixed-output whether or not the hash algorithm is
the empty string, and preserve the hash algorithm in <derivation-output>.
* tests/derivations.scm ("'download' built-in builder, no fixed-output hash")
("fixed-output-derivation?, no hash", "read-derivation with hash = #f"): New tests.
2023-01-09 17:40:53 +01:00
Ludovic Courtès
007e697560
substitute: Parse '_NIX_OPTIONS' once.
* guix/scripts/substitute.scm (find-daemon-option): Arrange to call
'daemon-options' only once.
2023-01-09 17:40:53 +01:00
Ludovic Courtès
04f247be81
refresh: Add CLI tests.
* guix/import/test.scm, tests/guix-refresh.sh: New files.
* Makefile.am (MODULES, SH_TESTS): Add them.
2023-01-08 16:11:45 +01:00
Ludovic Courtès
2e9c0e1ff6
import: stackage: Catch networking errors in predicate.
* guix/import/stackage.scm (stackage-lts-package?): Wrap body in
'false-if-networking-error'.
2023-01-08 16:11:45 +01:00
Ludovic Courtès
472dd29f37
gnu-maintenance: 'gnu' and 'gnu-ftp' predicates catch networking errors.
Previously, in a networking-less environment such as 'guix shell -C -D
guix', 'guix refresh --list-updaters' would crash due to a
'gettaddrinfo-error' exception in these predicates.

* guix/gnu-maintenance.scm (%gnu-updater)[pred]: Wrap in
'false-if-networking-error'.
(%gnu-ftp-updater)[pred]: Likewise.
2023-01-08 16:11:45 +01:00
Ludovic Courtès
f3edf29c67
gnu-maintenance: Factorize 'false-if-networking-failure'.
* guix/import/utils.scm (call-with-networking-exception-handler): New
procedure.
(false-if-networking-error): New macro.
* guix/gnu-maintenance.scm (import-html-updatable-release): Use it
instead of inline code.
2023-01-08 16:11:45 +01:00
Mathieu Othacehe
8b665a4ff3
substitutes: Log the failing queries.
* guix/substitutes.scm (%debug?): New variable.
(handle-narinfo-response): Log the failing queries if the %debug? parameter is
set.
2023-01-07 14:27:17 +01:00
Mathieu Othacehe
62f9f34525
scripts: publish: Add a custom baking header.
Log the not-found responses and their reason (baking or not) to stdout. Also
send the X-Baking custom header so that the client can be informed of the
cause of the failure.

* guix/scripts/publish.scm (not-found): Add a baking? argument to add the
X-Baking HTTP header to the response if baking is in progress.  Also, log the
404 responses to stdout, indicating if it is due to baking or not.
(render-narinfo/cached): Pass the baking? argument.
2023-01-07 14:11:45 +01:00
Ludovic Courtès
b5e3701f1a
environment: Avoid false positive on 'PS1' check.
* guix/scripts/environment.scm (validate-child-shell-environment): Do
not warn when 'PS1' refers to 'GUIX_ENVIRONMENT'.
2023-01-05 15:01:29 +01:00
Ludovic Courtès
632e2f7ce1
environment: Simplify 'PS1' suggestion on '--check'.
* guix/scripts/environment.scm (validate-child-shell-environment): In
'PS1' suggestion, remove 'export' and avoid 'if'.
2023-01-05 15:01:29 +01:00
Ludovic Courtès
2c757e8fb4
home: '--version' really says "guix home".
* guix/scripts/home.scm (%options): Fix argument to 'show-version-and-exit'.
2023-01-05 13:12:24 +01:00
Ludovic Courtès
473692b812
refresh: Always return an <update-spec> for each command-line option.
This fixes a regression introduced in
8aeccc6240 whereby packages specified via
-e, -r, or -m, as well as packages *not* specified on the command line,
would all lead to a wrong-type error.

Reported by Ricardo Wurmus <rekado@elephly.net> at
<https://lists.gnu.org/archive/html/guix-devel/2022-12/msg00311.html>.

* guix/scripts/refresh.scm (<update-spec>): Move above.  Rename
constructor to '%update-spec' and add separate 'update-spec' procedure
with optional #:version parameter.
(options->update-specs): Always return a list of <update-spec> and
update docstring accordingly.  Rename 'args-packages' to 'update-specs'
and ensure it's a list of <update-spec>; handle 'manifest' arguments
here.
2023-01-03 12:25:48 +01:00
Ludovic Courtès
11235dd85a
refresh: Honor user-provided target version and report downgrades.
Previously, 'guix refresh guile=3.0.0' would print:

  3.0.8 is already the latest version of guile

With this change, it prints:

  guile would be downgraded from 3.0.8 to 3.0.0

This is a followup to 8aeccc6240.

* guix/scripts/refresh.scm (check-for-package-update): Take an
<update-spec> instead of a <package>.  Report downgrades as such when
UPDATE-SPEC specifies a target version.
(guix-refresh): Adjust caller.
2023-01-03 12:25:48 +01:00
Ludovic Courtès
a330bfdf5b
upstream: Allow downgrades.
Previously, 'guix refresh -u guile=3.0.0' would do nothing.  With this
change, it actually downgrades 'guile'.

This is a followup to 8aeccc6240.

* guix/upstream.scm (package-update): Ignore 'version>?' check
when #:version is passed.  Warn about downgrades.
2023-01-03 12:25:48 +01:00
Ludovic Courtès
c6ac47afdf
ui: It's 2023 now!
* guix/ui.scm (show-version-and-exit): Change year to 2023.
2023-01-03 12:25:48 +01:00
Lars-Dominik Braun
c329eeb3a8
import/cran: Depend on gfortran if .f files are detected too.
There was an inconsistency between tarball-needs-fortran? and
directory-needs-fortran?.

* guix/import/cran.scm (directory-needs-fortran?): Match .f files too.
2022-12-31 19:41:53 +01:00
Ricardo Wurmus
d4ed8dc3c5
import/cran: Use multiple values instead of a list of lists.
* guix/import/cran.scm (source-dir->dependencies): Return multiple values.
(description->package): Bind two values.
2022-12-31 14:48:46 +01:00
Ricardo Wurmus
4d13926064
import/utils: recursive-import: Pass on lookup-node's version argument.
* guix/import/utils.scm (recursive-import)<lookup-node>: Replace the #:VERSION
keyword from RECURSIVE-IMPORT's arguments with the value of VERSION passed to
LOOKUP-NODE.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun
973496100d
import/cran: Always operate on source directory.
Extracting the source tarball multiple times is very slow and a
speedup of >2x (without network I/O) can be achieved by coalescing all
NEEDS-X? functions into a single one, which extracts a tarball only once.

* guix/import/cran.scm (tarball-needs-fortran?): Remove unused function.
(needs-fortran?): Ditto.
(tarball-files-match-pattern?): Ditto.
(tarball-needs-zlib?): Ditto.
(needs-zlib?): Ditto.
(tarball-needs-pkg-config?): Ditto.
(needs-pkg-config?): Ditto.
(source-dir->dependencies): New function.
(source->dependencies): New function.
(description->package): Use it.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun
952953be39
import/cran: Translate more package dependencies.
Assumes we use package variable names, not package specification names.

* guix/import/cran.scm (invalid-packages): Add more invalid names.
(transform-sysname): Transform more package names.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun
1176fccb83
import/cran: Allow overriding tarball download.
* guix/import/cran.scm (description->package): Accept new keyword argument
DOWNLOAD-SOURCE.
(cran->guix-package): Ditto.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun
08028c443e
import/cran: Allow overriding description fetch function.
* guix/import/cran.scm (cran->guix-package): New keyword argument
FETCH-DESCRIPTION.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun
d57dd25d38
import/cran: Allow custom license prefix.
* guix/import/cran.scm (string-licenses): Add license-prefix argument.
(string->license): Ditto.
(description->package): Ditto.
(cran->guix-package): Ditto.
(cran-recursive-import): Ditto.
* guix/scripts/import/cran.scm (%options): Add new option -p/--license-prefix.
(show-help): Document it.
(parse-options): Pass it to importer.
* doc/guix.texi (Invoking guix import): Document it.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun
3c24da4260
import/utils: Pass all arguments through to package builder.
Individual importer may have additional arguments.

* guix/import/utils.scm (recursive-import): Patch all keyword arguments
through to repo->guix-package.
* guix/import/cran.scm (cran->guix-package): Add #:allow-other-keys.
* guix/import/crate.scm (crate->guix-package): Ditto.
* guix/import/egg.scm (egg->guix-package): Ditto.
* guix/import/elm.scm (elm->guix-package): Ditto.
* guix/import/gem.scm (gem->guix-package): Ditto.
* guix/import/gnu.scm (gnu->guix-package): Ditto.
* guix/import/go.scm (go-module->guix-package): Ditto.
(go-module-recursive-import): Ditto.
* guix/import/hackage.scm (hackage->guix-package): Ditto.
(hackage-recursive-import): Ditto.
* guix/import/hexpm.scm (hexpm->guix-package): Ditto.
* guix/import/minetest.scm (minetest->guix-package): Ditto.
(minetest-recursive-import): Ditto.
* guix/import/opam.scm (opam->guix-package): Ditto.
* guix/import/pypi.scm (pypi->guix-package): Ditto.
* guix/import/stackage.scm (stackage->guix-package): Ditto.
(stackage-recursive-import): Ditto.
* guix/import/texlive.scm (texlive->guix-package): Ditto.
2022-12-31 14:48:46 +01:00
Attila Lendvai
363b20b685
records: match-record supports specifying a different variable name.
An example:

(match-record obj <my-type>
  (field1 (field2 custom-var-name) field3)
  ...)

* guix/records.scm (match-record-inner): Add support for the new syntax.
* tests/records.scm ("match-record, simple"): Add a simple test case for the
new syntax.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-12-27 23:53:42 +01:00
Hartmut Goebel
f7eaed6858
upstream: Allow updating to a specific version.
* guix/upstream.scm(package-latest-release): Add keyword-argument 'version'
  and pass it on to the updater's 'import' function.
  (package-update): add keyword-argument 'version' and pass it on to
  package-latest-release.  Differentiate the error message issued when
  no package was found, depending on whether version was given or not.
2022-12-26 17:38:07 +01:00
Hartmut Goebel
8aeccc6240
refresh: Allow updating to a specific version.
* guix/scripts/refresh.scm (options->packages)[args-packages]: Handle version
  specification in package name arguments.
  (update-package): Add #:version argument and pass it on to called functions.
  (guix-refresh): When updating, pass the specified version (if any) to
  update-package.
  [package-list-without-versions, package-list-with-versions]: New functions.
2022-12-26 17:38:07 +01:00
Hartmut Goebel
b82eb8d67a
import: pypi: Allow updating to a specific version.
* guix/import/pypi.scm (latest-release): Rename to 'import-release',
  add #:version argument and pass it on to called functions.
2022-12-26 17:38:06 +01:00
Hartmut Goebel
3986caacae
import: launchpad: Allow updating to a specific version.
* guix/import/launchpad.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
2022-12-26 17:38:06 +01:00
Hartmut Goebel
424a871f1f
import: kde: Allow updating to a specific version.
* guix/import/kde.scm (latest-kde-release): Rename to 'import-kde-release',
  add #:version argument.  Rework the code to not sort the relevant files,
  but just find the requested or latest version.
  [find-latest-archive-version]: New function.
2022-12-26 17:38:06 +01:00
Hartmut Goebel
e689f97033
import: hexpm: Allow updating to a specific version.
* guix/import/hexpm.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
2022-12-26 17:38:05 +01:00
Hartmut Goebel
c7faeae2b1
import: gnome: Allow updating to a specific version.
* guix/import/gnome.scm (latest-gnome-release): Rename
  to 'import-gnome-release', add #:version argument. If version is
  given, try to find the respective version
  [find-latest-release]: New function, based on former code.
  [find-version-release]: New function.
2022-12-26 17:38:05 +01:00
Hartmut Goebel
be3f48bff0
import: github: Allow updating to a specific version.
* guix/import/github.scm (latest-released-version): Add #:version argument.
  If version is given, try to find the respective release.
  (latest-releease) Rename to 'import-release', add #:version argument
  and pass it on to 'latest-released-version'.
2022-12-26 17:38:05 +01:00
Hartmut Goebel
6da60453e2
import: git: Allow updating to a specific version.
* guix/import/git.scm
  (latest-tag): Add #:version argument. If version is given, try to
  find the respective version tag.
  (latest-git-tag-version): Add #:version argument and pass it on to
  called functions.
  (latest-releease) Rename to 'import-release', add #:version argument
  and pass it on to called functions.
2022-12-26 17:38:05 +01:00
Hartmut Goebel
1e39f475a2
import: gem: Allow updating to a specific version.
* guix/import/gem.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
2022-12-26 17:38:03 +01:00
Hartmut Goebel
af44a8550c
import: egg: Allow updating to a specific version.
* guix/import/egg.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
2022-12-26 17:38:03 +01:00
Hartmut Goebel
7c4aab1f7d
import: crate: Allow updating to a specific version.
* guix/import/crate.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
2022-12-26 17:38:03 +01:00
Hartmut Goebel
53af560543
gnu-maintenance: Allow updating to a specific version.
* guix/gnu-maintenance.scm
  (latest-ftp-release): Rename to … (import-ftp-release) … this,
  add #:version argument.
  If version is given, try to find the respective version.
  (latest-html-release): Rename to … (import-html-release) … this,
  add #:version argument.
  If version is given, try to find the respective version.
  (latest-gnu-release): Rename to … (import-gnu-release) … this,
  add #:version argument. Refactor to first select archives for
  respective package, the find the requested or latest version, then create
  the upstream-source.
  (latest-release): Rename to … (import-release) … this,
  add #:version argument, pass on to … (import-ftp-release) … this.
  (import-release*): Rename to … (import-release*) … this,
  add #:version argument, pass on to … (latest-release) … this.
  (latest-savannah-release): Rename to … (import-savannah-release) … this,
  add keword-argument version, pass on to … (import-html-release) … this.
  (latest-xorg-release): Rename to … (import-xorg-release) … this,
  add keword-argument version, pass on to … (import-ftp-release) … this.
  (latest-kernel.org-release): Rename to … (import-kernel.org-release) … this,
  add #:version argument, pass on to … (import-html-release) … this.
  (latest-html-updatable-release): Rename to … (import-html-updatable-release)
  … this, add #:version argument, pass on to … (import-html-release) … this.
* guix/import/gnu.scm(gnu->guix-package): Adjust function call.
2022-12-26 17:38:03 +01:00
Hartmut Goebel
abc72eeac0
import: sourceforge: Issue error-message if version is given.
Due to the complicated directory structure at sourceforce,
enabling the  sourceforge importer to update to a specific version
is very complicated to implement. Since only 2.0% of the
packages in guix are covered by this updater I dedided to not
implement this.

* guix/gnu-maintenance.scm (latest-sourceforge-release): Add #:version
  argument.  Issue error-message if version is given.
2022-12-26 17:15:07 +01:00
Hartmut Goebel
21703b5120
import: Issue error-message if version is given.
These importer don't support importing a specific version, thus the updater
does neither.  Issue an error message in case version is given.

* guix/import/cpan.scm (latest-release),
  guix/import/elpa.scm (latest-release),
  guix/import/hackage.scm (latest-release),
  guix/import/minetest.scm (latest-minetest-release),
  guix/import/opam.scm (latest-release): Add #:version argument,
  issue error if version is given.
* guix/import/cran.scm (latest-cran-release): Same.
  (latest-bioconductor-release) Same. <version>: rename to <latest-version>.
* guix/import/stackage.scm (latest-lts-release): For each generated updater,
  add #:version argument and issue error if version is given.
2022-12-26 17:15:07 +01:00
Hartmut Goebel
9500c11c8b
import: cpan: Remove unused exports.
* guix/import/cpan.scm (#:export): Remove unused exports.
2022-12-26 17:15:06 +01:00
Hartmut Goebel
a274a6a1ac
upstream-updater: Rename record field.
The next commits will make the functions, which are currently importing the
latest version of a package, change into importing the latest or a given
version of the package (for those updaters supporting specifying a version).
Thus the name ‘latest‘ is no longer appropriate.

* guix/upstream.scm (upstream-updater) Rename field [latest] to
  [import]. (lookup-updater, package-latest-release) Adjust fieldname
  accordingly.
* guix/gnu-maintenance.scm (%gnu-updater, %gnu-ftp-updater,
  %savannah-updater, %sourceforge-updater, %xorg-updater,
  %kernel.org-updater, %generic-html-updater),
  guix/import/cpan.scm (%cpan-updater),
  guix/import/cran.scm (%cran-updater, %bioconductor-updater),
  guix/import/crate.scm (%crate-updater),
  guix/import/egg.scm (%egg-updater),
  guix/import/elpa.scm (%elpa-updater),
  guix/import/gem.scm (%gem-updater),
  guix/import/git.scm (%generic-git-updater),
  guix/import/github.scm (%github-updater),
  guix/import/gnome.scm (%gnome-updater),
  guix/import/hackage.scm (%hackage-updater),
  guix/import/hexpm.scm (%hexpm-updater),
  guix/import/kde.scm (%kde-updater),
  guix/import/launchpad.scm (%launchpad-updater),
  guix/import/minetest.scm (%minetest-updater),
  guix/import/opam.scm (%opam-updater),
  guix/import/pypi.scm (%pypi-updater),
  guix/import/stackage.scm (%stackage-updater),
  tests/import-github.scm (found-sexp)
  tests/transformations.scm ("options->transformation, with-latest"):
  Adjust fieldname accordingly.
2022-12-26 17:15:06 +01:00
Yarl Baudig
800b3234fb
shell: Make --help show --system and --list-systems.
These options are callable and documented in the manual but not
shown by --help.

* guix/scripts/shell.scm: Make --help show --system and
--list-systems.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-12-26 00:30:50 +01:00
pukkamustard
052ec8bcc7
guix: ocaml: Add package-with-ocaml5.0.
* guix/build-system/ocaml.scm (package-with-ocaml5.0)
(strip-ocaml5.0-variant): New variables.
* gnu/packages/ocaml.scm (ocaml5.0-dune-bootstrap)
(ocaml5.0-dune, ocaml5.0-dune-configurator)
(ocaml5.0-csexp, ocaml5.0-result): New variables.

Signed-off-by: Julien Lepiller <julien@lepiller.eu>
2022-12-21 21:58:56 +01:00
Maxim Cournoyer
30465558bd
guix system: Skip initrd modules check when using --target.
* guix/scripts/system.scm (perform-action): Do not call CHECK-INITRD-MODULES
when the %current-target-system parameter is set.
2022-12-21 14:22:13 -05:00
Maxim Cournoyer
68330e7797
kconfig: Streamline comment in 'modify-defconfig'.
* guix/build/kconfig.scm (modify-defconfig): Streamline comment.
2022-12-20 21:19:33 -05:00
Maxim Cournoyer
1d44866280
kconfig: Mostly preserve keys ordering of original defconfig.
* guix/build/kconfig.scm (defconfig->alist): Reverse the results of lists
constructed with cons.
2022-12-20 21:19:30 -05:00
Maxim Cournoyer
d368210af5
kconfig: Move pair->config-string up.
* guix/build/kconfig.scm (pair->config-string): Move earlier, to match the
natural dependency of declarations (useful when experimenting at the REPL).
2022-12-20 21:19:26 -05:00
Ludovic Courtès
fcc4e51e61
read-print: Add special forms.
* guix/read-print.scm (%special-forms): Add 'define-configuration' and
'match-record'.
2022-12-20 16:56:04 +01:00
Ricardo Wurmus
5a1a5677cd
import/cran: Add more mappings from sysnames to Guix package names.
* guix/import/cran.scm (transform-sysname): Add more mappings.
2022-12-19 18:29:45 +01:00
jgart
061609ee57
guix: packages: Add type hint comment to home-page record field.
* guix/packages.scm (package)[home-page]: Add type comment.

Signed-off-by: Andrew Tropin <andrew@trop.in>
2022-12-19 15:26:41 +04:00
Lars-Dominik Braun
bbcd06e56c
ui: Take package upstream name into account when searching.
* guix/ui.scm (%package-metrics): Add PACKAGE-UPSTREAM-NAME*.
* tests/ui.scm ("package-relevance and upstream name"): New test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-12-13 17:46:39 +01:00
Lars-Dominik Braun
052faadde7
packages: Add 'package-upstream-name*'.
* guix/packages.scm (package-upstream-name*): New procedure.
* tests/packages.scm ("package-upstream-name*"): New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-12-13 17:46:39 +01:00
Ludovic Courtès
302a84a593
Merge branch 'version-1.4.0' 2022-12-12 15:03:35 +01:00
Ludovic Courtès
3677b97030
pki: 'public-keys->acl' deduplicates entries.
Reported by Tobias Geerinckx-Rice <me@tobias.gr>
in <https://issues.guix.gnu.org/50892>.

* guix/pki.scm (public-keys->acl): Add call to 'delete-duplicates'.
* tests/pki.scm ("public-keys->acl deduplication"): New test.
2022-12-12 15:03:05 +01:00
Ludovic Courtès
7866294e32
deduplicate: Use 'sendfile' only with file ports.
Fixes a regression introduced in b129026e2e.

* guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile'
only when INPUT' is a file port.
2022-12-10 18:13:39 +01:00
Ludovic Courtès
b129026e2e
deduplicate: Use 'sendfile' for small file copies.
* guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile'
instead of 'dump-port'.
* tests/store-deduplication.scm ("copy-file/deduplicate, below %deduplication-minimum-size"):
New test.
2022-12-10 10:56:48 +01:00
Ludovic Courtès
0406df0b9b
environment: '-C' doesn't throw when the NSS is dysfunctional.
Previously, if the name service switch was dysfunctional, as can happen
on foreign distros lacking nscd, "guix shell -C" would crash with a
backtrace on the uncaught 'getpwuid' exception.  To address that, catch
the exception and deal with it gracefully.

Reported by remsd1 on #guix.

* guix/scripts/environment.scm (launch-environment/container): Wrap
'getpwuid' call in 'false-if-exception'.
2022-12-09 09:59:53 +01:00
Ludovic Courtès
754a7660a1
records: 'match-record' checks fields at macro-expansion time.
This allows 'match-record' to be more efficient (field offsets are
computed at compilation time) and to report unknown fields at
macro-expansion time.

* guix/records.scm (map-fields): New macro.
(define-record-type*)[rtd-identifier]: New procedure.
Define TYPE as a macro and use a separate identifier for the RTD.
(lookup-field, match-record-inner): New macros.
(match-record): Rewrite in terms of 'match-error-inner'.
* tests/records.scm ("match-record, simple")
("match-record, unknown field"): New tests.
* gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file'
local variable to 'main-log-file'.
* gnu/services/getmail.scm (serialize-getmail-configuration-file): Move
after <getmail-configuration-file> definition.
2022-12-08 13:21:23 +01:00
Maxim Cournoyer
6454208222
build: gnu-build-system: Remove source from native inputs.
Fixes <https://issues.guix.gnu.org/44924>, in a cross-compilation context.

Having the source in inputs when computing search paths can break builds.  One
example is a git checkout of the Linux source tree, where the source (a
directory) 'include' subdirectory gets picked up in C_INCLUDE_PATH and causes
conflicts with the includes provided by glibc.

* guix/build/gnu-build-system.scm (set-paths): Remove any "source" native
input.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2022-12-07 09:47:08 -05:00
Ludovic Courtès
e625e9b194
environment: '-C' doesn't throw when the NSS is dysfunctional.
Previously, if the name service switch was dysfunctional, as can happen
on foreign distros lacking nscd, "guix shell -C" would crash with a
backtrace on the uncaught 'getpwuid' exception.  To address that, catch
the exception and deal with it gracefully.

Reported by remsd1 on #guix.

* guix/scripts/environment.scm (launch-environment/container): Wrap
'getpwuid' call in 'false-if-exception'.
2022-12-09 08:46:21 +01:00
Ludovic Courtès
c370998f01
gnu-maintenance: 'generic-html' updater ignores invalid host names.
Previously "guix refresh xkbset" for example would crash with a
getaddrinfo-error because the domain name is invalid.  Now it reports
failure to update.

Reported by Tyler Wolf <tyler@twolf.io>
in <https://issues.guix.gnu.org/59598>.

* guix/gnu-maintenance.scm (latest-html-updatable-release): Return #f
upon 'getaddrinfo-error' as well.
2022-12-08 13:07:45 +01:00
Maxim Cournoyer
f57fbc2fb1
gnu: linux-libre: Move documentation to a separate package.
* gnu/packages/linux.scm (linux-libre-5.15-source)
(linux-libre-5.10-source): Do not apply linux-libre-infodocs-target.patch.
(make-linux-libre): Remove BUILD-DOC? argument, and
adjust patches conditional.
(make-linux-libre*): Likewise.  Remove build-doc? validation.
[arguments]: Move documentation related phases to the new
linux-libre-documentation.
[native-inputs]: Move the documentation related native inputs to
linux-libre-documentation.
(linux-libre-documentation): New variable.
* guix/build-system/linux-module.scm
(make-linux-module-builder) [arguments]: Do not delete build-doc and
install-doc phases, which no longer exist for linux-libre.
2022-12-06 22:03:44 -05:00
Christopher Baines
981f01d0cc
gnu: Resolve derivation lint warnings.
Computing derivations for these systems (i686-gnu and riscv32-linux) fails
with an error like the following:

  could not find bootstrap binary 'tar' for system

* gnu/packages/mes.scm (mescc-tools)[supported-systems]: Remove riscv32-linux.
* guix/packages.scm (%hurd-system): Remove i686-gnu.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-12-06 11:14:53 +00:00
Ludovic Courtès
7fde166715
Merge branch 'version-1.4.0' 2022-12-05 15:51:04 +01:00
Ludovic Courtès
bcbf9713da
substitute: Fix typo in 'open-connection-for-uri/cached' docstring.
* guix/scripts/substitute.scm (open-connection-for-uri/cached):
Fix docstring.
2022-12-05 15:50:23 +01:00
Ludovic Courtès
1b06e77108
modules: Recognize #:declarative?.
This addition has become necessary since commit
54003af85c, which makes use
of #:declarative? in modules produced by 'make-config.scm'.

Reported by zimoun <zimon.toutoune@gmail.com>.

* guix/modules.scm (extract-dependencies): Recognize #:declarative?,
which was introduced in Guile 3.0.8.
2022-12-02 23:20:54 +01:00
Ludovic Courtès
9672db290a
modules: Recognize #:declarative?.
This addition has become necessary since commit
54003af85c, which makes use
of #:declarative? in modules produced by 'make-config.scm'.

Reported by zimoun <zimon.toutoune@gmail.com>.

* guix/modules.scm (extract-dependencies): Recognize #:declarative?,
which was introduced in Guile 3.0.8.
2022-12-02 23:11:09 +01:00
Ludovic Courtès
047425a662
syscalls: Adjust for lack of 'libutil.so' on glibc >= 2.34.
This is a re-implementation of 3c8b6fd94c
done in a way that works for both glibc >= 2.34 and earlier versions.

* guix/build/syscalls.scm (syscall->procedure): When LIBRARY is true,
fall back to global symbols if (dynamic-link library) fails.

(cherry picked from commit 3f6c32a88f)
2022-12-02 14:58:26 +01:00
Maxim Cournoyer
4781f0458d
Revert "gnu: linux-libre: Move info manual to doc output."
This reverts commit 748ec62882.  It broke the
linux-libre-module-builder like so:

   builder for
   `/gnu/store/293jxydym9z7ck7afmrjqhiw3xpfs4i1-linux-libre-module-builder-6.0.10.drv'
   failed to produce output path
   `/gnu/store/ghmp1q5w6r1s9364rz53jd42152wgz2v-linux-libre-module-builder-6.0.10-doc'

for reasons difficult to understand.
2022-12-01 21:37:12 -05:00
Ludovic Courtès
7c1161dba4
records: 'match-record' checks fields at macro-expansion time.
This allows 'match-record' to be more efficient (field offsets are
computed at compilation time) and to report unknown fields at
macro-expansion time.

* guix/records.scm (map-fields): New macro.
(define-record-type*)[rtd-identifier]: New procedure.
Define TYPE as a macro and use a separate identifier for the RTD.
(lookup-field, match-record-inner): New macros.
(match-record): Rewrite in terms of 'match-error-inner'.
* tests/records.scm ("match-record, simple")
("match-record, unknown field"): New tests.
* gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file'
local variable to 'main-log-file'.
* gnu/services/getmail.scm (serialize-getmail-configuration-file): Move
after <getmail-configuration-file> definition.
2022-12-02 00:02:12 +01:00
Stefan
a3f638e748
build: kconfig: Add new module to modify defconfig files.
* guix/build/kconfig.scm: New file.
* Makefile.am: Register it.
* gnu/packages/bootloaders.scm (make-u-boot-package)
(make-u-boot-sunxi64-package): Add DEFCONFIGS and CONFIGS arguments.  Remove
dead code.
(u-boot-am335x-boneblack, u-boot-pinebook)
(u-boot-novena,u-boot-rockpro64-rk3399): Simplify packages by using the new
keyword arguments.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2022-12-01 11:57:06 -05:00
Maxim Cournoyer
748ec62882
gnu: linux-libre: Move info manual to doc output.
The kernel Linux is installed in the system profile, which means the manual
was not easily discoverable.  Move it to the "doc" output, so that users can
install the Linux documentation explicitly in their user profile without
pulling the whole Linux package.

* gnu/packages/linux.scm (make-linux-libre*) [outputs]: Conditionally add a
"doc" output.
[phases] {install-doc}: Install the info manual to the doc output, an create a
"linux" symlink to it for convenience.
* guix/build-system/linux-module.scm (make-linux-module-builder): Delete the
"doc" output, if present.
2022-12-01 10:53:49 -05:00
Maxim Cournoyer
b4be83b6ac
build: linux-module: Do not inherit the install-doc phase.
This is a followup commit to aaf1f18b80, itself
a followup to 82c43b276d (gnu:
linux-libre: Enable building info doc).

* guix/build-system/linux-module.scm
(make-linux-module-builder) [phases]: Also delete inherited 'install-doc phase.

Reported-by: John Kehayias <john.kehayias@protonmail.com>
2022-11-29 20:15:23 -05:00
Maxim Cournoyer
aaf1f18b80
build: linux-module: Do not inherit the build-doc phase.
This is a followup commit to 82c43b276d (gnu:
linux-libre: Enable building info doc).

* guix/build-system/linux-module.scm
(make-linux-module-builder) [phases]: Delete inherited 'build-doc phase.

Reported-by: John Kehayias <john.kehayias@protonmail.com>
2022-11-29 15:38:43 -05:00
Ricardo Wurmus
993ef4af7e
import/cran: Add package name mapping.
* guix/import/cran.scm (transform-sysname): Add mapping from sqlite3 to sqlite.
2022-11-29 15:27:20 +01:00
Antero Mejr
50546f9c0c
licenses: Add EUPL 1.1.
* guix/licenses.scm (eupl1.1): New variable.

Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2022-11-26 09:07:29 +01:00
zimoun
f4a7ccc976
guix: Upgrade to Bioconductor 3.16.
* guix/build-system/r.scm (bioconductor-uri): Bump Bioconductor version to
3.16.
* guix/import/cran.scm (%bioconductor-version): Same.
2022-11-24 12:31:11 +01:00
Ludovic Courtès
d33ed58169
offload: Increase default 'overload-threshold' value.
When offloading to a single machine, the previous default value would
lead 'guix offload' to wait possibly for several minutes between
subsequent builds until normalized load would finally go below 0.6.
Increasing it mitigates that.

* guix/scripts/offload.scm (<build-machine>)[overload-threshold]: Bump
to 0.8.
* doc/guix.texi (Daemon Offload Setup): Likewise.
2022-11-23 19:34:42 +01:00
Ludovic Courtès
d07dd4ccdf
reconfigure: Use SRFI-71 instead of SRFI-11.
* guix/scripts/system/reconfigure.scm (upgrade-shepherd-services)
(channel-relations): Use SRFI-71.
2022-11-22 09:43:54 +01:00
Ludovic Courtès
b2b9571935
offload: Gracefully handle 'guix repl' protocol errors.
Fixes <https://issues.guix.gnu.org/59447>.
Reported by Mathieu Othacehe <othacehe@gnu.org>.

Previously, if a machine had a buggy 'guix repl', 'guix offload' would
crash with a backtrace instead of just ignoring the machine.

* guix/scripts/offload.scm (remote-inferior*): New procedure.
(check-machine-availability)[if-true]: New procedure.
Use 'remote-inferior*' and 'if-true'.
(check-machine-status): Use 'remote-inferior*'.
2022-11-22 09:43:54 +01:00
Ludovic Courtès
60bea07593
inferior: Raise '&inferior-protocol-error' on invalid response.
* guix/inferior.scm (&inferior-protocol-error): New condition type.
(read-repl-response): Add default 'match' clause and raise it.
2022-11-22 09:43:54 +01:00
Vivien Kraus
9283c80e60
guix: modify-input: Recommend prepend instead of append.
* doc/guix.texi (Defining Package Variants): Document the "prepend" clause of
modify-inputs first.
* guix/packages.scm (modify-inputs): use "prepend" in the docstring.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-11-21 14:25:13 +00:00
Ludovic Courtès
82bde985f4
style: '-f' reads input files as UTF-8 by default.
Reported by mirai on #guix.

* guix/scripts/style.scm (format-whole-file): Wrap body in
'with-fluids'.  Pass #:guess-encoding to 'call-with-input-file'.
2022-11-20 23:20:31 +01:00
Ricardo Wurmus
c585b4bc68
file-systems: Always do recursive bind mounts.
Fixes <https://issues.guix.gnu.org/59185>.

* guix/build/syscalls.scm (MS_REC): New variable.
* gnu/build/file-systems.scm (mount-flags->bit-mask): Set MS_REC bit when
bind-mounting.
2022-11-20 21:27:10 +01:00
pelzflorian (Florian Pelz)
da6c6763fa
scripts: Use translations for guix.pot for service descriptions.
Previously, service descriptions appeared in both guix.pot and
packages.pot, but only translations of packages.pot were used.
Now, translations are only done with guix.pot.

This is better, because translators are more likely to translate
guix.pot, and is also easier, because files in gnu/{home/,}services
need to be in po/guix/POTFILES.in anyway and po/guix/Makevars
already acts on the 'description' keyword because of lint checkers.

* guix/scripts/home.scm (service-type-description-string):
Use translations from guix.pot.
* guix/scripts/system/search.scm (service-type-description-string)
(service-type->recutils): Likewise.
* po/packages/POTFILES.in: Move files in gnu/services to ...
* po/guix/POTFILES.in: ... here.
2022-11-20 16:01:08 +01:00
jgart
670d30972f
import: egg: Fix typo in docstring.
* gnu/import/egg.scm (Commentary): Fix typo in Commentary docstring.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-11-20 12:00:04 +00:00
jgart
b50be211c0
scripts: describe: Add branch information to recutils output.
* guix/scripts/describe.scm (channel->recutils): Add branch information.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-11-19 19:54:15 +01:00
jgart
f1354e7926
scripts: describe: Add branch information to json output.
* guix/scripts/describe.scm (channel->json): Add branch information.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-11-19 19:54:14 +01:00
Ludovic Courtès
a644c3a375
pack: Remove use of GOOPS in 'deb' backend.
* guix/scripts/pack.scm (debian-archive)[build]: Remove use of (oop goops).
Introduce 'keyword-ref' and use it instead of 'get-keyword'.
2022-11-19 19:54:14 +01:00
Philip McGrath
fd5e642513
import/utils: spdx-string->license: Support '+' operator.
Previously, '+' was supported only via special cases for deprecated
GNU identifiers like 'GPL-N+'.  This commit adds support
for other uses of '+', such as 'AFL-2.0+' and 'LPPL-1.0+'.

Strictly speaking, '+' is an operator, not part of the SPDX license
identifier, but it is useful to handle it here.

* guix/import/utils.scm (spdx-string->license): Support '+' operator.
* tests/import-utils.scm ("spdx-string->license"): Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-11-18 15:44:38 +01:00
Philip McGrath
07482dc051
import/utils: spdx-string->license: Match case-insensitively.
SPDX specifies that license identifiers (unlike the 'AND', 'OR', and
'WITH' operators) are matched case-insensitively.

* guix/import/utils.scm (%spdx-license-identifiers): New variable.
(spdx-string->license): Search in '%spdx-license-identifiers' using
'string-ci=?'.
* tests/import-utils.scm ("spdx-string->license"): New test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-11-18 15:44:38 +01:00
Philip McGrath
b253efef23
import/utils: spdx-string->license: Fix incorrect docstring.
The result of 'spdx-string->license' is a symbol, not a license object.

* guix/import/utils.scm (spdx-string->license): Fix docstring.
(license->symbol): Mention 'license:' prefix in docstring.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-11-18 15:44:38 +01:00
Tobias Geerinckx-Rice
0081807e16
guix: Replace defective freemirror.org.
This ‘mirror’ is particularly problematic because it's the only one checked
by ‘guix refresh’.

* guix/gnu-maintenance.scm (%savannah-base): Substitute freedif.org.
* guix/download.scm (%mirrors): Likewise.

Reported by sash-kan on #guix.
2022-11-13 01:00:07 +01:00
Ricardo Wurmus
4073f43cbc
import/cran: Add package mapping for freetype.
* guix/import/cran.scm (transform-sysname): Map "freetype2" to "freetype".
2022-11-16 15:43:04 +01:00
Maxim Cournoyer
788602b37f
shell: Detect --symlink spec problems early.
* guix/scripts/pack.scm (symlink-spec-option-parser): Remove extraneous
char-set.  Raise an exception when the target is an absolute file name.
(guix-pack): Move with-error-handler earlier.
* guix/scripts/shell.scm (guix-shell): Likewise.
* guix/scripts/environment.scm (guix-environment): Wrap the whole
guix-environment* call with the with-error-handling handler.
* tests/guix-environment-container.sh: Add tests.
* tests/guix-pack.sh: Adjust symlink spec.
2022-11-15 14:15:11 -05:00
Maxim Cournoyer
b31ea797ed
guix: shell: Add '--symlink' option.
* guix/scripts/pack.scm (%options): Extract symlink parsing logic to...
(symlink-spec-option-parser): ... here.
(self-contained-tarball/builder): Add a comment mentioning why a relative file
name is used for the link target.
* guix/scripts/environment.scm (show-environment-options-help): Document new
--symlink option.
(%default-options): Add default value for symlinks.
(%options): Register new symlink option.
(launch-environment/container): Add #:symlinks argument and extend doc, and
create symlinks using evaluate-populate-directive.
(guix-environment*): Pass symlinks arguments to launch-environment/container.
* doc/guix.texi (Invoking guix shell): Document it.
* tests/guix-shell.sh: Add a --symlink (negative) test.
* tests/guix-environment-container.sh: Add tests.
2022-11-15 14:15:11 -05:00
Ludovic Courtès
54003af85c
self: Mark the generation (guix config) as non-declarative.
Fixes <https://issues.guix.gnu.org/58927>.
Reported by Maxime Devos <maximedevos@telenet.be>
and Marius Bakke <marius@gnu.org>.

Starting from 076e825dc5, "guix --version"
would print "0" as the version number, due to '%guix-version' being
inlined in (guix ui) when compiling '*core-modules*' in (guix self).

* guix/self.scm (make-config.scm): Pass #:declarative? #f.
2022-11-14 12:31:33 +01:00
Ludovic Courtès
c6cb7243fb
gnu-maintenance: 'release-file?' excludes "valgrind-3.20.0.RC1.tar.bz2".
* guix/gnu-maintenance.scm (%alpha-tarball-rx): Add "." before
"(alpha|beta|...)".
* tests/gnu-maintenance.scm ("release-file?"): Add test for Valgrind.
2022-11-11 23:17:43 +01:00
Ludovic Courtès
9a35e4c5bd
gnu-maintenance: 'gnu' updater prefers tarball with same compression.
Fixes <https://issues.guix.gnu.org/59168>.

Previously 'guix build make --with-latest=make' would pick ".tar.lz",
rather than "tar.gz", because "tar.lz" happened to come first in the
<upstream-source> 'urls' field.

* guix/gnu-maintenance.scm (latest-gnu-release)[archive-type]
[better-tarball?]: New variables.
Sort TARBALLS according to BETTER-TARBALL?.
2022-11-11 23:17:43 +01:00
Ludovic Courtès
692d987d0f
upstream: Factorize 'package-archive-type'.
* guix/upstream.scm (package-archive-type): New procedure.
(package-update/url-fetch): Use it.
2022-11-11 23:17:42 +01:00
Ludovic Courtès
19206eee69
grafts: Run with a UTF-8 locale.
Fixes <https://issues.guix.gnu.org/55968>.
Reported by Maxime Devos <maximedevos@telenet.be>.

* guix/grafts.scm (%graft-with-utf8-locale?): New parameter.
(graft-derivation/shallow)[glibc-locales, set-utf8-locale]: New
variables.
[build]: Use 'set-utf8-locale'.
* tests/gexp.scm, tests/grafts.scm, tests/packages.scm: Set
'%graft-with-utf8-locale?' to #f.
2022-11-11 23:17:42 +01:00
Marius Bakke
bdfa795c98
build-system/dub: Avoid usage of (guix build syscalls).
* guix/build/dub-build-system.scm (configure): Use MKDTEMP instead of MKDTEMP!.
2022-11-11 18:09:58 +01:00
Marius Bakke
8b2a9be465
build-system/clojure: Avoid usage of (guix build sycalls).
* guix/build/clojure-build-system.scm (reset-class-timestamps): Use MKDTEMP
from Guile core instead of MKDTEMP!.
2022-11-11 18:09:58 +01:00
Marius Bakke
a6343af221
build-system/ant: Avoid usage of (guix build syscalls).
* guix/build/ant-build-system.scm (strip-jar-timestamps): Use MKDTEMP from
Guile core rather than MKDTEMP!.
* guix/build/java-utils.scm (install-jar-file-with-pom): Likewise.
2022-11-11 18:09:58 +01:00
Ricardo Wurmus
d4ec49d1da
import/cran: Add package name mapping for "booktabs".
* guix/import/cran.scm (transform-sysname): Add mapping for "booktabs".
2022-11-11 15:10:21 +01:00
Ricardo Wurmus
7d6843b631
import/cran: Add more strings to the list of invalid packages.
* guix/import/cran.scm (invalid-packages): Add "c++", "c++17", and
"posix.1-2001" to list of invalid packages.
2022-11-11 15:10:21 +01:00
(unmatched-parenthesis
a6d2ae431a
gnu: Add go-github-com-creack-pty.
* gnu/packages/golang.scm (go-github-com-creack-pty): New variable.
* guix/build-system/go.scm (go-target): Add to exported variables.

Signed-off-by: Raghav Gururajan <rg@raghavgururajan.name>
2022-11-10 23:17:18 -05:00
Ludovic Courtès
3bd4b92f55
build-system/gnu: Turn #:phases into a gexp when cross-compiling.
Previously, we'd get this error:

  $ guix build --target=aarch64-linux-gnu r-minimal -d --no-grafts
  guix build: error: path ‘/gnu/store/[^-]+-glibc-[^-]+-static’ is not valid

This is because the sexp would be passed as an input of the surrounding
gexp in 'gnu-cross-build', and thus
"/gnu/store/[^-]+-glibc-[^-]+-static" would be interpreted as a source
file name, as in this example:

  scheme@(guix gexp)> #~(foo #$(list 'whatever "/gnu/store/[^-]+-glibc-[^-]+-static"))
  $11 = #<gexp (foo #<gexp-input (whatever "/gnu/store/[^-]+-glibc-[^-]+-static"):out>) 7f098badec30>
  scheme@(guix gexp)> (gexp-inputs $11)
  $12 = (#<gexp-input "/gnu/store/[^-]+-glibc-[^-]+-static":out>)

Fixes <https://issues.guix.gnu.org/59073>.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/build-system/gnu.scm (gnu-cross-build): When PHASES is a pair,
pass it through 'sexp->gexp'.
2022-11-08 14:06:00 +01:00
Ludovic Courtès
3f6c32a88f
syscalls: Adjust for lack of 'libutil.so' on glibc >= 2.34.
This is a re-implementation of 3c8b6fd94c
done in a way that works for both glibc >= 2.34 and earlier versions.

* guix/build/syscalls.scm (syscall->procedure): When LIBRARY is true,
fall back to global symbols if (dynamic-link library) fails.
2022-11-07 22:26:54 +01:00
Ludovic Courtès
c9984bfc50
Revert "syscalls: Adjust for glibc 2.34 and later."
This reverts commit 3c8b6fd94c, which
would break bindings on glibc < 2.34 where those symbols are in
"libutil.so".
2022-11-07 22:25:33 +01:00
Christopher Baines
da21c5d45f
build-system/linux-module: Add #:source-directory to linux-module-build-cross.
Otherwise computing cross-compilation derivations for packages (e.g. xpadneo)
using the #:source-directory argument fails with this error:

  Unrecognized keyword: #:source-directory

* guix/build-system/linux-module.scm (linux-module-build-cross): Support
 #:source-directory.
2022-11-07 20:35:40 +01:00
Efraim Flashner
97d565c786
guix gc: Add '--vacuum-database'.
* guix/scripts/gc.scm (show-help, %options): Add '--vacuum-database'.
* guix/store/database.scm (vacuum-database): New procedure.
* doc/guix.texi (Invoking guix gc): Document the option.
2022-11-06 14:02:08 +02:00
John Kehayias
905443abb7
shell: Fix '--emulate-fhs' sometimes not including 'glibc-for-fhs'.
Fixes <https://issues.guix.gnu.org/58861>.

Previously the order of the options giving to 'guix shell' could mean that the
'glibc-for-fhs' package included with the '--emulate-fhs' option would not
appear in the container.  For example, using the development option with a
package using the 'gnu-build-system', e.g. 'guix shell -CFD hello', would
include the regular 'glibc' package.  The option ordered mattered: 'guix shell
-CD hello -F' would include the expected 'glibc-for-fhs'.  We fix this by
having 'glibc-for-fhs' added to the package list just before calling
'options-with-caching' so the option order given by the user does not matter.

* guix/scripts/shell.scm (%options): Move the '--emulate-fhs' (expression
. ...) component from here...
(parse-args): ... to here.
* tests/guix-environment-container.sh: Add a test to check that
'glibc-for-fhs' is in the container even when 'glibc' is included in the 'guix
shell' package list.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-11-06 12:38:02 +01:00
Liliana Marie Prikler
2f4071b0b2
guix: ui: Add default synopsis for “doc” output.
* guix/ui.scm (package->recutils)[%default-output-synopses]: Add “doc”.
2022-11-05 10:23:24 +01:00
Liliana Marie Prikler
2c8b1be0d5
guix: ui: Improve missing output descriptions.
The current reference to Intel's Appendix H appears too obscure and confusing.

* guix/ui.scm (package->recutils)[output->recutils]: Replace “see Appendix H”
with “[description missing]”.
2022-11-05 10:23:23 +01:00
Liliana Marie Prikler
9eb80094ae
guix: ui: Handle single outputs.
The current code says "out" contains "everything else", even if there's no
other output to contain anything.

* guix/ui.scm (package->recutils)[default-output-synopses]: New variable.
[output->recutils]: Take default synopses as argument.
["outputs"]: Distinguish single and multiple outputs.
2022-11-05 10:23:23 +01:00
Timotej Lazar
fd83edf8a1
build-system/scons: Allow using a G-exp for scons-flags.
* guix/build-system/scons.scm (scons-build): Only call sexp->gexp on
scons-flags when scons-flags is a pair.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-11-03 18:08:55 +01:00
Maxim Cournoyer
b42b0e6d62
profiles: info-dir-file: Remove install-info '--silent' option.
Relates to <https://issues.guix.gnu.org/58821>.

Revert 4fef1e850e, which silenced useful
information such as the following warning:

   install-info: warning: no info dir entry in
   `/gnu/store/...-rottlog-0.72.2/share/info/rottlog.info.gz'

Rationale: profile hooks output is now hidden by default, and can be made
visible via the --verbosity option.
2022-10-27 23:34:45 -04:00
Marius Bakke
e944734ef9
build-system/pyproject: Always run tests verbosely for supported backends.
* guix/build-system/pyproject.scm (pyproject-build): Default to '() instead of
 #false for TEST-FLAGS.
* guix/build/pyproject-build-system.scm (check): Unconditionally enable
verbose test flags.
* doc/guix.texi (Build Systems): Document this change.
* gnu/packages/fontutils.scm (python-glyphslib)[arguments]: Remove verbosity
from #:test-flags.
* gnu/packages/pdf.scm (python-pydyf, weasyprint)[arguments]: Likewise.
* gnu/packages/python-web.scm (python-openapi-spec-validator)[arguments]: Likewise.
* gnu/packages/python-xyz.scm (python-path, python-tempora)[arguments]: Likewise.
2022-10-27 21:30:03 +02:00
Marius Bakke
6ef998d54e
build-system/pyproject: Adjust indentation.
* guix/build/pyproject-build-system.scm: Adjust indentation.
2022-10-27 21:30:03 +02:00
Lars-Dominik Braun
400a7a4c80
build-system: Add pyproject-build-system.
This is an experimental build system based on python-build-system
that implements PEP 517-compliant builds.

* doc/guix.texi (Build Systems): Add pyproject-build-system section.
* doc/contributing.texi (Python Modules): Mention pyproject.toml and the
PYTHON-TOOLCHAIN package, as well as differences to python-build-system.
* guix/build-system/pyproject.scm,
guix/build/pyproject-build-system.scm,
gnu/packages/aux-files/python/sanity-check-next.py,
gnu/packages/python-commencement.scm: New files.
* Makefile.am (MODULES): Register the new build systems.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add python-commencement.scm.
* gnu/packages/python.scm (python-sans-pip, python-sans-pip-wrapper): New
variables.

Co-authored-by: Marius Bakke <marius@gnu.org>
2022-10-27 19:43:06 +02:00
Efraim Flashner
6ff203663e
Merge remote-tracking branch 'origin/master' into staging 2022-10-25 21:50:59 +03:00
Efraim Flashner
408a4ed071
build-system/cargo: Unpack crates less verbosely.
* guix/build/cargo-build-system.scm (configure): Print the crate being
unpacked but don't print the contents of each crate.
2022-10-20 12:23:52 +03:00
Ludovic Courtès
863c228bfd
grafts: Rewrite using gexps.
Fixes <https://issues.guix.gnu.org/58419>.

* guix/grafts.scm (graft-derivation/shallow): Rewrite using gexps and
remove 'store' parameter.
(graft-derivation/shallow*): New variable.
(cumulative-grafts): Use it instead of 'graft-derivation/shallow'.
2022-10-22 01:49:57 +02:00
Ludovic Courtès
a3619079f9
Remove now unnecessary uses of (guix grafts).
These modules would use (guix grafts) just to access '%graft?' and
related bindings, which are now in (guix store).

* gnu/ci.scm,
guix/gexp.scm,
guix/lint.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/deploy.scm,
guix/scripts/environment.scm,
guix/scripts/home.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/pull.scm,
guix/scripts/size.scm,
guix/scripts/system.scm,
guix/scripts/weather.scm,
tests/builders.scm,
tests/channels.scm,
tests/cpan.scm,
tests/derivations.scm,
tests/gexp.scm,
tests/graph.scm,
tests/guix-daemon.sh,
tests/monads.scm,
tests/pack.scm,
tests/packages.scm,
tests/profiles.scm,
tests/system.scm: Remove #:use-module (guix grafts).
2022-10-22 01:46:55 +02:00
Ludovic Courtès
5f0febcd45
grafts: Move '%graft?' and related bindings to (guix store).
The goal is to allow (guix grafts) to use (guix gexp) without
introducing a cycle between these two modules.

* guix/grafts.scm (%graft?, call-without-grafting, without-grafting)
(set-grafting, grafting?): Move to...
* guix/store.scm: ... here.
2022-10-22 01:46:54 +02:00
Ludovic Courtès
b544f46098
build-system/python: Disable grafts.
This is consistent with what 'gnu-build' does and makes sure origins
aren't getting lowered with #:graft? #t in one case and not in the
other.

This is a followup to df46bef48e and
dada5e86ed.

* guix/build-system/python.scm (python-build): Pass #:graft? #f.
2022-10-22 01:46:54 +02:00
Ludovic Courtès
e0b414fc59
lint: source: Handle <svn-multi-reference> origins.
This is a followup to 2383e14518.

* guix/lint.scm (svn-reference-uri-with-userinfo): Accept REF being
an <svn-multi-reference> record.
(check-source): Handle 'svn-multi-reference?' origins like
'svn-reference?' origins.
2022-10-20 23:07:38 +02:00
Ludovic Courtès
6352e3a17b
syscalls: Define 'MS_NODIRATIME' and recognize "nodiratime".
Fixes <https://issues.guix.gnu.org/58663>.

This is a followup to b665dd4a99 and
dcb640f02b, allowing "nodiratime" to be
preserved for bind mounts.

* guix/build/syscalls.scm (MS_NODIRATIME): New variable.
(option-string->mount-flags): Recognize it.
(statfs-flags->mount-flags): Likewise.
2022-10-20 23:07:37 +02:00
Ludovic Courtès
4056cd9480
ci: Add 'start-time' and 'stop-time' to <build> records.
* guix/ci.scm (seconds->date): New procedure.
(<build>)[start-time, stop-time]: New fields.
(build-duration): New procedure.
2022-10-20 23:07:37 +02:00
Ludovic Courtès
c5d83bee93
environment: Update docstring of 'launch-environment'.
This is a followup to 78d55b703d.
Reported by Maxim Cournoyer.

* guix/scripts/environment.scm (launch-environment): Update docstring.
2022-10-20 23:07:37 +02:00
Ludovic Courtès
6476f33f31
self: Switch to Guile-GnuTLS.
* guix/self.scm (specification->package, compiled-guix): Replace
"gnutls" with "guile-gnutls".
2022-10-18 14:27:01 +02:00
Ludovic Courtès
2383e14518
lint: source: Add check for <svn-reference> over HTTP(S).
* guix/lint.scm (svn-reference-uri-with-userinfo): New procedure.
(check-source): Add 'svn-reference?' clause.
* tests/lint.scm ("source: svn-reference, HTTP 200")
("source: svn-reference, HTTP 404"): New tests.
2022-10-17 23:15:08 +02:00
Ludovic Courtès
ec73570be5
lint: 'probe-uri' honors the 'userinfo' part of URIs.
* guix/lint.scm (probe-uri): Honor the 'userinfo' part of URI.
2022-10-17 23:15:08 +02:00
Ludovic Courtès
257917d08b
svn-download: Add missing exports.
* guix/svn-download.scm: Export more <svn-reference> and
<svn-multi-reference> accessors.
2022-10-17 23:15:08 +02:00
Ludovic Courtès
dada5e86ed
build-system/qt: Disable grafts.
Fixes <https://issues.guix.gnu.org/58567>.
Reported by Marius Bakke <marius@gnu.org>.

This is a followup to df46bef48e.

* guix/build-system/qt.scm (qt-build, qt-cross-build): Pass #:graft? #f
to 'gexp->derivation'.
2022-10-17 23:15:07 +02:00
Ludovic Courtès
30ac571eac
svn-download: Pass multi-fetch parameters through environment variables.
* guix/svn-download.scm (svn-multi-fetch)[build]: Check for environment
variables instead of splicing REF fields.
Pass #:script-name and #:env-vars to 'gexp->derivation'.
2022-10-17 23:15:07 +02:00
Ludovic Courtès
8599fccef8
svn-download: Pass parameters through environment variables.
This ensures a single "svn-download" script is created in the store for
all the origins that use 'svn-fetch'.

* guix/svn-download.scm (svn-fetch)[build]: Check for environment
variables instead of splicing REF fields.
Pass #:script-name and #:env-vars to 'gexp->derivation'.
2022-10-17 23:15:07 +02:00
Ludovic Courtès
8c90196f1a
read-print: Recognize 'define-record-type' and 'define-record-type*'.
* guix/read-print.scm (%special-forms): Add 'define-record-type' and
'define-record-type*'.
2022-10-17 10:00:50 +02:00
Ludovic Courtès
f36522416e
channels: Interpret the 'commit' field of channel as a tag or commit.
Previously the 'commit' field would always be interpreted as a commit
ID.  This change adds flexibility, allowing for things like:

  guix time-machine --commit=v1.2.0 -- describe

* guix/channels.scm (channel-reference): Use 'tag-or-commit' rather than 'commit'.
* guix/inferior.scm (channel-full-commit): Likewise.
* doc/guix.texi (Invoking guix pull): Document it.
(Invoking guix time-machine): Likewise.
2022-10-17 09:37:27 +02:00
Ludovic Courtès
46f7011591
git: 'update-cached-checkout' returns the commit ID when given a tag.
Previously, starting with commit
efa578ecae, 'update-cached-checkout' would
return the OID of the annotated tag the tag points to.  With this change
it returns the OID of the commit object in all cases.

* guix/git.scm (resolve-reference): In the 'tag' case, call
'tag-target-id' and 'tag-lookup' when OID designates an annotated tag.
* tests/git.scm ("update-cached-checkout, tag"): New test.
2022-10-17 09:37:27 +02:00
Julien Lepiller
82b0f3755d
guix: Fix typos.
These typos were found and reported through weblate.

* gnu/packages/audio.scm (wildmidi)[description]: Fix typo.
* gnu/packages/games.scm (cgoban)[description]: Fix typo.
* gnu/services/version-control.scm (gitolite-service-type)[description]:
  Fix typo.
* gnu/installer/newt/substitutes.scm (run-substitutes-page): Remove full
  stop at end of title.
* gnu/machine/ssh.scm (machine-ssh-configuration-system): Move
  punctuation outside of quotes.
* guix/scripts/home.scm (process-action): Remove trailing space before
  newline.
* guix/scripts/system.scm (show-help): Fix typo.
* guix/scripts/environment.scm (with-store/maybe): Fix typo.
2022-10-17 07:29:09 +02:00
Ludovic Courtès
26965563ef
git: 'update-cached-checkout' recognizes truncated commit IDs.
Fixes a regression introduced in
602527ab97 that broke
'tests/guix-build-branch.sh'.

* guix/git.scm (resolve-reference): Revert change from
602527ab97.
2022-10-15 00:44:09 +02:00
Liliana Marie Prikler
8b809a31fa
guix: emacs-utils: Support disabling native-compilation.
* guix/build/emacs-utils.scm (emacs-batch-disable-compilation): Add ‘native?’
argument and honour it.
2022-10-14 20:41:33 +02:00
Nicolas Goaziou
00fa377710
build: emacs-utils: Fix `emacs-substitute-variables'.
* guix/build/emacs-utils.scm (emacs-substitute-variables): Fix the regexp
matching variable name.

With end-of-word regexp ("\>"), the previous regexp may match the prefix of
a variable only, effectively deleting the rest of its name.

For example,

  (emacs-substitute-variables "file.el"
    ("foo" ...))

could match (defvar foo-bar ...) and replace it with (defvar foo ...).
2022-10-13 22:16:32 +02:00
Ludovic Courtès
8b192c5550
shell: Handle '--emulate-fhs' in 'guix shell', not in 'guix environment'.
Previously, using 'guix shell -CF coreutils' twice (such that the
profile is cache) would result in:

  guix shell: error: '--profile' cannot be used with package options

This patch fixes it by moving argument handling to (guix scripts shell),
before 'options-with-caching' is called.

* guix/scripts/environment.scm (show-environment-options-help)
(%options): Remove '--emulate-fhs'.
(guix-environment*): Pass OPTS as-is to 'options/resolve-packages'.
* guix/scripts/shell.scm (show-help, %options): Add '--emulate-fhs'.
Add the (expression . ...) component to RESULT right from the argument
handler.
* tests/guix-environment-container.sh: Change '--emulate-fhs' tests to
use 'guix shell' instead of 'guix environment'.
2022-10-13 15:56:56 +02:00
John Kehayias
c7ba5f38b8
environment: Add '--emulate-fhs'.
* guix/scripts/environment.scm (show-environment-options-help, %options): Add
'--emulate-fhs'.
(setup-fhs): New procedure.  Setup for the Filesystem Hierarchy Standard (FHS)
container.  Defines and uses FHS-SYMLINKS and LINK-CONTENTS to create FHS
expected directories and creates /etc/ld.so.conf.
(launch-environment): Add 'emulate-fhs?' key and implement it to set $PATH and
generate /etc/ld.so.cache before calling COMMAND.
(launch-environment/container): Add 'emulate-fhs?' and 'setup-hook' keys and
implement them.  Define and use FHS-MAPPINGS, to set up additional bind mounts
in the container to follow FHS expectations.
(guix-environment*): Add glibc-for-fhs to the container packages when
'emulate-fhs?' key is in OPTS.
* doc/guix.texi (Invoking guix shell): Document '--emulate-fhs'.
(Invoking guix environment): Document '--emulate-fhs'.
* tests/guix-environment-container.sh: Add tests for '--emulate-fhs'.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-10-13 09:19:08 +02:00
Ludovic Courtès
22b9734b67
Revert "guix system: Remove unused 'read-operating-system' procedure."
This reverts commit d11a432adf.

The 'read-operating-system' is used in Emacs-Guix.
2022-10-11 16:05:31 +02:00
Ludovic Courtès
602527ab97
git: Factorize 'commit-id?' predicate.
* guix/git.scm (commit-id?): New procedure, copied from (guix swh).
(resolve-reference): Use it instead of inline code.
* guix/inferior.scm (channel-full-commit): Likewise.
2022-10-11 16:05:31 +02:00
Ludovic Courtès
7d9fd1d7b7
guix import: Add a blank line after each package definition.
Starting from commit 371a83b764, 'guix
import crate -r' (or similar) would no longer print a blank line in
between definitions.  This patch fixes it.

Reported by jgart <jgart@dismail.de>.

* guix/scripts/import.scm (guix-import): Add second 'newline' call.
2022-10-11 16:05:31 +02:00
Ludovic Courtès
b6bc4c109b
packages: Raise an exception for invalid 'license' values.
This is written in such a way that the type check turns into a no-op at
macro-expansion time for trivial cases:

  > ,optimize (validate-license gpl3+)
  $18 = gpl3+
  > ,optimize (validate-license (list gpl3+ gpl2+))
  $19 = (list gpl3+ gpl2+)

* guix/packages.scm (valid-license-value?, validate-license): New
macros.
(<package>)[license]: Add 'sanitize' option.
(&package-license-error): New error condition type.
* tests/packages.scm ("license type checking"): New test.
2022-10-10 11:16:07 +02:00
Ludovic Courtès
79b390a207
licenses: Let 'license?' expand to #t in trivial cases.
With this change, we have:

  > ,expand (license? gpl3+)
  $2 = #t
  > ,expand (license? something-else)
  $3 = (let ((obj something-else))
    (and ((@@ (srfi srfi-9) struct?) obj)
	 ((@@ (srfi srfi-9) eq?)
	  ((@@ (srfi srfi-9) struct-vtable) obj)
	  (@@ (guix licenses) <license>))))

* guix/licenses.scm (define-license-predicate)
(begin-license-definitions): New macros
<top level>: Wrap definitions in 'begin-license-definitions'.
2022-10-10 11:16:06 +02:00
Brendan Tildesley
685110045c
build-system/gnu: Fix patch-dot-desktop-files regexp.
When patching .desktop files, Exec= values beginning with "/", (or
spaces or newline characters) will result in BINARY matching the empty
string.  Changing "*", meaning 0 or more, to "+", meaning 1 or more,
ensures it will match a basename of at least length 1, or nothing.

* guix/build/gnu-build-system.scm (patch-dot-desktop-files):
Substitute ‘+’ for ‘*’.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2022-10-09 02:00:00 +02:00
Maxime Devos
77759234a3
build-system: Fix uses of #:strip-flags and #:strip-directories.
This fixes a bug introduced in ccc2658e2a,
reported at <https://issues.guix.gnu.org/issue/58384>.

Tested with "./pre-inst-env guix build openjpeg-data".

Fixes: https://issues.guix.gnu.org/issue/58384

* guix/build-system/copy.scm (copy-build): 'strip-flags' and
'#:strip-directories' are G-exps, not S-exps, so don't use sexp->gexp.
* guix/build-system/cmake.scm (copy-build): Likewise.
* guix/build-system/glib-or-gtk.scm
(glib-or-gtk-build,glib-or-gtk-cross-build): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/meson.scm
(meson-build,meson-cross-build): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-09 18:53:32 +02:00
Ludovic Courtès
ccc2658e2a
build-system: Factorize 'strip' flags and directories.
Previously only 'gnu-build-system' would default to "--strip-unneeded",
since commit e0f31baacc6ad30096a332b69433c85f5830bb2c; most other build
systems would default to "--strip-debug".

This change brings consistency.

* guix/build-system/gnu.scm (%strip-flags, %strip-directories): Export.
* guix/build-system/cmake.scm (cmake-build, cmake-cross-build): Use them.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build)
(glib-or-gtk-cross-build): Likewise.
* guix/build-system/maven.scm (maven-build): Likewise.
* guix/build-system/meson.scm (meson-build, meson-cross-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/qt.scm (qt-build, qt-cross-build): Likewise.
2022-10-08 14:49:56 +02:00
Ricardo Wurmus
7d04f3ad28
import/utils: beautify-description: Update to pass tests.
* guix/import/utils.scm (beautify-description): Remove single quote wrapping;
escape @; exclude common abbreviations and titles from double-spacing; detect
more sentence fragments.
2022-10-05 23:59:48 +02:00
Ludovic Courtès
5bc4b8e8e3
channels: Warn about missing introductions.
* guix/channels.scm (latest-channel-instance): Warn when CHANNEL has no
introduction and CHECKOUT contains '.guix-authorizations'.
2022-10-04 18:15:35 +02:00
Andrew Tropin
64213a0b66
deploy: Fix error message.
* guix/scripts/deploy.scm (guix-deploy): Fix error message.
2022-10-04 16:46:33 +04:00
Maxim Cournoyer
9945f9419d
gnu-maintenance: Remove retired 'gforge.inria.fr' site.
* guix/gnu-maintenance.scm (html-updatable-package?): Remove "gforge.inria.fr".
2022-10-03 11:16:13 -04:00
Ludovic Courtès
4bd75d79e5
read-print: Fix indentation rule for 'match-lambda*'.
Fixes <https://issues.guix.gnu.org/58040>.
Reported by Maxime Devos <maximedevos@telenet.be>.

* guix/read-print.scm (%special-forms): Set 'match-lambda*' parameter
count to 1.
2022-10-02 22:27:55 +02:00
Ludovic Courtès
6a04bc8a6d
transformations: Switch to SRFI-71.
* guix/transformations.scm (package-with-source)
(evaluate-source-replacement-specs): Use SRFI-71 'let' instead of
'let-values'.
2022-10-02 22:14:45 +02:00
Zhu Zihao
9022b942ec
scripts: build: Format strings before calling display-hint.
* guix/scripts/build.scm(%standard-cross-build-options): Format hint string.
%standard-cross-build-options: Ditto.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-09-30 16:04:46 +02:00
Ludovic Courtès
28ade1bab2
transformations: '--with-source' now operates in depth.
The '--with-source' option is the first one that was implemented, and
it's the only one that would operate only on leaf packages rather than
traversing the dependency graph.  This change makes it consistent with
the rest of the transformation options.

* guix/transformations.scm (evaluate-source-replacement-specs): New
procedure.
(transform-package-source): Rewrite using it.
* tests/transformations.scm ("options->transformation, with-source, no
matches"): Rewrite since we no longer get a warning.
("options->transformation, with-source, in depth"): New test.
* doc/guix.texi (Package Transformation Options): Adjust examples.
2022-09-29 22:59:49 +02:00
itd
8b2119a5e4
import: print: Quasiquote properties
* guix/import/print.scm (package->code): Quasiquote properties.
* tests/print.scm (pkg-with-properties, pkg-with-properties-source):
New variables.
("package with properties"): New test

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-09-29 22:59:48 +02:00
itd
61bd7bf469
import/utils: alist->package: Include properties.
* guix/import/utils.scm (alist->package): Process properties field in input
data and include it in the generated package.
* tests/import-utils.scm ("alist->package with properties"): New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-09-29 22:59:48 +02:00
Ludovic Courtès
8bd4126917
substitute: Retry downloading when a nar is unavailable.
Fixes <https://issues.guix.gnu.org/57978>
Reported by Attila Lendvai <attila@lendvai.name>.

Previously, if a narinfo was available but its corresponding nar was
missing (for instance because the narinfo was cached and the server
became unreachable in the meantime), 'guix substitute --substitute'
would try to download the nar from its preferred location and abort when
that fails.  This change forces one retry with each of the URLs.

* guix/scripts/substitute.scm (download-nar): Do not catch
'http-get-error?' exceptions.
(system-error?, network-error?, process-substitution/fallback): New
procedures.
(process-substitution): Call 'process-substitution/fallback' upon
'network-error?'.
* tests/substitute.scm ("substitute, first URL has narinfo but lacks nar, second URL unauthorized")
("substitute, first URL has narinfo but nar is 404, both URLs authorized")
("substitute, first URL has narinfo but nar is 404, one URL authorized")
("substitute, narinfo is available but nar is missing"): New tests.
2022-09-28 22:28:27 +02:00