Commit Graph

519 Commits

Author SHA1 Message Date
Ricardo Wurmus
556ca8ba21
guix: Upgrade to Bioconductor 3.15.
* guix/build-system/r.scm (bioconductor-uri): Bump Bioconductor version to
3.15.
* guix/import/cran.scm (%bioconductor-version): Same.
2022-05-28 23:19:05 +02:00
Kyle Meyer
71de612e10
licenses: Add Expat No Attribution license.
* guix/licenses.scm (expat-0): New variable.
* guix/import/utils.scm (spdx-string->license): Add MIT-0.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-05-23 16:24:47 +02:00
Nicolas Graves
95b0544fcf
import: utils: Update list of SPDX licenses.
* guix/import/utils.scm (spdx-string->license): Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-05-23 16:24:46 +02:00
Philip McGrath
903c82583e
import: Add Elm importer.
* guix/import/elm.scm, guix/scripts/import/elm.scm: New files.
* Makefile.am (MODULES): Add them.
* guix/scripts/import.scm (importers): Add "elm".
* doc/guix.texi (Invoking guix import): Document Elm importer.
* doc/contributing.texi (Elm Packages): Mention it.
* tests/elm.scm ("(guix import elm)"): New test group.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-05-22 01:07:52 +02:00
Philip McGrath
9a47fd56dd
import: json: Accept '#:http-fetch' in 'json-fetch'.
For example, supplying 'http-fetch/cached' would enable caching.

* guix/import/json.scm (json-fetch): Add '#:http-fetch' argument.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-05-22 01:07:52 +02:00
Julien Lepiller
d59abc336d
import: opam: Factor out source import.
This also ensures a package can be imported even when it does not
specify a URL.

* guix/import/opam.scm (opam->guix-source): New procedure.
(opam->guix-package): Use it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-11 11:55:58 +02:00
Julien Lepiller
be7338d400
import: opam: Accept tabulations.
* guix/import/opam.scm (SP, SP2): Accept tabulation as whitespace.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-04-11 11:55:54 +02:00
Maxim Cournoyer
bfe66d4a2a
import: pypi: Use new style for the conditional unzip input.
* guix/import/pypi.scm (make-pypi-sexp)<unzip>: Use new style.
2022-04-04 00:06:31 -04:00
Ludovic Courtès
f7bb161445
import: hackage: Use SRFI-71 instead of SRFI-11.
* guix/import/hackage.scm (read-cabal-and-hash)
(hackage-fetch-and-hash, hackage-fetch)
(hackage->guix-package): Use 'let' and 'let*' instead of 'let-values'
and 'let*-values'.
2022-03-07 22:49:29 +01:00
Ludovic Courtès
483e4a9d07
import: hackage: Avoid pointless use of 'compose'.
* guix/import/hackage.scm (hackage-module->sexp): Unroll pointless calls
to 'compose'.
(hackage->guix-package): Likewise.
2022-03-07 22:49:29 +01:00
zimoun
7229b0e858
import: cran: Return multiple values for unknown packages.
Partly fixes <https://bugs.gnu.org/44115>.

* guix/import/pypi.scm (cran->guix-package): Return 'values'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-07 22:49:28 +01:00
zimoun
1fe81b349c
import: elpa: Return multiple values for unknown packages.
Partly fixes <https://bugs.gnu.org/44115>.

* guix/import/elpa.scm (elpa->guix-package): Return values.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-07 22:49:28 +01:00
zimoun
6bb92098b4
import: hackage: Return multiple values for unknown packages.
Partly fixes <https://bugs.gnu.org/44115>.

* guix/import/hackage.scm (hackage->guix-package): Return 'values'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-03-07 22:49:28 +01:00
zimoun
434925379d
import: pypi: Return multiple values for unknown packages.
Partly fixes <https://bugs.gnu.org/44115>.

* guix/import/pypi.scm (pypi->guix-package): Return two values when
PROJECT is false.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-03-07 22:49:28 +01:00
Ludovic Courtès
ebb03447f8
import: pypi: Gracefully handle missing project home page.
Fixes <https://issues.guix.gnu.org/54259>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/import/pypi.scm (pypi->guix-package): Upon
'missing-source-error?', raise '&fix-hint' only if
'project-info-home-page' returns a non-empty string.
2022-03-07 22:49:28 +01:00
Ludovic Courtès
a8d3033da6
import: github: Reuse HTTP connection for the /tags URL fallback.
* guix/import/github.scm (fetch-releases-or-tags): Call
'open-connection-for-uri' and reuse the same connection for the two
'http-fetch' calls.
* .dir-locals.el (scheme-mode): Add 'call-with-port'.
2022-03-06 22:49:47 +01:00
Ludovic Courtès
55e8e283ae
import: github: Gracefully handle rate limit exhaustion.
Previously, 'guix refresh' would literally crash when the rate limit was
reached due to the call to 'error'.  With this change, the updater
notices when the rate limit is reached and it turns itself into a no-op
until the rate limit has been reset.

When running "guix refresh" (with no arguments), the 'github' updater
gets used until the rate limit has been reached, after which "guix
refresh" automatically picks up the next valid updater, typically
'generic-git'.

* guix/import/github.scm (fetch-releases-or-tags): Use 'http-fetch'
directly instead of 'json-fetch' to let 'http-get-error?' exceptions
through.  Handle 403 errors with an 'X-RateLimit-Remaining' header.
(%rate-limit-reset-time): New variable.
(update-rate-limit-reset-time!, request-rate-limit-reached?): New
procedures.
(latest-released-version): Remove calls to 'error'.
2022-03-06 22:49:47 +01:00
Alice BRENON
6207da50e2
import: utils: Harden beautify-description.
* guix/import/utils.scm (beautify-description): Handle non-string
arguments.
[use-modules]: Explicitly import G_ from (guix i18n) and make (guix ui)
import explicit.
* guix/import/opam.scm: [use-modules] Make imports explicit for module
(guix import utils).

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-02-08 13:34:01 +01:00
Ludovic Courtès
00762a4c4c
import: pypi: Display a hint upon "no source release" errors.
Fixes <https://issues.guix.gnu.org/49083>.

* guix/import/pypi.scm (pypi->guix-package): Upon
'missing-source-error?', raise a compound condition with a hint.
2022-02-02 17:58:21 +01:00
Vivien Kraus
bac9f8302c
import: pypi: Convert hyphens to underscores in PyPI URLs if needed.
* guix/import/pypi.scm (find-project-url): New function.
(make-pypi-sexp): Use find-project-url.
* tests/pypi.scm (foo-json): New procedure.
(test-json-1, test-json-2): Define in terms of it.
("find-project-url, with numpy", "find-project-url, uWSGI"):
("find-project-url, flake8-array-spacing")
("find-project-url, foo/goo"): New tests.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-01-26 17:54:58 +01:00
Ricardo Wurmus
5ecb4acdcb
import/texlive: Add helper to check installed files.
* guix/import/texlive.scm (files-differ?): New procedure.
2022-01-20 22:56:55 +01:00
Ricardo Wurmus
4ceece4552
guix: import/cran: Cast booleans.
This is needed due to a change in file-hash*.

* guix/import/cran.scm (description->package): Ensure that GIT? and HG? are
booleans.
2022-01-20 12:00:03 +01:00
Maxime Devos
81f036bfd2
import/github: Test it.
* Makefile.am (SCM_TESTS): Register new tests.
* guix/import/github.scm
  (%github-api): New variable.
  (fetch-releases-or-tags): Use the new variable.
* tests/import-github.scm: New file with tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-01-16 23:56:56 +01:00
Maxime Devos
f8306a5019
import/github: Return <git-reference> objects for git-fetch origins.
* guix/import/github.scm
  (latest-released-version): Also return the tag.
  (latest-release): Use this information to return <git-reference> objects
  when appropriate.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-01-16 23:56:56 +01:00
Ludovic Courtès
641b599d0b
import: texlive: Remove labels from 'propagated-inputs' field.
* guix/import/texlive.scm (tlpdb->package): Remove labels from
'propagated-inputs' field.
* tests/texlive.scm ("texlive->guix-package"): Adjust accordingly.
2022-01-13 23:11:19 +01:00
Ricardo Wurmus
18bd4d12d7
import: texlive: Remove more specific entries with the same prefix.
* guix/import/texlive.scm (files->directories): Ensure that any more specific
directory is removed if a parent directory is in the list of provided
locations.
2022-01-10 12:46:47 +01:00
Ludovic Courtès
c1db66fa0a
import: go: Correctly report diagnostics upon version mismatch.
* guix/import/go.scm (strip-v-prefix, ensure-v-prefix)
(validate-version): New procedures.
(go-module->guix-package): Use 'validate-version' when defining
'version*'.  Remove 'else' clause in SRFI-34 guard.
2022-01-09 23:17:17 +01:00
Sarah Morgensen
9f526f5dad
upstream: Support updating and fetching 'git-fetch' origins.
Updaters need to be modified to return 'git-reference' objects.
This patch modifies the 'generic-git' and 'minetest' updater,
but others might need to be modified as well.

* guix/git.scm (git-reference->git-checkout): New procedure.
* guix/upstream.scm (package-update/git-fetch): New procedure.
  (<upstream-source>)[urls]: Document it can be a 'git-reference'.
  (%method-updates): Add 'git-fetch' mapping.
  (update-package-source): Support 'git-reference' sources.
  (upstream-source-compiler/url-fetch): Split off from ...
  (upstream-source-compiler): ... this, and call ...
  (upstream-source-compiler/git-fetch): ... this new procedure if the URL
  field contains a 'git-reference'.
* guix/import/git.scm
  (latest-git-tag-version): Always return two values and document that the tag
  is returned as well.
  (latest-git-release)[urls]: Use the 'git-reference' instead of the
  repository URL.
* guix/import/minetest.scm (latest-minetest-release)[urls]: Don't wrap the
  'git-reference' in a list.
* tests/minetest.scm (upstream-source->sexp): Adjust to new convention.

Co-authored-by: Maxime Devos <maximedevos@telenet.be>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-01-06 16:27:30 +01:00
Sarah Morgensen
b4c677c2ed
import: Factorize file hashing.
* guix/import/cran.scm (vcs-file?, file-hash): Remove procedures.
  (description->package): Use 'file-hash*' instead.
* guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures.
  (git-repository->origin, elpa-package->sexp): Use 'file-hash* instead'.
* guix/import/go.scm (vcs-file?, file-hash): Remove procedures.
  (git-checkout-hash): Use 'file-hash*' instead.
* guix/import/minetest.scm (file-hash): Remove procedure.
  (make-minetest-sexp): Use 'file-hash*' instead.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-01-06 16:27:30 +01:00
Xinglu Chen
82eb05c398
import: elpa: Also check NonGNU ELPA for updates.
* guix/import/elpa.scm (latest-release): Determine the repository based
on the URL of the source.
(package-from-gnu.org?): Rename to ...
(elpa-repository): ...this; memoize.
(package-from-elpa-repository?): New procedure.
(%elpa-updater): Adjust accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-01-05 23:44:18 +01:00
Xinglu Chen
f21c70bc9a
import: elpa: Support ‘upstream-name’ property.
* guix/import/elpa.scm: (guix-package->elpa-name): New procedure.
  (latest-release): Use it.
* tests/elpa.scm ("guix-package->elpa-name: without 'upstream-name' property")
  ("guix-package->elpa-name: with 'upstream-name' property"): Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-12-18 22:51:55 +01:00
Xinglu Chen
155fc235b5
import: Beautify descriptions when appropriate.
* guix/import/elpa.scm (elpa-package->sexp)
* guix/import/gnu.scm (gnu-package->sexp)
* guix/import/hackage.scm (hackage-module->sexp)
* guix/import/minetest.scm (make-minetest-sexp)
* guix/import/opam.scm (opam->guix-package)
* guix/import/pypi.scm (make-pypi-sexp): Beautify descriptions.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-12-17 17:29:34 +01:00
Xinglu Chen
5cd1019488
import: utils: Wrap lines in description.
* guix/import/utils.scm (beautify-description): Use ‘fill-paragraph’; add
  optional ‘length’ argument.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-12-17 17:29:34 +01:00
Ricardo Wurmus
9bc0f45df5
Merge remote-tracking branch 'origin/master' into core-updates-frozen 2021-12-05 19:17:41 +01:00
Marius Bakke
f63fb61d0c
import: PyPI: Validate GPG signatures when applicable.
* guix/import/pypi.scm (<distribution>): Fix funny typo.
(latest-release): When the distribution has a cryptographic signature, pass it
along to UPSTREAM-SOURCE.
2021-12-05 14:40:08 +01:00
Xinglu Chen
39f4ef59ff
build-system: haskell: Add ‘hackage-uri’ procedure.
* guix/build-system/haskell (hackage-uri): New procedure.
* guix/import/hackage.scm (hackage-module->sexp, latest-release): Use it.
* 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-12-01 17:53:25 +01:00
Ludovic Courtès
b15e543d30
Merge branch 'master' into core-updates-frozen 2021-11-23 11:29:38 +01:00
Julien Lepiller
24aa7b3c21
import: opam: Fix error on unknown field value.
* guix/import/opam.scm (metadata-ref): Return #f if field is present,
but its content is of unknown form.
2021-11-22 00:18:51 +01:00
zimoun
b5d51bb19e
import: opam: Warn instead of leave when fetching fails.
* guix/import/opam.scm (opam-featch): Warn instead of leave when fetching
fails.

Signed-off-by: Julien Lepiller <julien@lepiller.eu>
2021-11-19 12:57:35 +01:00
Ricardo Wurmus
424f2c92b4
import: texlive: Take different package database as optional argument.
* guix/import/texlive.scm (tlpdb->package): Expect PACKAGE-DATABASE as
argument.
(texlive->guix-package): Accept PACKAGE-DATABASE keyword.
2021-11-18 13:17:57 +00:00
Ricardo Wurmus
a030511fd9
import: texlive: Print inputs with labels and guixified names.
* guix/import/texlive.scm (tlpdb->package): Improve handling of propagated-inputs.
2021-11-18 13:17:56 +00:00
Ludovic Courtès
3a317f7476
Merge branch 'master' into core-updates-frozen 2021-11-17 23:43:14 +01:00
Ludovic Courtès
71b24abeb2
import: texlive: Remove leftover 'pk'.
* guix/import/texlive.scm (files->directories): Remove leftover 'pk'
call.
2021-11-17 15:44:48 +01:00
Ludovic Courtès
21357224bc
import: texlive: Load (gnu packages tex) dynamically.
Fixes a bug whereby 'guix pull' would fail with this guix-extra.drv
build failure:

  ice-9/eval.scm:163:9: ERROR:
    1. &formatted-message:
	format: "~a: patch not found\n"
	arguments: ("nettle-3.5-check-_pkcs1_sec_decrypt-msg-len.patch")

Reported by ekaitz on #guix.

Regression introduced in 3b1a12c5bff5a0c108284d19a6982bdf663bbceb.

* guix/import/texlive.scm: Autoload (gnu packages tex).

fixlet
2021-11-17 15:44:33 +01:00
Ricardo Wurmus
3b1a12c5bf
import: Replace texlive importer.
* guix/import/texlive.scm (fetch-sxml, sxml->package): Remove procedures.
(tlpdb-file, tlpdb, files->directories, tlpdb->package): New procedures.
(string->license): Add case for lpplgpl license combination.
(guix-name): Remove COMPONENT argument.
(texlive->guix-package): Use new procedures.
(texlive-recursive-import): New procedure.
* guix/scripts/import/texlive.scm (show-help, %options): Remove --archive
option.
(guix-import-texlive): Adjust call of texlive->guix-package.
* doc/guix.texi (Invoking guix import): Update documentation.
2021-11-17 11:00:01 +00:00
Attila Lendvai
0c21ec1c79
import: utils: Add more licenses and extend their detection.
* guix/import/utils.scm (spdx-string->license): Identify more
licenses (CC-BY-4.0, Freetype, HPND).
* guix/licenses.scm: Add a comment that mentions "MIT" so that people
who grep for MIT end up there.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-11-12 23:34:18 +01:00
Ludovic Courtès
3756ce3267
import: print: Replace packages and origins in 'arguments'.
* guix/import/print.scm (package->code)[variable-reference]
[object->code]: New procedures.
[package-lists->code]: Rewrite in terms of 'object->code'.
Pass the 'arguments' field through 'object->code'.
* tests/print.scm (pkg-with-arguments, pkg-with-arguments-source): New
variables.
("package with arguments"): New test.
2021-11-11 00:14:31 +01:00
Ludovic Courtès
b2ed40c29f
import: print: Handle patches that are origins.
* guix/import/print.scm (package->code)[source->code]: Handle patches
that are origins.
* tests/print.scm (pkg-with-origin-input): Add 'patches' field.
(pkg-with-origin-patch, pkg-with-origin-patch-source): New variables.
("package with origin patch"): New test.
2021-11-11 00:14:31 +01:00
Ludovic Courtès
b3240ae846
import: print: Correctly handle URI lists.
* guix/import/print.scm (package->code)[factorized-uri-code]: New
procedure.
[source->code]: Use it, and factorize URI when it's a list.
* tests/print.scm (pkg-with-origin-input): Check origin URI to a list.
2021-11-11 00:14:31 +01:00
Ludovic Courtès
04d929570a
import: print: Properly render packages with origins as inputs.
* guix/import/print.scm (package->code)[source->code]: Check whether
VERSION is true before calling 'factorize-uri'.
[package-lists->code]: Add clause for inputs that are origins.
* tests/print.scm (pkg-with-origin-input, pkg-with-origin-input-source):
New variables.
("package with origin input"): New test.
2021-11-11 00:14:31 +01:00