me
/
guix
Archived
1
0
Fork 0
Commit Graph

1708 Commits (2e16a2230188a04d05665e81e346ecf9df9810ee)

Author SHA1 Message Date
Sarah Morgensen 81a87222a1
import: hackage: Emit new-style package inputs.
* guix/import/hackage.scm (hackage-module->sexp)[dependencies]
[native-dependencies]: Make into a list of symbols.
[maybe-inputs]: Wrap INPUTS in 'list' instead of 'quasiquote'.
* tests/hackage.scm (match-ghc-foo)
(match-ghc-foo-6)
(match-ghc-foo-revision)
(match-ghc-foo-import): Adjust accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-07-20 23:43:29 +02:00
Sarah Morgensen 3d5a36c457
import: opam: Emit new-style package inputs.
* guix/import/opam.scm (opam->guix-package): Wrap INPUTS and
NATIVE-INPUTS in 'list' instead of 'quasiquote'.
(dependency-list->inputs): Return a list of symbols.
* tests/opam.scm ("opam->guix-package"): Adjust accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-07-20 23:43:29 +02:00
Sarah Morgensen fa7db21f59
import: gem: Emit new-style package inputs.
* guix/import/gem.scm (make-gem-sexp): Wrap inputs in 'list' instead of
'quasiquote'.
* tests/gem.scm ("gem->guix-package")
("gem-recursive-import"): Adjust accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-07-20 23:43:29 +02:00
Sarah Morgensen 5b6285518b
import: egg: Emit new-style package inputs.
* guix/import/egg.scm (egg->guix-package): Generate dependency list from
a list of symbols.
[egg-parse-dependency]: Return a list of symbols.
[maybe-inputs]: Wrap INPUTS in 'list' instead of 'quasiquote'.
* tests/egg.scm (match-chicken-foo): Adjust accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-07-20 23:43:29 +02:00
Ludovic Courtès 0e47fcced4
Merge branch 'master' into core-updates 2021-07-18 19:50:01 +02:00
Maxim Cournoyer 11f0698243
pack: Streamline how files are included in tarballs.
Thanks to Guillem Jover <guillem@debian.org> on the OFTC's #debian-dpkg
channel for helping with troubleshooting.

Letting GNU Tar recursively walk the complete files hierarchy side-steps the
risks associated with providing a list of file names:

1. Duplicated files in the archive (recorded as hard links by GNU Tar)
2. Missing parent directories.

The above would cause dpkg to malfunction, for example by aborting early and
skipping triggers when there were missing parent directories.

* guix/scripts/pack.scm (self-contained-tarball/builder): Do not call
POPULATE-SINGLE-PROFILE-DIRECTORY, which creates extraneous files such as
/root.  Instead, call POPULATE-STORE and INSTALL-DATABASE-AND-GC-ROOTS
individually to more precisely generate the file system.  Replace the list of
files by the current directory, "." and streamline the way options are passed.
* gnu/system/file-systems.scm (reduce-directories): Remove procedure.
* tests/file-systems.scm ("reduce-directories"): Remove test.
2021-07-18 02:10:49 -04:00
Maxim Cournoyer aeded14b83
pack: Allow embedding custom control files in deb packs.
* guix/scripts/pack.scm (self-contained-tarball/builder)
[extra-options]: New argument.
(self-contained-tarball, squashfs-image, docker-image)
(debian-archive): Likewise.  Remove two TODO comments.  Document
EXTRA-OPTIONS.  Use the custom control files when provided.
(%deb-format-options): New variable.
(show-deb-format-options, show-deb-format-options/detailed): New procedures.
(%options): Register new options.
(show-help): Augment with new usage.
(guix-pack): Validate and propagate new argument values.
* doc/guix.texi (Invoking guix pack)[deb]: Document how to list advanced
options.  Add an example.
* tests/pack.scm (deb archive...): Provide extra-options to the debian-archive
procedure, and validate that the provided files are embedded in the pack.
2021-07-18 02:02:34 -04:00
Sarah Morgensen 793ba333c6
import: go: Upgrade go.mod parser.
Upgrade the go.mod parser to handle the full go.mod spec, and to gracefully
handle unexpected/malformed syntax.  Restructure parser usage, making the
parse tree available for other uses.

guix/import/go.scm (parse-go.mod): Parse using (ice-9 peg) instead of
regex matching for more robustness.  Return a list of directives.
(go.mod-directives): New procedure.
(go.mod-requirements): Likewise.
(go-module->guix-package): Use it.
(%go.mod-replace-directive-rx): Remove unused variable.
tests/go.scm (testing-parse-mod): Adjust accordingly.
(go.mod-requirements)
(fixture-go-mod-unparseable)
(fixture-go-mod-retract)
(fixture-go-mod-strings): New variables.
("parse-go.mod: simple")
("parse-go.mod: comments and unparseable lines")
("parse-go.mod: retract")
("parse-go.mod: raw strings and quoted strings")
("parse-go.mod: complete"): New tests.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2021-07-18 01:57:17 -04:00
Maxim Cournoyer 3217a04b03
tests/go: Remove unused variable.
* tests/go.scm: Delete extraneous newline.
(fixture-latest-for-go-check): Remove variable.
2021-07-17 23:26:58 -04:00
Maxime Devos aaf9aa4824
packages: Define this-package-input and this-package-native-input.
These macros are intended to be used in build phases.
More precisely, (assoc-ref %build-inputs "input") can be
replaced by #$(this-package-input "input") or #+(this-package-native-input
"native-input") as appropriate.

* guix/packages.scm
  (package-input, package-native-input): New (unexported) procedures.
  (this-package-input, this-package-native-input): New macros.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-14 15:57:39 +02:00
Maxime Devos f54852be22
utils: Define a target-x86-32? and target-x86-64? predicate.
* guix/utils.scm (target-x86-32?, target-x86-64?): New predicates.
* tests/utils.scm ("target-x86-32?", "target-x86-64?"): New tests.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-14 15:38:03 +02:00
Maxime Devos ef71965c16
utils: Define 'target-linux?' predicate.
* guix/utils.scm (target-linux?): New predicate.
* tests/utils.scm
  ("target-linux?"): Test it.
  ("target-mingw?"): Also test ‘target-mingw?’.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-14 15:38:03 +02:00
Brice Waegeneire edb328ad83
lint: Check for leading whitespace in description.
* guix/lint.scm (check-description-style): Check for leading whitespace.
* tests/lint.scm: ("description: leading whitespace"): New test.
2021-07-13 07:25:05 +02:00
Ludovic Courtès ff992fcfaf
import: print: Emit new-style package inputs when possible.
* guix/import/print.scm (redundant-input-labels?): New procedure.
(package->code)[package-lists->code]: Rename to...
[inputs->code]: ... this.  When 'redundant-input-labels?' returns true,
emit label-less inputs.  Adjust callers to new name.
* tests/print.scm (pkg-with-inputs): Adjust accordingly.
2021-07-11 00:49:16 +02:00
Ludovic Courtès aa6921634b
import: cran: Emit new-style package inputs.
* guix/import/cran.scm (format-inputs): Emit symbols or
'specification->package' calls.
(maybe-inputs): Wrap in 'list' instead of 'quasiquote'.
* tests/cran.scm ("description->package"): Adjust accordingly.
2021-07-11 00:49:16 +02:00
Ludovic Courtès 52a9a0712a
import: pypi: Emit new-style package inputs.
* guix/import/pypi.scm (maybe-inputs): Wrap PACKAGE-INPUTS in 'list'
instead of 'quasiquote'.
(compute-inputs)[requirement->package-name/sort]: Return a list of symbols.
* tests/pypi.scm ("pypi->guix-package, no wheel")
("pypi->guix-package, wheels"): Adjust accordingly.
2021-07-11 00:49:15 +02:00
Ludovic Courtès f23803af20
Add 'guix style'.
* guix/scripts/style.scm, tests/style.scm: New files.
* Makefile.am (MODULES, SCM_TESTS): Add them.
* po/guix/POTFILES.in: Add 'guix/scripts/style.scm'.
* doc/guix.texi (Invoking guix style): New node.
(package Reference): Reference it.
(Invoking guix lint): Likewise.
2021-07-11 00:49:15 +02:00
Ludovic Courtès b7f1b4c1d0
lint: Add 'input-labels' checker.
* guix/lint.scm (check-input-labels): New procedure.
(%local-checkers): Add 'input-labels' checker.
* tests/lint.scm ("input labels: no warnings")
("input labels: one warning"): New tests.
* doc/guix.texi (Invoking guix lint): Mention it.
2021-07-11 00:49:14 +02:00
Ludovic Courtès 8524349f78
packages: Allow inputs to be plain package lists.
* guix/packages.scm (add-input-label, sanitize-inputs): New procedures.
(<package>)[inputs, propagated-inputs, native-inputs]: Add 'sanitize' property.
* doc/guix.texi (Defining Packages, package Reference):
(Defining Package Variants): Adjust examples accordingly.
* tests/packages.scm ("transaction-upgrade-entry, zero upgrades, propagated inputs")
("transaction-upgrade-entry, grafts")
("package-transitive-inputs")
("package-transitive-supported-systems")
("package-closure")
("supported-package?")
("package-derivation, inputs deduplicated")
("package-transitive-native-search-paths")
("package-grafts, indirect grafts")
("package-grafts, indirect grafts, propagated inputs")
("package-grafts, same replacement twice")
("package-grafts, dependency on several outputs")
("replacement also grafted")
("package->bag, sensitivity to %current-target-system")
("package->bag, propagated inputs")
("package->bag, sensitivity to %current-system")
("package-input-rewriting/spec, identity")
("package-input-rewriting, identity"): Use the label-less input style.
2021-07-11 00:49:14 +02:00
Ludovic Courtès 8be1632199
records: Support field sanitizers.
* guix/records.scm (make-syntactic-constructor): Add #:sanitizers.
[field-sanitizer]: New procedure.
[wrap-field-value]: Honor F's sanitizer.
(define-record-type*)[field-sanitizer]: New procedure.
Pass #:sanitizer to 'make-syntactic-constructor'.
* tests/records.scm ("define-record-type* & sanitize")
("define-record-type* & sanitize & thunked"): New tests.
2021-07-11 00:49:14 +02:00
Ludovic Courtès 2a3cd4ee35
environment: Adjust to earlier 'gcc-bootstrap' search paths changes.
This is a followup to fe6775f52b.

* tests/guix-environment.sh: Expect C_INCLUDE_PATH rather than CPATH in
environment containing 'gcc-bootstrap'.
2021-07-11 00:46:54 +02:00
Ludovic Courtès 152b167cfa
pack: Adjust test to earlier <compressor> changes.
This is a followup to 5a0997ef7f, which
broke the "self-contained tarball" test.

* tests/pack.scm (%gzip-compressor): Add 'list' in third field.
2021-07-11 00:39:56 +02:00
Maxime Devos eac82c0e0a
lint: Lint usages of 'wrap-program' without a "bash" input.
When using 'wrap-program', "bash" (or "bash-minimal") should be
in inputs.  Otherwise, when cross-compiling, 'wrap-program' will use
a native bash instead of the cross bash and the 'patch-shebangs' won't
be able to correct this.

Tobias Geerinckx-Rice is added to the copyright lines because
a part of the "straw-viewer" package definition is included.

This linter detects 365 problematic package definitions at time
of writing.

* guix/lint.scm
  (report-wrap-program-error): New procedure.
  (check-wrapper-inputs): New linter.
  (%local-checkers)[wrapper-inputs]: Add the new linter.
  ("explicit #:sh argument to 'wrap-program' is acceptable")
  ("'check-wrapper-inputs' detects 'wrap-program' without \"bash\" in inputs")
  ("'check-wrapper-inputs' detects 'wrap-qt-program' without \"bash\" in inputs")
  ("\"bash\" in 'inputs' satisfies 'check-wrapper-inputs'")
  ("\"bash-minimal\" in 'inputs' satisfies 'check-wrapper-inputs'")
  ("'cut' doesn't hide bad usages of 'wrap-program'")
  ("bogus phase specifications don't crash the linter"): New tests.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-07-07 10:00:52 +02:00
Ludovic Courtès 87d37a02f7
tests: Fix typo in 'tests/store.scm'.
This typo had always been there since the test was introduced in commit
ce72c78074.  Presumably, it became visible
with 9e5812ac59, where caching was no
longer global and thus the 'store' argument of 'package-derivation' was
actually being used.

* tests/store.scm ("current-build-output-port, UTF-8"): Refer to
'%store' rather than 's' in 'package-derivation' call.
2021-07-05 16:43:37 +02:00
Ludovic Courtès d8fdd1c74a
tests: Adjust Python "sanity" check tests.
This is a followup to 09448c0994.

The 'check-build-failure' procedure would not actually check anything
since it did not call 'build-derivations'.  However, it was throwing an
exception for unrelated reasons, so the tests would pass.

* tests/builders.scm (check-build-failure): Use 'guard' instead of
'false-if-exception'.  Call 'build-derivations' to actually check for
build failures.
2021-07-05 15:41:45 +02:00
Ludovic Courtès 98c075c24e
packages: 'package-derivation' honors 'system' again.
Fixes a regression introduced in
7d873f194c.

Starting from 7d873f194c, running

  guix build -s aarch64-linux sed

on an x86_64-linux machine would return an x86_64-linux machine, whereby
only the top derivation of the graph would be aarch64-linux while all
its dependencies would be x86_64-linux.

* guix/packages.scm (expand-input): Add 'system' parameter and honor it.
(bag->derivation, bag->cross-derivation): Pass SYSTEM to 'expand-input'.
* tests/packages.scm ("package-derivation, different system"): New test.
2021-07-01 21:34:42 +02:00
Maxime Devos 5532371a3a
lint: Verify if #:tests? is respected in the 'check' phase.
There have been a few patches to the mailing list lately
not respecting this, and this linter detects 630 package
definitions that could be modified to support the --without-tests
package transformation.

* guix/lint.scm
  (check-optional-tests): New linter.
  (%local-checkers)[optional-tests]: Add it.
* tests/lint.scm
  (package-with-phase-changes): New procedure.
  ("optional-tests: no check phase")
  ("optional-tests: check hase respects #:tests?")
  ("optional-tests: check phase ignores #:tests?")
  ("optional-tests: do not crash when #:phases is invalid")
  ("optional-tests: allow G-exps (no warning)")
  ("optional-tests: allow G-exps (warning)")
  ("optional-tests: complicated 'check' phase")
  ("optional-tests: 'check' phase is not first phase"): New tests.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-06-30 13:53:00 +02:00
Maxime Devos d9e0ae07db
guix: gexp: Define gexp->approximate-sexp.
It will be used in the 'optional-tests' linter.

* guix/gexp.scm (gexp->approximate-sexp): New procedure.
* tests/gexp.scm
  ("no references", "unquoted gexp", "unquoted gexp (native)")
  ("spliced gexp", "unspliced gexp, approximated")
  ("unquoted gexp, approximated"): Test it.
* doc/gexp.scm ("G-Expressions"): Document it.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-06-30 13:53:00 +02:00
Maxim Cournoyer 82daab4281
pack: Add support for the deb format.
* .dir-locals.el (scheme-mode)[gexp->derivation]: Define indentation rule.
* guix/scripts/pack.scm (debian-archive): New procedure.
(%formats): Register the new deb format.
(show-formats): Add it to the usage string.
* tests/pack.scm (%ar-bootstrap): New variable.
(deb archive with symlinks): New test.
* doc/guix.texi (Invoking guix pack): Document it.
* NEWS: Add news entry.
2021-06-29 14:53:21 -04:00
Maxim Cournoyer 8108c266dc
tests: pack: Fix compressor extension.
* tests/pack.scm (%gzip-compressor): Add the missing leading period to the
gzip compressor file extension.
2021-06-29 14:53:21 -04:00
Maxim Cournoyer 4f3bdc8f21
pack: Prevent duplicate files in tar archives.
Tar translate duplicate files in the archive into hard links.  These can cause
problems, as not every tool support them; for example dpkg doesn't.

* gnu/system/file-systems.scm (reduce-directories): New procedure.
(file-prefix?): Lift the restriction on file prefix.  The procedure can be
useful for comparing relative file names.  Adjust doc.
(file-name-depth): New procedure, extracted from ...
(btrfs-store-subvolume-file-name): ... here.
* guix/scripts/pack.scm (self-contained-tarball/builder): Use
reduce-directories.
* tests/file-systems.scm ("reduce-directories"): New test.
2021-06-29 14:53:21 -04:00
Xinglu Chen 2ad896751c
services: configuration: Allow specifying prefix for serializer names.
Sometimes two configurations might have the same types for their field values,
but the values might be serialized in two completely different
ways (e.g. because the two programs have different configuration languages).

An example of this would be the ‘serialize-boolean’ procedure in (gnu services
mail) and (gnu services getmail).  They both serialize a boolean value, but
because the Dovecot’s configuration language has a different syntax to the
configuration language for Getmail, two different procedures have to be
defined.

One way to workaround this would be to specify custom serializers for many
fields in order to separate the serialization of the values that have the same
type but serialize in different ways.  This could get very tedious, especially
if there are many configurations in the same module.

Another way would be to move one of the configurations to its own module, like
what was done with (gnu services getmail).  However, this would mean that
there would be multiple modules containing configurations for related
programs, e.g. we have (gnu services mail) and (gnu services getmail), it
doesn’t make much sense to keep the Getmail configuration in its own module.

This patch will allow one to write something like this:

  (define-configuration foo-configuration
    (bar
      (string "bob")
      "Option bar.")
    (prefix bar-))

and the value of the ‘bar’ field would be serialized using a procedure named
‘bar-serialize-string’ instead of just ‘serialize-string’.

* gnu/services/configuration.scm (define-maybe-helper): Accept ‘prefix’
argument for using serializer with custom prefix.
(define-maybe): Pattern match on ‘prefix’ literal.
(define-configuration-helper): Accept ‘prefix’ argument for using serializer
with custom prefix.
(define-configuration): Pattern match on ‘prefix’ literal.
* tests/services/configuration.scm ("serialize-configuration with prefix"):
New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-29 12:37:33 +02:00
Philip Munksgaard dfac3e643a
import: hackage: Support "common" field and imports
Fixes <https://issues.guix.gnu.org/48701>.

* guix/import/cabal.scm (make-cabal-parser): Modify.
(is-common): New variable.
(lex-common): New procedure.
(is-id): Modify.
(eval-cabal): Modify.
* tests/hackage.scm ("hackage->guix-package test cabal import") New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-25 15:12:05 +02:00
Chris Marusich e4b5a23841
tests: gremlin: Skip file-needed/recursive if DT_NEEDED is empty.
* tests/gremlin.scm (file-needed/recursive): Skip the test when (file-runpath
%guile-executable) evaluates to the empty list.  This causes the test to be
correctly skipped in the case where Guix has been built using a foreign
distro's toolchain and libraries.
2021-06-23 20:30:22 -07:00
Tobias Geerinckx-Rice 9dea3f101f
Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/cups.scm
	gnu/packages/python-web.scm
	gnu/packages/web.scm
	guix/build/maven/pom.scm
2021-06-23 18:45:21 +02:00
Ludovic Courtès b9a95420ab
profiles: Build union of inputs in the right order.
Fixes <https://bugs.gnu.org/49102>.
Reported by Mathieu Othacehe <othacehe@gnu.org>
and Tobias Geerinckx-Rice <me@tobias.gr>.

Fixes a regression introduced in
8cef92d063, whereby in case of file
collisions, the "wrong" one would take precedence.

* guix/build/profiles.scm (manifest-sexp->inputs+search-paths): Perform
a breadth-first traversal.  Reverse INPUTS and SEARCH-PATHS in the base
case.
* tests/profiles.scm ("profile-derivation, ordering & collisions"):
New test.
2021-06-22 17:55:05 +02:00
Marius Bakke 6f9a80b331
Merge branch 'master' into core-updates
Note: this merge actually changes the 'curl' and 'python-attrs' derivations,
as part of solving caf4a7a277 and
12964df69a respectively.

4604d43c0e (gnu: gnutls@3.6.16: Fix cross-compilation.) was ignored because it
cannot currently be tested.

 Conflicts:
	gnu/local.mk
	gnu/packages/aidc.scm
	gnu/packages/boost.scm
	gnu/packages/curl.scm
	gnu/packages/nettle.scm
	gnu/packages/networking.scm
	gnu/packages/python-xyz.scm
	gnu/packages/tls.scm
2021-06-19 17:38:47 +02:00
Ludovic Courtès ee61777a32
profiles: Add 'load-profile'.
* guix/profiles.scm (%precious-variables): New variable.
(purify-environment, load-profile): New procedures.
* guix/scripts/environment.scm (%precious-variables)
(purify-environment, create-environment): Remove.
(launch-environment): Call 'load-profile' instead of 'create-environment'.
* tests/profiles.scm ("load-profile"): New test.
2021-06-18 14:18:07 +02:00
Xinglu Chen 93d85deae6
lint: Check for trailing whitespace in description.
* guix/lint.scm (check-description-style): Check for trailing whitespace.
* tests/lint.scm: ("description: trailing whitespace"): New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-08 23:28:04 +02:00
Xinglu Chen 04afb76958
lint: Check for trailing whitespace in synopsis.
* guix/lint.scm (check-synopsis-style): Check for trailing whitespace.
* tests/lint.scm ("synopsis: contains trailing whitespace"): New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-08 23:28:04 +02:00
Ludovic Courtès 2725f04634
store: Remove 'references/substitutes'.
This procedure lost its only user in commit
710854304b.

* guix/store.scm (references/substitutes): Remove.
* tests/store.scm ("references/substitutes missing reference info")
("references/substitutes with substitute info"): Remove.
2021-06-08 09:25:50 +02:00
Marius Bakke 8d59c262ad
Merge branch 'master' into core-updates
Conflicts:
	gnu/local.mk
	gnu/packages/algebra.scm
	gnu/packages/bioinformatics.scm
	gnu/packages/curl.scm
	gnu/packages/docbook.scm
	gnu/packages/emacs-xyz.scm
	gnu/packages/maths.scm
	gnu/packages/plotutils.scm
	gnu/packages/python-web.scm
	gnu/packages/python-xyz.scm
	gnu/packages/radio.scm
	gnu/packages/readline.scm
	gnu/packages/tls.scm
	gnu/packages/xml.scm
	gnu/packages/xorg.scm
2021-06-06 21:16:32 +02:00
Maxime Devos 82b0e27de1
lint: tests-true: Check if tests are enabled when cross-compiling.
* guix/lint.scm (check-tests-true): New linter.
(%local-checkers)[tests-true]: Add it.
* tests/lint.scm ("tests-true: #:tests? must not be set to #t")
("tests-true: absent #:tests? is acceptable")
("tests-true: #:tests? #f is acceptable")
("tests-true: #:tests? #t acceptable when compiling natively"): Test it.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-06-06 18:49:12 +02:00
Maxime Devos 5378edeab4
utils: Define ‘search-input-file’ procedure.
The procedure ‘which’ from (guix build utils)
is used for two different purposes:

  1. for finding the absolute file name of a binary
     that needs to run during the build process

  2. for finding the absolute file name of a binary,
     for the target system (as in --target=TARGET),
     e.g. for substituting sh->/gnu/store/.../bin/sh,
     python->/gnu/store/.../bin/python.

When compiling natively (target=#f in Guix parlance),
this is perfectly fine.

However, when cross-compiling, there is a problem.
"which" looks in $PATH for binaries.  That's good for purpose (1),
but incorrect for (2), as the $PATH contains binaries from native-inputs
instead of inputs.

This commit defines a ‘search-input-file’ procedure. It functions
like 'which', but instead of searching in $PATH, it searches in
the 'inputs' of the build phase, which must be passed to
‘search-input-file’ as an argument. Also, the file name must
include "bin/" or "sbin/" as appropriate.

* guix/build/utils.scm (search-input-file): New procedure.
* tests/build-utils.scm
  ("search-input-file: exception if not found")
  ("search-input-file: can find if existent"): Test it.
* doc/guix.texi (File Search): Document it.

Partially-Fixes: <https://issues.guix.gnu.org/47869>
Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-04 22:34:26 +02:00
Xinglu Chen bdc298ecee
import: Add CHICKEN egg importer.
* guix/import/egg.scm: New file.
* guix/scripts/import/egg.scm: New file.
* tests/egg.scm: New file.
* Makefile.am (MODULES, SCM_TESTS): Register them.
* po/guix/POTFILES.in: Likewise.
* guix/scripts/import.scm (importers): Add egg importer.
* doc/guix.texi (Invoking guix import, Invoking guix refresh): Document it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-06-03 13:05:18 +02:00
Ludovic Courtès d7c356edb9
gnu-maintenance: 'release-file?' accepts 'v' prefix as in "PKG-v1.2.tgz".
* guix/gnu-maintenance.scm (%tarball-rx, %package-name-rx): Accept 'v'
and 'V' prefixes.  Accept ".tgz" extension.
* tests/gnu-maintenance.scm ("release-file?"): Add test.
2021-05-28 23:04:44 +02:00
Xinglu Chen 3f5bc6cbb3
import: opam: Generate license for package.
* guix/import/opam.scm (opam->guix-package): Generate license for the
‘license’ field.
* tests/opam.scm (test-opam-file): Update accordingly.
("opam->guix-package"): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-05-28 11:36:03 +02:00
Xinglu Chen cfec09a992
import: hackage: Prefix licenses with 'license:'.
* guix/import/hackage.scm (string->license): Prefix the value of the license
field with ‘license:’.
* tests/hackage.scm (match-ghc-foo, match-ghc-foo-6, match-ghc-foo-revision):
Adjust accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-05-22 23:39:27 +02:00
Ludovic Courtès bc4d81d267
lint: archival: Lookup content in Disarchive database.
* guix/lint.scm (lookup-disarchive-spec): New procedure.
(check-archival): When 'lookup-content' returns #f, call
'lookup-disarchive-spec'.  Call 'lookup-directory' on the result of
'lookup-directory'.
* guix/download.scm (%disarchive-mirrors): Make public.
* tests/lint.scm ("archival: missing content"): Set
'%disarchive-mirrors'.
("archival: content unavailable but disarchive available"): New test.
2021-05-22 23:13:11 +02:00
Marius Bakke 4ea6852c5f
Merge branch 'master' into core-updates 2021-05-22 17:21:57 +02:00