Commit Graph

643 Commits

Author SHA1 Message Date
Lars-Dominik Braun
eb42d18180
import: stackage: Update to release 20.5.
* guix/import/stackage.scm (%default-lts-version): Update to 20.5.
2023-02-26 10:19:36 +01:00
Lars-Dominik Braun
3e3f888dd3
import: hackage: Allow version at the beginning of cabal file.
Fix a corner case, uncovered by the hedgehog package, which has the
version field at the beginning of its cabal file. This causes a pattern
match failure.

* guix/import/hackage.scm (latest-release): Match version at beginning
of expression too.
2023-02-26 10:19:35 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Ricardo Wurmus
afcc6d636f
import/cran: Process more complex license strings.
* guix/import/cran.scm (string->license): Add more match clauses.
(string->licenses): Split license conjunctions at "|" and apply
string->license on each license.
(description->package): Use string->licenses.
2022-09-28 22:10:33 +02:00
Ricardo Wurmus
19ea75aa4f
import/cran: Use beautify-synopsis.
* guix/import/cran.scm (description->package): Use beautify-synopsis.
2022-09-28 22:10:33 +02:00
Ricardo Wurmus
7ea6e9f79f
import/utils: Add beautify-synopsis.
* guix/import/utils.scm (beautify-synopsis): New procedure.
2022-09-28 22:10:33 +02:00
Ricardo Wurmus
e761ed7384
import/cran: Transform external package names to Guix names.
* guix/import/cran.scm (transform-sysname): New procedure.
(description->package): Use it on inputs that are derived from "sysdepends".
2022-09-28 22:10:33 +02:00
Ricardo Wurmus
9d86052c22
import/cran: Add more strings to invalid-packages.
* guix/import/cran.scm (invalid-packages): Add none, windows, and xcode.
2022-09-28 22:10:33 +02:00
Ricardo Wurmus
ec92bcaadd
import/cran: description->package: Use COND and computed booleans.
* guix/import/cran.scm (description->package): Use COND with previously
computed booleans instead of using CASE on REPOSITORY.
2022-09-20 17:02:33 +02:00
Ricardo Wurmus
8c620a6036
import/cran: download: Accept optional REF argument.
* guix/import/cran.scm (download): Accept REF argument for git downloads.
2022-09-20 17:02:33 +02:00
Taiju HIGASHI
5d22261db3
import: gem: Support importing a specific version of a gem.
* guix/import/gem.scm: (rubygems-fetch, gem->guix-package)
(gem-recursive-import): Fix to fetch the specified version of the gem.
* guix/scripts/import/gem.scm (show-help): Update the help message.
(guix-import-gem): Modify so the version number to be passed to subsequent
procedures.
* tests/gem.scm: Add tests.
* doc/guix.texi (Invoking guix import): Document.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-09-17 19:09:27 +02:00
Maxim Cournoyer
5dd3acd0a0
import: gnome: Improve version handling logic.
Before this change, we'd get:

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

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

* guix/import/gnome.scm (latest-gnome-release)
<pre-release-text?>: New predicate.
<even-minor-version?>: Rename to...
<release-version?>: ...this.  Return #f in case the version corresponds to a
development release.
* guix/import/gnome.scm (latest-gnome-release): Adjust accordingly.
2022-09-13 02:04:36 -04:00
Ludovic Courtès
392e97ed08
import: gnome: Reject version strings such as "43.alpha".
Reported by Maxim Cournoyer.
This is a followup to 61b63e7fa7.

* guix/import/gnome.scm (latest-gnome-release)[even-minor-version?]:
Reject VERSION is the minor or micro part is not an integer.
2022-09-08 16:22:21 +02:00
Ludovic Courtès
61b63e7fa7
import: gnome: Do not require even minor for two-number version strings.
That way, "guix refresh gnome-keyring" will properly return "42.1"
instead of "42.0".

Reported by Maxim Cournoyer.

* guix/import/gnome.scm (latest-gnome-release)[even-minor-version?]:
Tweak for GNOME applications.
2022-09-06 16:58:12 +02:00
Ricardo Wurmus
b0c9f03248
import/utils: beautify-description: Add case for "Implements".
* guix/import/utils.scm (beautify-description): Add case to transform
sentences beginning with "Implements".
2022-08-25 11:55:12 +02:00
Ricardo Wurmus
be7b314f3f
import: Enable recursive import for texlive packages.
* guix/import/texlive.scm (tlpdb->package): Add VERSION argument; include
explicit version field in output.
(texlive->guix-package): Set default value for VERSION argument; adjust call
of tlpdb->package.
(texlive-recursive-import): Accept REPO and VERSION keyword arguments.
* guix/import/utils.scm (package->definition): Add a clause to deal with
output from tlpdb->package.
* guix/scripts/import/texlive.scm (%options): Add "recursive" option.
(guix-import-texlive): Honor "recursive" option.
* doc/guix.texi (Using TeX and LaTeX): Mention "recursive" option.
2022-07-19 23:49:42 +02:00
Hartmut Goebel
bf82f7cbe3
import: pypi: Fix coding style.
I missed this remark from the review when pushing the last change.

* guix/import/pypi.scm(python->package-name): Replace the trailing '#t'-case
  by a 'else'.
2022-07-15 21:19:08 +02:00
Hartmut Goebel
2e0b7867fe
import: pypi: Add special treatment for Tryton package names,
Trytond modules are Python packages, and treated like this in guix.  Anyhow,
since they are add-ons for the “Trytond“ application, their guix package name
do not get the "python-" prefix like other Python modules, (see also
https://issues.guix.gnu.org/46057#1).  This change disables adding the
"python-" prefix to the guix package name for Trytond modules when importing
and updating, thus inhibiting irritating messages like in this example:

  $ guix refresh -u trytond-party
  …
  trytond-party: consider adding this propagated input: python-trytond-country
  trytond-party: consider removing this propagated input: trytond-country

Handling this special case seems appropriate since (as of now) there are
about 165 packages for Trytond and the number is growing.

* guix/import/pypi.scm(python->package-name): Don't add "python-" prefix for
  trytond packages.
2022-07-15 21:14:22 +02:00
Hartmut Goebel
af025d99f4
import: egg: Fix updater.
'egg-source-url' did not return the URL, but the quoted expression.  This did
break the updater, which expects the URL as a string.

* guix/import/egg.scm(egg-source-url): Remove.
  (egg->guix-package)[egg-content]: Use quoted expression directly.
  (latest-release): Call egg-uri instead of egg-source-url.
2022-07-15 20:17:37 +02:00
Hartmut Goebel
e8cd9e3d12
import: github: Use correct URL scheme.
This effects packages hosted at github with source-uri like
…/releases/download/REPO-VERSION/REPO-VERSION.EXT.
E.g. ‘guix refresh udisks’ would fail to find the new release of ‘udisks’
before this change.

* guix/import/github.scm(updated-url): For one one of the
  cases add missing 'prefix' and set new version.
2022-07-11 15:35:28 +02:00
Hartmut Goebel
0d9f1f15cb
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.
2022-06-15 10:18:34 +02:00
Lars-Dominik Braun
143141726e
import: hackage: Filter upper/mixed case dependencies too.
* guix/import/hackage.scm (filter-dependencies): Convert OWN-NAMES
to lowercase before filtering.
(hackage-module->sexp): Remove #f from OWN-NAMES, which is used for
unnamed (default) libraries.
* tests/hackage.scm (test-cabal-internal-library-ignored): Add mismatched
uppercase letters.
2022-06-06 13:26:51 +02:00
Lars-Dominik Braun
dedfcaa8e2
import: hackage: Filter internal libraries from inputs and native-inputs.
Fixes <https://issues.guix.gnu.org/54760>.

* guix/import/hackage.scm (filter-dependencies): Support multiple
OWN-NAMES.
(hackage-module->sexp): Filter OWN-NAMES from HACKAGE-DEPENDENCIES and
HACKAGE-NATIVE-DEPENDENCIES.
* tests/hackage.scm (test-cabal-internal-library-ignored): New variable.
("hackage->guix-package test internal libraries are ignored"): New testcase.
2022-06-06 13:26:45 +02:00
Lars-Dominik Braun
c3fbaee345
import: cabal: Support library names
* guix/import/cabal.scm (make-cabal-parser): Add name to section.
(is-lib): Add optional name to regular expression.
(lex-rx-res): Support selecting different substring.
(lex-lib): Match 2nd substring from IS-LIB.
(lex-line): Adapt to changes for lex-lib.
(cabal-library): Add name field and export CABAL-LIBRARY-NAME.
(eval): Remove special case for 'library, which is not required any more.
(make-cabal-section): Move special case for LIBRARY.
* tests/hackage.scm (test-read-cabal-library-name): New variable.
("read-cabal test 1"): Adapt testcase to changed internal structure.
("read-cabal test: library name"): New testcase.
2022-06-06 13:26:45 +02:00
Lars-Dominik Braun
e3337f35af
import: cabal: Allow curly bracket before else statement.
* guix/import/cabal.scm (is-else): Turn into procedure.
(lex-line): Move IS-ELSE…
(lex-word): …here.
* tests/hackage.scm (test-cabal-elif-brackets): Extend testcase.
2022-06-06 13:26:45 +02:00
Lars-Dominik Braun
001e0bac99
import: cabal: Allow properties without space between key and value.
* guix/import/cabal.scm (lex-word): Add colon to delimiters.
* tests/hackage.scm (test-cabal-property-no-space): New variable.
("hackage->guix-package test properties without space"): New test.
2022-06-06 13:26:45 +02:00
Lars-Dominik Braun
0972feaff1
import: cabal: Allow curly brackets in more positions.
* guix/import/cabal.scm (is-layout-property): Do not expect end of line.
(lex-layout-property): Check for newline.
(lex-property): Stop reading on closing curly bracket.
* tests/hackage.scm (test-read-cabal-2): New variable.
("read-cabal test: if brackets on the same line"): New test.
2022-06-06 13:26:45 +02:00
Lars-Dominik Braun
2c5d18e421
import: cabal: Support elif statement.
Fixes <https://issues.guix.gnu.org/54752>.

* guix/import/cabal.scm (make-cabal-parser): Replace if-then-else grammar case with elif-else, modify if-then accordingly.
(is-elif): New procedure.
(lex-elif): Likewise.
(is-id): Add elif keyword.
(lex-word): Add test for elif.
* tests/hackage.scm (test-cabal-if): New variale.
(test-cabal-else): Likewise.
(test-cabal-elif): Likewise.
(test-cabal-elif-brackets): Likewise.
(match-ghc-elif): Likewise.
("hackage->guix-package test lonely if statement",
"hackage->guix-package test else statement",
"hackage->guix-package test elif statement",
"hackage->guix-package test elif statement with brackets"): New tests.
2022-06-06 13:26:09 +02:00
Tobias Geerinckx-Rice
22f56dda8e
import: minetest: Fix typo.
* guix/import/minetest.scm (important-dependencies): Fix ‘choosen’ typo.
2022-05-29 02:00:07 +02:00
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