Commit Graph

6106 Commits

Author SHA1 Message Date
Ludovic Courtès 3c96158438
environment: Autoload some modules.
This further speeds up the 'guix environment -p PROFILE' case.

* guix/scripts/environment.scm: Autoload a bunch of modules.
2021-10-25 19:02:33 +02:00
Ludovic Courtès 99499a2037
environment: Do not connect to the daemon when '--profile' is used.
This further speeds up the 'guix environment -p PROFILE' case.

* guix/scripts/environment.scm (guix-environment*)[store-needed?]: New
variable.
[with-store/maybe]: New macro.
Use it instead of 'with-store', and remove 'with-build-handler' form.
2021-10-25 19:02:33 +02:00
Ludovic Courtès 648a6eb03f
environment: Skip derivation computation when '--profile' is used.
* guix/scripts/environment.scm (guix-environment*): Bypass calls to
'package-derivation' and to 'manifest->derivation' when PROFILE is
true.
2021-10-25 19:02:33 +02:00
Ludovic Courtès 746584e0ca
shell: By default load the local 'manifest.scm' or 'guix.scm' file.
* guix/scripts/shell.scm (parse-args): Add call to 'auto-detect-manifest'.
(authorized-directory-file, authorized-shell-directory?)
(find-file-in-parent-directories, auto-detect-manifest): New procedures.
* tests/guix-shell.sh: Add test.
* doc/guix.texi (Invoking guix shell): Document it.
2021-10-25 19:02:23 +02:00
Ludovic Courtès 80edb7df65
Add 'guix shell'.
* guix/scripts/shell.scm, tests/guix-shell.sh: New files.
* Makefile.am (MODULES): Add 'shell.scm'.
(SH_TESTS): Add 'tests/guix-shell.sh'.
* guix/scripts/environment.scm (show-environment-options-help): New
procedure.
(show-help): Use it.
(guix-environment*): New procedure.
(guix-environment): Use it.
* po/guix/POTFILES.in: Add it.
* doc/guix.texi (Features): Refer to "guix shell"
(Invoking guix package): Likewise.
(Development): Likewise.
(Invoking guix shell): New node.
(Invoking guix environment): Add deprecation warning.
(Debugging Build Failures): Use 'guix shell' in examples.
(Invoking guix container): Refer to 'guix shell'.
(Invoking guix processes, Virtualization Services): Adjust examples to
use 'guix shell'.
* doc/contributing.texi (Building from Git): Refer to 'guix shell'.
* etc/completion/bash/guix: Handle "shell".
2021-10-25 18:58:18 +02:00
Ludovic Courtès 23f99f1a29
profiles: Add 'package->development-manifest'.
* guix/profiles.scm (package->development-manifest): New procedure.
* guix/scripts/environment.scm (input->manifest-entry)
(package-environment-inputs): Remove.
* guix/scripts/environment.scm (options/resolve-packages): Use
'package->development-manifest' instead of 'package-environment-inputs'.
* tests/profiles.scm ("package->development-manifest"): New test.
2021-10-25 15:29:42 +02:00
Ludovic Courtès fb368f4e76
packages: Add 'package-development-inputs'.
* guix/packages.scm (package-development-inputs): New procedure.
* guix/scripts/environment.scm (package-environment-inputs): Use it.
* tests/packages.scm ("package-development-inputs")
("package-development-inputs, cross-compilation"): New tests.
* doc/guix.texi (package Reference): Document it.
2021-10-25 15:29:39 +02:00
Vagrant Cascadian b5f45a21c2
lint: Add description check for common typos.
Fixes: https://issues.guix.gnu.org/44675

* guix/lint.scm (check-description-typo): Add check for occurences of
  "This packages", "This modules", "allows to" and "permits to" in package
  descriptions.
* tests/lint.scm: Add tests for "This packages" and "allows to".
2021-10-24 14:26:12 -07:00
jgart via Guix-patches via 886d04425e
guix: packages: Add comment on license field.
* guix/packages/packages.scm (<package>): Add comment about the type
that the license field expects as part of a package record.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-10-22 00:04:47 +02:00
Efraim Flashner 0cd912186a
build-system/go: Fix building on host's secondary architecture.
Before when building for i686-linux on x86_64-linux GOARCH would be set
to amd64, not 386.

* guix/build-system/go.scm (go-build): Set goarch and goos to #f when
not cross-compiling.
* guix/build/go-build-system.scm (setup-go-environment): Set GOARCH
according to the calculated goarch or using GOHOSTARCH and GOOS
according to the calculated goos or using GOHOSTOS.
2021-10-18 14:53:17 +03:00
Julien Lepiller 0623138ffa
maint: Factorize po xref translation.
This ensures we use the same method in "make" as in "guix/self.scm".

* Makefile.am: Build guix/build/po.scm.
* build-aux/convert-xref.scm: New file.
* doc/local.mk (xref_command): Use it.
* guix/self.scm (translate-cross-references): Move it...
* guix/build/po.scm: Parse comments and flags separately to find fuzzy
flags.
(translate-cross-references): ...here.
(parse-tree->assoc): Ignore fuzzy entries.
2021-10-17 18:26:44 +02:00
Vivien Kraus 9a8c7808cc
build-system/minetest: Install config.txt and _config.txt.
* guix/build/minetest-build-system.scm (mod-install-plan):
Add "config.txt" and "_config.txt" to the list of installed files.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-10-16 17:30:31 +02:00
Vivien Kraus b0248a52e0
build-system/minetest: Gather whole failing test output.
* guix/build/minetest-build-system.scm (check):
Gather the whole output when a test fails.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-10-16 17:30:30 +02:00
Ludovic Courtès 058ea2672b
refresh: Report suggested input changes with 'info'.
* guix/scripts/refresh.scm (update-package): Define 'field', 'name',
'loc', and 'change-name'.  Use 'info' rather than 'format' to report
suggested input changes.
2021-10-15 23:16:29 +02:00
Ludovic Courtès 7770016402
import: pypi: Remove leftover 'pk' call.
This is a followup to 7b75f90c5b.

* guix/import/pypi.scm (make-pypi-sexp)[maybe-upstream-name]: Remove
leftover 'pk' call.
2021-10-15 23:16:28 +02:00
Xinglu Chen 50d2900e76
import: pypi: Support 'input-changes'.
* guix/import/pypi.scm (latest-release): Specify the ‘input-changes’ field.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2021-10-15 23:16:28 +02:00
zimoun 498cd9bcdb
swh: Allows token from Software Heritage authentication service.
The token is provided using the environment variable GUIX_SWH_TOKEN.

* guix/swh.scm (%swh-token): New variable.
(call): Use it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-15 23:16:28 +02:00
Ludovic Courtès bd61d62182
download: "GUIX_DOWNLOAD_FALLBACK_TEST=none" disables fallback mechanisms.
* guix/download.scm (url-fetch*): Handle (%download-fallback-test) set
to 'none.
2021-10-15 23:16:28 +02:00
Ludovic Courtès 2d06103288
lint: archival: Remove extra newline in warning.
* guix/lint.scm (check-archival): Remove extra newline in message.
2021-10-15 23:16:28 +02:00
Ludovic Courtès 5b81999c89
download: Print URL of the Disarchive spec being read.
* guix/build/download.scm (disarchive-fetch/any): Show URI of the
Disarchive spec.
2021-10-14 16:45:06 +02:00
Ludovic Courtès c4a7aa82e2
download: Add parameter to test download fallback mechanisms.
This allows you to run, say:

  GUIX_DOWNLOAD_FALLBACK_TEST=disarchive-mirrors guix build -S r-ebimage --check

or:

  GUIX_DOWNLOAD_FALLBACK_TEST=content-addressed-mirrors ./pre-inst-env guix build -S r-ebimage --check

to check whether these fallback mechanisms work as expected.

* guix/download.scm (%no-mirrors-file, %no-disarchive-mirrors-file)
(%download-fallback-test): New variables.
(url-fetch*): Honor (%download-fallback-test).
2021-10-14 15:44:52 +02:00
Ludovic Courtès 689d529e74
download: Add missing autoload.
This is a followup to 6d02a994f9, which
left '%verify-swh-certificate?' unbound.

* guix/build/download.scm: Autoload for '%verify-swh-certificate'.
2021-10-14 15:44:51 +02:00
Ludovic Courtès f9a506aa6a
download: Add disarchive.guix.gnu.org.
* guix/download.scm (%disarchive-mirrors): Add disarchive.guix.gnu.org.
2021-10-14 15:44:51 +02:00
Ludovic Courtès abd38dcee1
self: Move core (guix script ...) modules to a separate derivation.
This adds an opportunity for parallelism and reduces the amount of
rebuild needed when "secondary" modules are modified.

* guix/self.scm (compiled-guix)[*core-cli-modules*]: New variable.
[*cli-modules*]: Depend on it.
[built-modules]: Likewise.
2021-10-13 11:48:02 +02:00
Mathieu Othacehe d5073fd113
gnu: Add platform support.
* gnu/platform.scm: New file.
* gnu/platforms/arm.scm: Ditto.
* gnu/platforms/hurd.scm: Ditto.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add them.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-10-11 12:05:39 +00:00
Oleg Pykhalov fee0bced7f
home: services: configuration: Support file-like objects.
* gnu/home/services/configuration.scm (interpose): Operate only with file-like
objects.
(string-or-gexp?): Delete procedure.
(serialize-string-or-gexp): Rename to 'serialize-file-like'.
(text-config?): Call 'file-like' intead of 'string-or-gexp?'.
* guix/scripts/home/import.scm:
(generate-bash-module+configuration): Don't call slurp-file-gexp.
* gnu/home/services/configuration.scm: Move content ...
* gnu/services/configuration.scm: here.
* gnu/home/services/shells.scm: Delete (gnu home services configuration).
* gnu/home/services/xdg.scm: Same.
* gnu/local.mk: Same.
* tests/guix-home.sh:
Test home-bash-service-type and extension with home-bash-extension.
2021-10-09 19:24:19 +03:00
Oleg Pykhalov 0f6a27c2c4
scripts: home: Make sure profile directory exists.
* guix/scripts/home.scm (process-action): Make sure profile directory exists.
2021-10-09 19:24:19 +03:00
Oleg Pykhalov 0e8d2df0f1
Move (gnu home-services) to (gnu home services).
* gnu/home-services.scm (%guix-home-root-directory): Replace
gnu/home-services.scm with "gnu/home/services.scm".
Rename to gnu/home/services.scm.
* gnu/local.mk
(GNU_SYSTEM_MODULES): Rename gnu/home-services.scm to gnu/home/services.scm.
* doc/he-config-bare-bones.scm:
Replace (gnu home-services) with (gnu home services).
* gnu/home.scm: Same.
* gnu/home/services/fontutils.scm: Same.
* gnu/home/services/mcron.scm: Same.
* gnu/home/services/shells.scm: Same.
* gnu/home/services/shepherd.scm: Same.
* gnu/home/services/symlink-manager.scm: Same.
* gnu/home/services/xdg.scm: Same.
* guix/scripts/home.scm: Same.
* guix/self.scm: Same.
2021-10-09 19:24:18 +03:00
Tobias Geerinckx-Rice a1679b74c9
Revert the #51061 patch series for now.
This reverts commits f63c79bf76
..f86f7e24b39928247729020df0134e2e1c4cde62 for more chillax reviewing.

See <https://issues.guix.gnu.org/51061#32>.
2021-10-08 23:31:34 +02:00
Oleg Pykhalov 7893c2012a
guix: self: Fix home modules in compiled-guix.
This commit follows ba8ddb3480.

* guix/self.scm (compiled-guix): Update home modules location.
2021-10-08 21:19:13 +03:00
Oleg Pykhalov ba8ddb3480
gnu: Move (gnu home-services) to (gnu home services).
* gnu/home-services/configuration.scm: Move the content ...
* gnu/home/services/configuration.scm: ... here.
* doc/guix.texi:
Replace (gnu home-services mcron) with (gnu home services mcron).
Replace (gnu home-services) with (gnu home services).
* gnu/home.scm:
Replace (gnu home-services fontutils) with (gnu services fontutils).
Replace (gnu home-services shells) with (gnu home services shells).
Replace (gnu home-services symlink-manager) with
(gnu home services symlink-manager).
Replace (gnu home-services xdg) with (gnu home services xdg).
* gnu/home-services/fontutils.scm: Rename to gnu/services/fontutils.scm.
* gnu/home-services/mcron.scm: Move to gnu/home/services/mcron.scm.
Replace (gnu home-services shepherd) with (gnu home services shepherd).
* gnu/home-services.scm (%service-type-path):
Search home services in "gnu/services".
* gnu/home-services/shells.scm: Replace (gnu home-services configuration) with
(gnu home services configuration).
Rename to gnu/home/services/shells.scm.
Replace (gnu home-services utils) with (gnu home services utils).
* gnu/home-services/shepherd.scm: Move to gnu/home/services/shepherd.scm.
* gnu/home-services/symlink-manager.scm:
Rename to gnu/home/services/symlink-manager.scm.
* gnu/home-services/utils.scm: Rename to gnu/home/services/utils.scm.
* gnu/home-services/xdg.scm: Rename to gnu/home/services/xdg.scm.
* guix/scripts/home/import.scm:
Replace (gnu home-services bash) with (gnu home services bash).
* gnu/home-services.scm: Update documentation string.
* doc/he-config-bare-bones.scm:
Apply new (gnu home-services ...) modules location.
* gnu/local.mk (GNU_SYSTEM_MODULES): Same.
2021-10-08 15:36:18 +03:00
Lars-Dominik Braun b74ca403cb
build-system/haskell: Explain failure.
Provide human-readable failure message and explain how to fix it.

* guix/build/haskell-build-system.scm (register): Raise error if source
file does not exist.
2021-10-08 09:13:52 +02:00
Lars-Dominik Braun edd912a128
import: hackage: Support mirror:// URLs
* guix/import/hackage.scm (guix-package->hackage-name): Support
mirror://-style URI’s.
(hackage-package?): Ditto.
2021-10-08 09:13:52 +02:00
Lars-Dominik Braun a01daed62c
build-system/haskell: Accept line breaks in config files.
Long id’s will break to the next line.

* guix/build/haskell-build-system.scm (grep): Remove.
(register): Modify regular expression to account for newlines between
key and value, fail if package id is empty.
2021-10-08 09:13:52 +02:00
Lars-Dominik Braun 7cdb65dc9c
build-system/haskell: Do not rely on compiler name.
We’ve been relying on the compiler name matching its package
subdir. Since we effectively only support GHC we can hard-code this and
avoid issues with “ghc-next”.

* guix/build/haskell-build-system.scm (make-ghc-package-database):
Use GHC_PACKAGE_PATH.
(register): Hard-code ghc prefix.
2021-10-08 09:13:51 +02:00
Lars-Dominik Braun 127828ddd7
import: stackage: Support input changes.
* guix/import/stackage.scm (latest-lts-release): Rename package to pkg
to avoid name conflict and add input-changes.
2021-10-08 09:13:51 +02:00
Lars-Dominik Braun 8b4d3a523f
import: hackage: Update GHC’s standard libraries.
* guix/import/hackage.scm (ghc-standard-libraries): Add exceptions
library.
2021-10-08 09:13:51 +02:00
Lars-Dominik Braun 75c91e6b43
import: stackage: Update %default-lts-version to 18.10.
* guix/import/stackage.scm (%default-lts-version): Update to 18.10.
2021-10-08 09:13:51 +02:00
John Kehayias fe56213027
guix: haskell-build-system: Always pass -package-db option.
* guix/build/haskell-build-system.scm (run-setuphs): Pass -package-db option.

Signed-off-by: Ricardo Wurmus <rekado@elephly.net>
2021-10-08 09:13:46 +02:00
Hartmut Goebel 1660253c3c
build-system: Add 'rebar3-build-system'.
* guix/build-system/rebar3.scm, guix/build/rebar3-build-system.scm: New files.
* Makefile.am (MODULES): Add them.
2021-10-07 22:35:28 +02:00
Hartmut Goebel d780d0a2bb
import: Add hex.pm importer.
hex.pm is a package repository for Erlang and Elixir.

* guix/scripts/import.scm (importers): Add "hexpm".
* guix/scripts/import/hexpm.scm, guix/import/hexpm.scm,
  guix/hexpm-download.scm: New files.
* guix/import/utils.scm (source-spec->object): Add "hexpm-fetch" to list of
  fetch methods.
* guix/upstream.scm (package-update/hexpm-fetch): New function.
  (%method-updates) Add it.
* Makefile.am: Add them.
2021-10-07 22:35:28 +02:00
Hartmut Goebel f63c79bf76
Add (guix extracting-download).
* guix/extracting-download.scm: New file
* Makefile.am (MODULES): Add it.
2021-10-07 22:24:23 +02:00
Ludovic Courtès 1327ec822f
import: crate: Gracefully handle missing license info.
Fixes <https://issues.guix.gnu.org/51048>.
Reported by Michael Zappa <me@michzappa.com>.

* guix/import/crate.scm (<crate-version>)[license]: Translate 'null to #f.
(make-crate-sexp): Handle LICENSE = #f.
2021-10-07 10:47:44 +02:00
Ludovic Courtès 3f717a09e7
guix system: Adjust bootloader message to plural "targets".
This is a followup to 2ca982ff41.

* guix/scripts/system.scm (install): Adjust message to plural 'targets'.
2021-10-07 10:47:43 +02:00
Ludovic Courtès 6d02a994f9
download: Honor #:verify-certificate? for SWH downloads.
Previously, the SWH + Disarchive fallback could fail with:

  Trying to use Disarchive to assemble /gnu/store/…-ucsim-0.6-pre68.tar.gz...
  Assembling the directory ucsim-0.6-pre68
  Downloading /gnu/store/…-ucsim-0.6-pre68.tar.gz from Software Heritage...
  X.509 certificate of 'archive.softwareheritage.org' could not be verified:
    signer-not-found
    invalid

  Could not resolve directory reference

This will no longer be the case since 'guix perform-download'
passes #:verify-certificate? #f.

* guix/build/download.scm (disarchive-fetch/any): Parameterize
'%verify-swh-certificate?'.
2021-10-07 10:47:43 +02:00
Mathieu Othacehe f743f2046b
publish: Defer narinfo string creation to the http-write.
The "narinfo-string" procedure is expensive in term of IO operations and can
take a while under IO pressure, such a GC collecting. Defer its call to a new
thread created in the http-write procedure.

Fixes: <https://issues.guix.gnu.org/48468>
Partially fixes: <https://issues.guix.gnu.org/49089>

* guix/scripts/publish.scm (render-narinfo): Defer the narinfo string creation
to the http-write procedure.
(compression->sexp, sexp->compression): New procedures.
("X-Nar-Compression"): Use them.
("X-Narinfo-Compressions"): New custom header.
(strip-headers): Add the x-nar-path header.
(http-write): Add narinfo on-the-fly creation support. It happens in a
separated thread to prevent blocking the main thread.
2021-10-05 18:55:55 +00:00
Sarah Morgensen 834ff65e85
import: go: Recognize major version suffixes.
Do not treat major version suffixes (such as "/v3") as repository
subdirectories.  See <https://golang.org/ref/mod#major-version-suffixes>.

* guix/import/go.scm (go-module->guix-package): When determining the
unpack path, compare 'root-module-path' to 'module-path-sans-suffix'
instead of 'module-path'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-04 16:36:59 +02:00
Sarah Morgensen ac43ead774
import: go: Handle extra whitespace in "go-import" meta tags.
Some packages sites use extra whitespace in the content portion of <meta
name="go-import" ...> tags, so handle that.  Example:
<https://k8s.io/api?go-get=1>

* guix/import/go.scm (fetch-module-meta-data)[go-import->module-meta]:
Use 'string-tokenize' instead of 'string-split'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-04 16:36:59 +02:00
Efraim Flashner 6a544b2130
scripts: home: Support dry-run.
* guix/scripts/home.scm (%options): Add option for dry-run.
2021-10-04 11:26:43 +03:00
Pierre Langlois 20bc9ecc20
scripts: home: Wire and document --expression flag.
* guix/scripts/home.scm (show-help): Add --expression option.
(%options): Likewise.
* doc/guix.texi (Invoking guix home): Document it.
2021-10-02 21:21:19 +01:00
Maxime Devos 085a8a0cdf
import/minetest: Define an updater for mods on ContentDB.
Only detecting updates is currently supported.  To actually
perform the uppdates, a patch like
<https://issues.guix.gnu.org/50072#4> is required.

* guix/import/minetest.scm
  (version-style,minetest-package?,latest-minetest-release): New procedures.
  (%minetest-updater): New updater.
* tests/minetest.scm
  (upstream-source->sexp,expected-sexp,example-package): New procedure.
  (test-release,test-no-release): New macro's.
  ("same version","new version (dotted)","new version (date)")
  ("new version (git -> dotted)","dotted->date","date->dotted")
  ("no commit informaton, no new release")
  ("minetest is not a minetest mod")
  ("technic is a minetest mod")
  ("upstream-name is required"): New tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-10-02 17:16:43 +02:00
Ludovic Courtès b7d8dc5841
import: stackage: Use the standard diagnostic procedures.
* guix/import/stackage.scm (leave-with-message): Remove.
(stackage-lts-info-fetch): Use 'raise' and 'formatted-message'.
(stackage->guix-package): Likewise.
(latest-lts-release): Use 'warning' instead of 'format'.
2021-10-02 17:04:54 +02:00
Ludovic Courtès 46d15af4cb
import: stackage: Use 'define-json-mapping'.
* guix/import/stackage.scm (<stackage-lts>, <snapshot>)
(<stackage-package>): New record types and JSON mappings.
(lts-info-packages, stackage-package-name)
(stackage-package-version): Remove.
(lts-package-version): Rename 'pkgs-info' to 'packages'; assume
'packages' is a list of <stackage-package>.
(stackage->guix-package): Use 'stackage-lts-packages' instead of
'lts-info-packages'.  Rename 'packages-info' to 'packages'.
(latest-lts-release): Likewise.
(stackage-package?): Rename to...
(stackage-lts-package?): ... this.  Adjust to new API.
(%stackage-updater)[pred]: Update accordingly.
* tests/lint.scm ("haskell-stackage"): Add "snapshot" entry in JSON
snippet.
2021-10-02 17:04:50 +02:00
Tobias Geerinckx-Rice bdd190e3aa
build-system: linux-module: Don't explicitly return #t from phases.
* guix/build-system/linux-module.scm (configure): Remove explicit #t return value.
2021-10-01 21:27:35 +02:00
Tobias Geerinckx-Rice 834415c33a
build-system: linux-module: Build and install in parallel.
* guix/build-system/linux-module.scm (linux-module-build)
(guix/build-system/linux-module.scm): Accept the PARALLEL-BUILD? keyword
and pass it on to the builder.
* guix/build/linux-module-build-system.scm (build, install): Capture and
honour it.
2021-10-01 21:27:35 +02:00
Xinglu Chen 7b75f90c5b
import: pypi: Honor the 'upstream-name' package property.
Previously, when a PyPI package had a “-” followed by one or more digits in
its name, e.g., “AV-98”, the importer would interpret “98” as the version of
the package and thus mistake the “AV-98” package for the “av” package on PyPI.

  $ ./pre-inst-env guix refresh av-98
  following redirection to `https://pypi.org/pypi/av/json'...
  /home/yoctocell/src/guix/gnu/packages/web-browsers.scm:914:13: av-98 would be upgraded from 1.0.1 to 8.0.3

Setting the ‘upstream-name’ property to “AV-98” would solve the problem.

  $ ./pre-inst-env guix refresh av-98
  /home/yoctocell/src/guix/gnu/packages/web-browsers.scm:914:13: 1.0.1 is already the latest version of av-98

* guix/import/pypi.scm (guix-package->pypi-name): Honor ‘upstream-name’
property.
(make-pypi-sexp): Set ‘upstream-name’ property when appropriate.
* tests/pypi.scm (test-json): Rename to ...
(test-json-1): ... this.
(test-json-2): New variable
("guix-package->pypi-name, honor 'upstream-name'"): New test.
("pypi->guix-package, package name contains \"-\" followed by digits"):
Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-30 23:44:49 +02:00
Ludovic Courtès bedcba8f5c
discovery: Hide Guile warnings when loading modules.
Fixes <https://issues.guix.gnu.org/43747>.

* guix/discovery.scm (scheme-modules): Parameterize 'current-warning-port'.
2021-09-30 23:44:49 +02:00
zimoun 270b30705d
packages: Factorize and document 'computed-origin-method'.
The 'computed-origin-method' had been introduced to work around
limitations of the 'snippet' mechanism.  The procedure was duplicated,
which made it hard to automatically detect packages using it.

* guix/packages.scm (computed-origin-method): Move procedure from...
* gnu/packages/gnuzilla.scm: ...here and...
* gnu/packages/gnuzilla.scm: ...there.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-30 23:44:48 +02:00
Tobias Geerinckx-Rice a939011b58
build-system: linux-module: Normalise the ‘M’ source-directory.
"make modules_install" with an "M=" file name ending in "/." breaks at
least rtl8812au-aircrack-ng-linux-module.  In general, passing a more
human-generated-looking value seems prudent as these are more likely to
be tested upstream.

* guix/build/linux-module-build-system.scm (build, install): Call
CANONICALIZE-PATH on SOURCE-DIRECTORY instead of STRING-APPEND.

Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.
as apteryx on #guix
2021-09-30 07:17:01 +02:00
Tobias Geerinckx-Rice 2f5368d678
import: minetest: Fix typos.
* guix/import/minetest.scm (elaborate-contentdb-name): Fix ‘ambiguous’
and ‘thes’ typos.
* tests/minetest.scm: Likewise for all tests.
2021-09-28 22:00:47 +02:00
Andrew Tropin badf788f15
home-services: Add missing imports and function definition.
* gnu/home-services/configuration.scm: Add missing imports.
* gnu/home-services/utils.scm (list->human-readable-list): Add new function.
* gnu/home-services/configuration.scm: Add missing imports.
* gnu/home-services/xdg.scm: Fix ensure-list function.
* guix/scripts/home/import.scm: Add missing imports.

Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>
2021-09-28 13:50:21 +03:00
Oleg Pykhalov 6ae4644984
Merge branch 'wip-guix-home' 2021-09-27 17:27:12 +03:00
Xinglu Chen 9c5e5ca1c0
import: stackage: Don’t try to update packages not available on Stackage.
Previously, the ‘hackage-package?’ predicate was used which meant that
the updater would try to update non-Stackage packages, and lead to messages
like these:

  $ guix refresh -t stackage
  warning: failed to parse https://hackage.haskell.org/package/hurl/hurl.cabal
  warning: failed to parse https://hackage.haskell.org/package/idris/idris.cabal

Since ‘hurl’ and ‘idris’ aren’t available on the current Stackage LTS release,
they should be filtered out before the Stackage updater even tries to update
them.

* stackage.scm (stackage-package?): New procedure.
(%stackage-updater): Use it.

Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2021-09-27 13:37:51 +02:00
Liliana Marie Prikler 719bbcc15e
Update copyright assignments for Liliana Marie Prikler.
* doc/guix.texi: Update copyright name for Liliana Marie Prikler.
* gnu/packages/build-tools.scm: Update copyright name and email for Liliana
Marie Prikler.
* gnu/packages/convmv.scm: Likewise.
* gnu/packages/emacs-xyz.scm: Likewise.
* gnu/packages/emacs.scm: Likewise.
* gnu/packages/esolangs.scm: Likewise.
* gnu/packages/game-development.scm: Likewise.
* gnu/packages/games.scm: Likewise.
* gnu/packages/gnome-xyz.scm: Likewise.
* gnu/packages/gnome.scm: Likewise.
* gnu/packages/gstreamer.scm: Likewise.
* gnu/packages/guile-xyz.scm: Likewise.
* gnu/packages/minetest.scm: Likewise.
* gnu/packages/music.scm: Likewise.
* gnu/packages/patches/minetest-add-MINETEST_MOD_PATH.patch: Likewise.
* gnu/packages/patches/ppsspp-disable-upgrade-and-gold.patch: Likewise.
* gnu/packages/patches/webkitgtk-bind-all-fonts.patch: Likewise.
* gnu/packages/python-xyz.scm: Likewise.
* gnu/packages/unicode.scm: Likewise.
* gnu/packages/xorg.scm: Likewise.
* gnu/services/sound.scm: Likewise.
* guix/build-system/renpy.scm: Likewise.
* guix/build/emacs-utils.scm: Likewise.
* guix/build/renpy-build-system.scm: Likewise.
2021-09-25 09:34:36 +02:00
Tobias Geerinckx-Rice 348f0c61ef
syscalls: Deduplicate device number conversion.
* guix/cpio.scm (device-number, device->major+minor):
Move to, and subsequently import from, …
* guix/build/syscalls.scm (device-number, device-number->major+minor):
…here.  Note the slight name change.
(mounts): Replace 16-bit open code with a DEVICE-NUMBER call.
* gnu/build/linux-boot.scm (device-number):
Remove duplicate 16-bit implementation in favour of the one above.
(resume-if-hibernated): Reuse DEVICE-NUMBER->MAJOR+MINOR.
2021-09-23 18:17:16 +02:00
Ludovic Courtès 5871639bb1
download: Fall back to web.archive.org as a very last resort.
Suggested by Florian Pelz <pelzflorian@pelzflorian.de>.

* guix/build/download.scm (internet-archive-uri): New procedure.
(url-fetch): Append it to the list of URIs after
CONTENT-ADDRESSED-URIS.
2021-09-22 16:14:39 +02:00
Ludovic Courtès 5b32ad4f6f
graph: Add '--max-depth'.
* guix/graph.scm (export-graph): Add #:max-depth and honor it, adding
'depths' argument to 'loop'.
* guix/scripts/graph.scm (%options, show-help): Add '--max-depth'.
(%default-options): Add 'max-depth'.
(guix-graph): Pass #:max-depth to 'export-graph'.
* tests/graph.scm ("package DAG, limited depth"): New test.
* doc/guix.texi (Invoking guix graph): Document it.
2021-09-21 15:15:52 +02:00
Ludovic Courtès baa0aa1348
base32: Work around (ash x N) miscompilation at '-O1' and below.
Fixes <https://issues.guix.gnu.org/50696>.
Reported by Marius Bakke <marius@gnu.org>.

* guix/base32.scm (bit-field): Introduce 'minus-start' syntax and use it.
2021-09-21 15:15:52 +02:00
Ludovic Courtès dce2cf311b
git: 'reference-available?' recognizes 'tag-or-commit'.
* guix/git.scm (reference-available?): Handle 'tag-or-commit' with a
40-digit hex string.
2021-09-18 23:08:32 +02:00
Ludovic Courtès 05f44c2d85
git: 'update-cached-checkout' can fall back to SWH when cloning.
Fixes <https://issues.guix.gnu.org/44187>.
Reported by zimoun <zimon.toutoune@gmail.com>.

* guix/git.scm (GITERR_HTTP): New variable.
(clone-from-swh, clone/swh-fallback): New procedures.
(update-cached-checkout): Use 'clone/swh-fallback' instead of 'clone*'.
2021-09-18 23:08:32 +02:00
Ludovic Courtès 6ec81c31c0
swh: Support downloads of bare Git repositories.
* guix/swh.scm (swh-download-archive): New procedure.
(swh-download-directory): Rewrite in terms of 'swh-download-archive'.
(swh-download): Add #:archive-type and honor it.  Use
'swh-download-archive' instead of 'swh-download-directory'.
2021-09-18 23:08:32 +02:00
Sarah Morgensen 281ede2e7d
import: go: Match "go-import" meta tags anywhere.
Some personal sites forget to put <meta name="go-import" ...> in a
<head> element, so look anywhere for them.

Partly fixes <https://issues.guix.gnu.org/50595>.
Reported by Stephen Paul Weber <singpolyma@singpolyma.net>.

* guix/import/go.scm (fetch-module-meta-data): Match "go-import" meta
tags anywhere in the page.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-18 23:08:32 +02:00
Sarah Morgensen b3907e304d
import: go: Improve handling of modules in VCS subdirectories.
Use the supplied module path (instead of the repository root) as the import
path for everything except source and homepage URLs.  For modules not in the
root of a VCS repository, set #:unpack-path to the repository root by default.

Partly fixes <https://issues.guix.gnu.org/50595>.
Reported by Stephen Paul Weber <singpolyma@singpolyma.net>.

* guix/import/go.scm (go-module->guix-package): Use 'module-path'
instead of 'root-module-path' for #:import-path.  Emit #:unpack-path
when #:import-path is not equal to 'root-module-path'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-18 23:08:32 +02:00
Maxime Devos 808f9ffbd3
import: minetest: Strip "v" prefixes from the version number.
This fixes one of the issues noted at <https://issues.guix.gnu.org/50425#4>.

* guix/import/minetest.scm
  (release-version): New procedure.
  (%minetest->guix-package): Call new procedure instead of release-title.
* tests/minetest.scm
  (make-package-sexp): Allow overriding the version number.
  (make-releases-json): Allow overriding the release title.
  ("conventional version number")
  ("v-prefixed version number")
  ("dates as version number"): New tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-18 19:43:00 +02:00
Maxime Devos 8480a2a5bb
import: minetest: Delete duplicate dependencies.
This fixes one of the issues noted in <https://issues.guix.gnu.org/50425#4>.

* guix/import/minetest.scm
  (import-dependencies): Call 'delete-duplicates' on the resulting list.
* tests/minetest.scm
  ("minetest->guix-package, multiple dependencies implemented by one mod"):
  New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-18 19:42:54 +02:00
Ludovic Courtès 778c1fb4ea
channels: 'channel-news-entry-commit' correctly resolves annotated tags.
Previously, 'channel-news-entry-commit' would return the tag ID rather
than the commit ID when the news entry was referred to via an annotated
tag.

Reported by Xinglu Chen <public@yoctocell.xyz>.

* guix/channels.scm (resolve-channel-news-entry-tag): Check whether the
reference points to annotated tag; resolve it if it does.
* tests/channels.scm ("channel-news, annotated tag"): New test.
2021-09-18 19:37:45 +02:00
Xinglu Chen 59ee10754e
import: Add 'generic-git' updater.
* guix/git.scm (ls-remote-refs): New procedure.
* tests/git.scm ("remote-refs" "remote-refs: only tags"): New tests.
* guix/import/git.scm: New file.
* doc/guix.texi (Invoking guix refresh): Document it.
* tests/import-git.scm: New test file.
* Makefile.am (MODULES, SCM_TESTS): Register the new files.

Co-authored-by: Sarah Morgensen <iskarian@mgsn.dev>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-18 19:37:45 +02:00
Xinglu Chen 6597f80839
tests: git: Make 'tag' directive non-interactive.
When running 'git tag TAGNAME', Git will open up the user's default text
editor to make them write a message.  This is not desirable when running
tests.

* guix/tests/git.scm (populate-git-repository): Add a 'tag' directive
that takes an additional argument, and pass it to the '-m' flag.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2021-09-18 19:37:45 +02:00
Xinglu Chen 4674738cdb
tests: git: Don't read from the users global Git config file.
* guix/tests/git (populate-git-repository): Set the GIT_CONFIG_GLOBAL
environment variable to the temporary Git config file.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-18 19:37:44 +02:00
Ludovic Courtès f72f4b48c6
store: 'map/accumulate-builds' processes the whole list in case of cutoff.
Fixes <https://issues.guix.gnu.org/50264>.
Reported by Lars-Dominik Braun <lars@6xq.net>.

This fixes a regression introduced in
fa81971cba whereby 'map/accumulate-builds'
would return REST (the tail of LST) without applying PROC on it.  The
effect would be that 'lower-inputs' in (guix gexp) would dismiss those
elements, leading to derivations with correct builders but only a subset
of the inputs they should have had.

* guix/store.scm (map/accumulate-builds): Add #:cutoff parameter and
remove 'accumulation-cutoff' variable.  Call PROC on the elements of
REST.
* tests/store.scm ("map/accumulate-builds cutoff"): New test.
2021-09-15 16:52:13 +02:00
Xinglu Chen a840caccae
import: cabal: Treat identifier names correctly.
* guix/import/cabal.scm (is-id): Accept the location as an argument.  Don’t
check if the identifier name is a reserved keyword unless it is the first word
on the line.
(lex-word): Adjust accordingly.
* tests/hackage ("hackage->guix-package tests flag executable"): Expect it to
pass.

Fixes: <https://issues.guix.gnu.org/25138>
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2021-09-15 14:28:38 +02:00
Liliana Marie Prikler c8e2358cca
build-system: linux-module: Support source-directory.
As with guile-build-system, the module to be build need not necessarily live
at the root of the build tree.

* guix/build/linux-module-build-system.scm (build, install): Add
source-directory argument and append it to "M" variable when invoking make.
* guix/build-system/linux-module.scm (linux-module-build): Add
source-directory argument.
2021-09-14 23:27:36 +02:00
Xinglu Chen 08c7e7df15
scripts: import: Increase column width for pretty-printer.
Previously, the max column width for the pretty-printer was 50, which caused
generated package definitions to include unnecessary newlines, e.g.,

  (home-page
    "https://gitlab.com/ttyperacer/terminal-typeracer")

instead of

  (home-page "https://gitlab.com/ttyperacer/terminal-typeracer")

* guix/scripts/import.scm (guix-import): Set max expression width to 80 when
pretty-printing.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-14 11:50:58 +02:00
Ludovic Courtès 3cb5ae8577
download: Disarchive mirrors can be URL-returning procedures.
As discussed at <https://issues.guix.gnu.org/47336#16>.

* guix/build/download.scm (url-fetch)[disarchive-uris]: Accept MIRROR as
a procedure.
* guix/download.scm (%disarchive-mirrors): Add comment.  This change can
only be made once a 'guix perform-download' that understands procedures
is widely deployed.
2021-09-14 11:50:58 +02:00
Ludovic Courtès 67da646087
download: Remove obsolete workaround.
* guix/download.scm (%content-addressed-mirrors): Use (guix base16)
unconditionally.
2021-09-14 11:50:58 +02:00
Andrew Tropin a2324d8b56
guix: self: Add *home-modules*.
* guix/self.scm(*home-modules*): New variable.

Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>
2021-09-13 22:42:25 +03:00
Efraim Flashner de4f5df95d
build/go: Support cross compiling.
* guix/build-system/go.scm (go-target): New procedure.
(go-build): Add goarch, goos keywords. Adjust bag depending if doing a
native or cross compile.
(go-cross-build): New procedure.
* guix/build/go-build-system.scm (setup-go-environment): Accept goarch,
goos keywords. Set go environment variables based on target architecture.
* doc/guix.texi (Build Systems): Mention new go-build-system keywords.
2021-09-13 15:33:30 +03:00
Ludovic Courtès 8531997d2a
packages: Add 'package-definition-location'.
Suggested by Maxime Devos <maximedevos@telenet.be>.

* guix/packages.scm (current-definition-location): New syntax parameter.
(define-public*): New macro.
(<package>)[definition-location]: New field.
(package-definition-location): New procedure.
* tests/packages.scm ("package-definition-location"): New test.
2021-09-13 12:31:10 +02:00
Ludovic Courtès 10c981b135
packages: Store 'location' field as a literal vector.
This is slightly more efficient than storing an alist in terms of .go
file size (< 1% smaller) and load time.

* guix/packages.scm (current-location-vector): New macro.
(sanitize-location): New procedure.
(<package>)[location]: Change 'default' and add 'sanitize'.
(package-location): New procedure.
2021-09-13 12:31:10 +02:00
Xinglu Chen 9875f9bca3
import: elpa: Don't hardcode default branch to 'master'.
Otherwise, remotes without a branch named 'master' will cause an error when
importing.

* guix/import/elpa (git-repository->origin): Fallback to HEAD instead of the
  'master' branch.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-10 17:30:55 +02:00
Ludovic Courtès 60b42bec84
swh: 'swh-download' reports revision lookup failures.
* guix/swh.scm (swh-download): Log lookup failures.
2021-09-10 17:30:54 +02:00
Ludovic Courtès ff613c2b68
swh: Adjust to new vault API.
Previously the path to query the vault or request cooking of a directory
was /api/1/vault/directory/ID.  It is now deprecated in favor if
/api/1/vault/flat/SWHID.  This commit adjusts code accordingly and also
prepares for 'git-bare' support.

* guix/swh.scm (vault-url): New procedure.
(query-vault, request-cooking): Make 'kind' optional, and add #:archive-type.
Use 'vault-url'.
(vault-fetch): Make 'kind' optional and add #:archive-type.  Adjust
'query-vault' and 'request-cooking' calls accordingly.
2021-09-10 17:30:54 +02:00
Ludovic Courtès 163d6385fd
lint: archival: Warn about non-origin sources.
* guix/lint.scm (check-archival): Warn about non-origin sources.
2021-09-10 17:30:54 +02:00
Ludovic Courtès cb06f7c61e
base32: Provide an open-coded 'bit-field'.
This improves the throughput of 'bytevector->base32-string' a bit.

* guix/base32.scm (bit-field): New macro.
2021-09-10 17:30:54 +02:00
Maxime Devos a87d8c912d
base16: Reduce GC pressure in bytevector->base16-string.
This makes bytevector->base16-string two times faster.

* guix/base16.scm (bytevector->base16-string): Use utf8->string
  and iteration instead of string-concatenate and named let.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-10 17:30:54 +02:00
Andrew Tropin 879abff4fd
scripts: home: Add import subcommand.
* guix/scripts/home/import.scm: New file.
* Makefile.am (MODULES): Add it.

Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>
2021-09-09 20:26:51 +03:00
Andrew Tropin 89e05a6955
scripts: Add 'guix home'.
* guix/scripts/home.scm: New file.
* Makefile.am (MODULES): Add it.

Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>
2021-09-09 20:26:51 +03:00
Ludovic Courtès fb32a38db1
swh: Adjust <vault-reply> to latest API changes.
Fixes uses of 'swh-download' as reported at
<https://lists.gnu.org/archive/html/guix-devel/2021-09/msg00115.html>.
Reported by zimoun.

* guix/swh.scm (<vault-reply>)[object-id, object-type]: Remove.  These
two fields are no longer provided in JSON replies.
[swhid]: New field.
2021-09-09 11:18:06 +02:00
Marius Bakke 16ef7b4938
transformations: Git tags and 'git describe' style IDs are used as version.
* guix/transformations.scm (commit->version-string): New procedure.  Use git
tags and 'git describe' style identifiers directly.
(transform-package-source-commit): Adjust accordingly.
* tests/transformations.scm
("options->transformation, with-commit, version transformation"): New test.
* doc/guix.texi (Package Transformation Options): Mention the 'git describe'
style.
2021-09-08 18:03:50 +02:00
Marius Bakke 1dc3825e99
git: 'resolve-reference' handles 'git describe'-style commit IDs.
* guix/git.scm (resolve-reference): Rewrite tag-or-commit case to recognize
'git describe' style identifiers and resolve them as commits.
* doc/guix.texi (origin Reference): Mention it.
2021-09-08 18:03:50 +02:00