Commit Graph

694 Commits

Author SHA1 Message Date
Ricardo Wurmus
3e0a1469b8
import/cran: Add one more invalid package.
* guix/import/cran.scm (invalid-packages): Add "use_c17".

Change-Id: Ie3b6455d4eff97811057cd82dca460367a4583e5
2024-03-06 09:42:04 +01:00
Herman Rimm
b386c11e78
import: Do not return package name with json importer.
* guix/import/json.scm (json->code): Do not return package names after
package expressions.
* doc/package-hello.json: Fix comma errors and use valid greeter URL.

Change-Id: Id71924e72f690a9bda5fbfdb65a443029adfd158
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-02-23 19:02:55 +01:00
Ricardo Wurmus
7a01cc001d
import/cran: Use downstream name when using specifications.
Reported by Alexander Blume at
<https://github.com/BIMSBbioinfo/guix.install/issues/4>.

* guix/import/cran.scm (format-inputs): Use UPSTREAM-INPUT-DOWNSTREAM-NAME
when %INPUT-STYLE is set to 'SPECIFICATION.

Change-Id: I2f0963af197896aafd613b253d8712e41a716e52
2024-02-20 10:32:24 +01:00
Ricardo Wurmus
389c6082a4
import/cran: Set HOME when ExperimentHub is among the inputs.
* guix/import/cran.scm (phases-for-inputs): Add 'set-HOME phase when
ExperimentHub is among inputs.

Change-Id: Ie3a2443934704eed8694a76a651b806209722421
2024-01-22 13:54:44 +01:00
Ricardo Wurmus
29353820f2
import/cran: Also update annotation and experiment packages.
* guix/import/cran.scm (latest-bioconductor-release): Determine package type
and pass it to LATEST-BIOCONDUCTOR-PACKAGE-VERSION and BIOCONDUCTOR-URI.
(%bioconductor-updater): Compose all bioconductor predicates.

Change-Id: Icef3ae05e28ed0f2796d9abf90e51821d2dfcc4c
2024-01-22 13:54:44 +01:00
Ricardo Wurmus
2d83a25450
import/cran: Generate rudimentary ARGUMENTS field.
* guix/import/cran.scm (phases-for-inputs, maybe-arguments): New procedures.
(description->package): Splice in result of MAYBE-ARGUMENTS.

Change-Id: I578e1903f37c91bf865f0be49b04187ec372ed05
2024-01-21 11:08:13 +01:00
Ricardo Wurmus
d7baeddebe
import/cran: Add transformation for "packaging".
* guix/import/cran.scm (transform-sysname): Add case for "python-packaging".

Change-Id: I0d125fb3858c009a8527d60f56754b9b9c90b409
2024-01-18 16:01:54 +01:00
Ricardo Wurmus
b94047cf81
import/cran: Accept optional alternative download procedure.
This is useful for cached mass imports.

* guix/import/cran.scm (fetch-description-from-tarball): Accept optional
download keyword.
(fetch-description): Accept optional replacement-download argument.

Change-Id: Ic917074656ac34a24c8e7eea3d3e0528fc5180b3
2024-01-17 22:59:11 +01:00
Ricardo Wurmus
01bf69177d
import/cran: Add more invalid package names and translations.
These were encountered in a mass import of Bioconductor packages.

* guix/import/cran.scm (invalid-packages): Add "rtools".
(transform-sysname): Add aliases for Python and bioinformatics packages.

Change-Id: I97e13cee10c2ee85d4b9296d91afccbdbcec4946
2024-01-16 22:36:39 +01:00
Ricardo Wurmus
171ac4fa4f
import/cran: Add more invalid package names and translations.
* guix/import/cran.scm (invalid-packages): Add "build-essential".
(transform-sysname): Add aliases for openssl, libxml2, and zlib.

Change-Id: Ia142ebc388dbcd47caf3b2c5165bc21227bc1832
2024-01-16 19:40:50 +01:00
Efraim Flashner
8520f00d69
import: crate: Simplify find-crate-version.
* guix/import/crate.scm (find-crate-version): Reuse
nonyanked-crate-versions, max-crate-version-of-semver.

Change-Id: I976a3b5a397f0d6a7d723804a98356544bfc7da3
2024-01-16 14:24:10 +02:00
Efraim Flashner
5ce1512b0f
import: crate: Update to latest semver version.
* guix/import/crate.scm (min-element, max-crate-version-of-semver,
nonyanked-crate-versions): New procedures.
(import-release)[version]: Update to the requested version or the newest
semver-compatible version.

Co-authored by David Elsing <david.elsing@posteo.net>
Change-Id: I72b081147c4eb9faf482f159b7145aaaf9f91f29
2024-01-16 14:24:10 +02:00
David Elsing
b26926189e
guix: import: Optionally import necessary yanked crates.
* doc/guix.texi (Invoking guix import): Mention '--allow-yanked'.
* guix/import/crate.scm (make-crate-sexp): Add yanked? argument. For
yanked packages, use the full version suffixed by "-yanked" for
generated variable names and add a comment and package property.
(crate->guix-package): Add allow-yanked? argument and if it is set to #t,
allow importing yanked crates if no other version matching the
requirements exists.
[find-package-version]: Packages previously marked as yanked are only
included if allow-yanked? is #t and then take the lowest priority.
[find-crate-version]: If allow-yanked? is #t, also consider yanked
versions with the lowest priority.
[dependency-name+version]: Rename to ...
[dependency-name+version+yanked] ...this. Honor allow-yanked? and choose
between an existing package and an upstream package.  Exit with an error
message if no version fulfilling the requirement is found.
[version*]: Exit with an error message if the crate version is not found.
(cargo-recursive-import): Add allow-yanked? argument.
* guix/read-print.scm: Export <comment>.
* guix/scripts/import/crate.scm: Add "--allow-yanked".
* tests/crate.scm: Add test 'crate-recursive-import-only-yanked-available'.
[sort-map-dependencies]: Adjust accordingly.
[remove-yanked-info]: New variable.
Adjust test 'crate-recursive-import-honors-existing-packages'.
(test-bar-dependencies): Add yanked dev-dependencies.
(test-leaf-bob-crate): Add yanked versions.
(rust-leaf-bob-3.0.2-yanked): New variable.

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Change-Id: I175d89b39774e6b57dcd1f05bf68718d23866bb7
2024-01-09 09:38:38 +02:00
David Elsing
9f44ff2bb4
import: crate: Optionally import dev-dependencies recursively.
If --recursive-dev-dependencies is specified, development dependencies
are also included for all recursively imported packages.

* doc/guix.texi (Invoking guix import): Mention --recursive-dev-dependencies.
* guix/import/crate.scm (crate-recursive-import): Add
recursive-dev-dependencies? argument.
* guix/scripts/import/crate.scm (show-help, guix-import-crate): Add
"--recursive-dev-dependencies".
* tests/crate.scm: Test both #f and #t for #:recursive-dev-dependencies?
in the 'cargo-recursive-import' test.
(test-root-dependencies): Add intermediate-c as dev-dependency.
(test-intermediate-c-crate, test-intermediate-c-dependencies): New
variables.

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Change-Id: Iae89794681155d77f128733120e60f03bc297717
2024-01-09 09:38:38 +02:00
David Elsing
4b0aa65c0a
gnu: import: Fix memoization in crate-recursive-import.
* guix/import/crate.scm (crate-recursive-import): Apply memoize outside the
lambda passed to recursive-import in order to actually use the memoization.

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2024-01-09 09:38:38 +02:00
Ricardo Wurmus
513994aead
import/cran: Restore format-inputs.
This fixes a regression introduced in commit
e6223017d9 causing the selected input style to
be ignored.

* guix/import/cran.scm (format-inputs): New procedure.
(maybe-inputs): Use it.

Change-Id: I0d36f972fcb9888ed2be4ec9360bbcab13c25c5d
2024-01-01 14:35:15 +01:00
Ricardo Wurmus
31ccfe9c91
import/cran: Add invalid package.
* guix/import/cran.scm (invalid-packages): Add libR.

Change-Id: I1e06b44785051dfc4fb85ba06062aa8c8e003495
2024-01-01 14:35:13 +01:00
Ricardo Wurmus
ee93015b54
import/cran: Export a few more variables and procedures.
This allows users of this module to provide e.g. caching alternatives to the
download and fetch procedures.

* guix/import/cran.scm (%bioconductor-version, download, fetch-description):
Make these variables public.

Change-Id: I9ce14db9be9b8b3314b06fa9eb50a4e24c5dd718
2023-12-19 14:12:59 +01:00
Nicolas Graves
b7e3945283
guix: import: Add composer importer.
* guix/import/composer.scm: New file.
* guix/scripts/import/composer.scm: New file.
* guix/tests/composer.scm: New file.
* Makefile.am: Add them.
* guix/scripts/import.scm: Add composer importer.
* doc/guix.texi (Invoking guix import): Mention it.

Change-Id: I44a89b8cc80ef5b4a3cd15e8fbba4a18c1cea0b1

Co-authored-by: Julien Lepiller <julien@lepiller.eu>
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-12-18 23:16:28 +01:00
Efraim Flashner
6aade039e1
guix: import: Report go version for go importer.
* guix/import/go.scm (go-package, go.mod-go-version): New procedures.
(go-module->guix-package): Add the #:go keyword in the generated package
definition if the required go is newer than the default go.
* tests/go.scm (mock-http-get): Use gexps for package arguments.

Change-Id: I8d005740a442330ac307a40a53764c803ceffc4f
2023-12-16 18:05:58 +02:00
Efraim Flashner
e35dd13d8a
guix: import: Don't include indirect dependencies in go.
* guix/import/go.scm (parse-go.mod)[define-peg-patern require]: Adjust
the peg pattern to reject lines with the 'indirect' comment in them.

Change-Id: I9618bbaa1cb8c6549ced875e3c8d32afc72c3b9b
2023-12-16 18:05:58 +02:00
Saku Laesvuori
ab8612d99e
guix: import: Fix parsing Cabal files that import many stanzas
* guix/import/cabal.scm (eval-cabal)[eval]: Split imports to a
normalized list before mapping over it.
* tests/hackage.scm: Test it.

Change-Id: I39ece019251b6a23a937c8562d2d4a545a6bc7df
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2023-12-03 16:15:29 +01:00
Saku Laesvuori
5bd00bb542
guix: import: Parse cabal layout blocks correctly
Cabal consideres lines to be part of a layout block if they are indented
at least one space more than the field line the block belongs to.
Previously Guix considered lines to be a part of the block if they were
indented at least as much as the first line in it.

This also makes a workaround that enabled if statements to have multiple
elses redundant and removes it.

Fixes: https://issues.guix.gnu.org/35743

* guix/import/cabal.scm (current-indentation*): Renamed from
current-indentation.
(previous-indentation, current-indentation): New variables.
(make-cabal-parser): Remove outdated comment.
[open]: Use previous-indentation + 1 instead of
current-indentation.
[elif-else]: Split to elif and else to allow only one ELSE in an if
statement.
(read-cabal)[parameterize]: Use current-indentation* and previous-indentation.
* tests/hackage.scm (hackage->guix-package test mixed layout): Expect to
  pass.

Change-Id: I3a1495b1588a022fabbfe8dad9f3231e578af4f3
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2023-12-03 09:11:29 +01:00
Saku Laesvuori
acef524961
guix: import: stackage: Fix crash on recursive import
* guix/import/stackage.scm (lts-package-version): Call
  stackage-package-version only when the package is found.

Change-Id: Ic8d7c1b7a42a9c1a6cbba567e148706507a53ee3
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2023-12-03 09:11:29 +01:00
Saku Laesvuori
160385c013
guix: import: hackage: Fix crash on recursive import
Fixes: https://issues.guix.gnu.org/64734

* guix/import/hackage.scm (hackage-module->sexp): Return package names
  instead of <upstream-input> records.

Change-Id: Id428a8b903b4b59d44205ca366324a0a69a4e05b
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2023-12-03 09:11:29 +01:00
Ricardo Wurmus
7a14f9365a
guix: Upgrade to Bioconductor 3.18.
* guix/build-system/r.scm (bioconductor-uri): Bump Bioconductor version to
3.18.
* guix/import/cran.scm (%bioconductor-version): Same.

Change-Id: Ic3fc2e6ab6b5f6f6e55662f81baee67391158c5b
2023-11-03 22:49:10 +01:00
Efraim Flashner
742554f9b9
guix: import: Don't import yanked rust crates.
* guix/import/crate.scm (<crate-version>): Add yanked? field.
(crate->guix-package)[find-crate-version]: Remove versions which have
been yanked.
* tests/crate.scm: Adjust tests for new yanked? field.
2023-10-22 16:46:39 +03:00
Josselin Poiret
dcc5c34504
guix: import: opam: Handle list of licenses.
Fixes <https://issues.guix.gnu.org/issue/66461>.
Reported by Simon Tournier <zimon.toutoune@gmail.com>.

* guix/import/opam.scm (opam->guix-package): Handle lists of licenses.

Signed-off-by: Simon Tournier <zimon.toutoune@gmail.com>
2023-10-17 14:52:06 +02:00
Ricardo Wurmus
c8a642de9a
import-utils: Do not include punctuation when wrapping in @code{}.
* guix/import/utils.scm (beautify-description): Exclude punctuation.
* tests/import-utils.scm: Add new test.
2023-08-28 19:08:38 +02:00
Nicolas Goaziou
1804a99d05
guix: import: texlive importer handles Ruby linked scripts.
* guix/import/texlive.scm (linked-scripts): Also check for scripts with ".rb" extension.
(tlpdb->package): Add proper RUBY input for Ruby linked scripts.
2023-08-16 11:47:09 +02:00
Nicolas Goaziou
1619f2c18c
guix: import: Do not prefix `fsf-free' with "license:" in texlive.
* guix/import/texlive.scm (tlpdb->package): For consistency with other
imported licenses, `fsf-free' need not be prefixed with "license:".
2023-08-14 13:44:06 +02:00
Nicolas Goaziou
6f03e4be85
guix: import: Handle X11 license in texlive importer.
* guix/import/texlive.scm (string->license): Recognize X11 license.
2023-08-14 13:42:52 +02:00
walky_talky
3f092e4d76
licenses: Add Arphic-1999 (Aprhic Public License).
* guix/licenses.scm (arphic-1999): New variable.
* guix/import/utils.scm (%spdx-license-identifiers): Add Arphic-1999.

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2023-08-01 19:40:19 +08:00
Ricardo Wurmus
b9bd1bcce9
import/utils: beautify-description: Wrap class names in @code{...}.
* guix/import/utils.scm (beautify-description): Add procedure to wrap words in
@code{...} markup.
* tests/import-utils.scm: Add two tests.
2023-07-19 15:53:28 +02:00
Ricardo Wurmus
45bf1a9a6b
import/utils: Add more initial words to beautify-description.
* guix/import/utils.scm (beautify-description): Add "Classes" and "Tools" to
initial words to be prefixed with "This package provides".
2023-07-19 15:29:22 +02:00
Nicolas Goaziou
f832746ab6
guix: Fix license translation in texlive importer.
* guix/import/texlive.scm (string->license): Properly translate "artistic2"
into `artistic2.0'.
2023-07-18 18:19:02 +02:00
Nicolas Goaziou
1dc7971429
guix: texlive importer handles scripts with ".texlua" extension.
* guix/import/texlive.scm (linked-scripts): Also offer to link scripts with
a ".texlua" extension.
2023-07-18 18:18:24 +02:00
Nicolas Goaziou
985cf777b9
guix: texlive import ignores TeXworks.
* guix/import/texlive.scm (translate-depends): Ignore TeXworks files from TeX
Live, since they are Windows-only.
2023-07-18 18:18:24 +02:00
Nicolas Goaziou
b5d9ae22f5
guix: texlive importer ignores Asymptote package.
Asymptote is provided in `asymptote' Guix package.  OTOH, asy executable is
not built from TeX Live tree.  Therefore, Asymptote package from TeX Live can be ignored.

* guix/import/texlive.scm (translate-depends): Ignore Asymptote package.
2023-07-18 18:18:24 +02:00
Nicolas Goaziou
75677daa83
guix: import: texlive importer handles more licenses.
* guix/import/texlive.scm (string->license): Handle CC0 and ISC licenses.
2023-07-18 18:16:55 +02:00
Nicolas Goaziou
026ed35ddb
guix: import: Handle texlua and TCL scripts.
* guix/import/texlive.scm (linked-scripts): Also generate scripts from files
with ".tlu" and ".tcl" extensions.
(tlpdb->package): Add appropriate inputs when providing a TCL script.
2023-07-18 18:16:53 +02:00
Nicolas Goaziou
2e189e8863
guix: texlive importer: Do not pull all "scripts/context/" files.
* guix/import/texlive.scm (texlive-generic-locations): Add "scripts/context/"
since this location is split across multiple packages.
* guix/import/texlive.scm (files->locations): Only single out files from
generic locations, not their sub-directories.  E.g., generic location
"scripts/context/lua/" should not fetch "scripts/context/lua/third/" files.
2023-07-18 18:16:45 +02:00
Nicolas Goaziou
944ace7194
guix: Fix sub-directories in texlive importer locations.
* guix/import/texlive.scm (files->locations): When removing a sub-directory,
make sure to actually remove the sub-directory and not the parent.
2023-07-18 18:16:43 +02:00
Nicolas Goaziou
4d171bf03f
guix: texlive importer ignores "-dev" packages in propagated inputs.
* guix/import/texlive.scm (translate-depends): Skip "-dev" packages.
2023-07-18 18:15:54 +02:00
Nicolas Goaziou
f3cdb6e203
guix: texlive importer allows meta-packages to build TeX formats.
* guix/import/texlive.scm (tlpdb->package): A package with no locations can
still build TeX format files, and therefore may use TEXLIVE-BUILD-SYSTEM.
2023-07-18 18:15:54 +02:00
Nicolas Goaziou
aea0d94bc1
guix: Handle asl2.0 license in texlive importer.
* guix/import/texlive.scm (string->license): Convert "apache2" to ASL2.0.
2023-07-18 18:15:50 +02:00
Nicolas Goaziou
b72c282d53
guix: Make "gfsl" an alias for gfl1.0 license in texlive importer.
* guix/import/texlive.scm (string->license): Make "gfsl" and alias for GFL1.0.
2023-07-18 18:15:46 +02:00
Nicolas Goaziou
9fadbf759c
gnu: texlive-bin: Do not install all linked scripts.
* gnu/packages/tex.scm (texlive-scripts): Include only core scripts along with
their man pages and their dependencies.  Also patch them for use in Guix.
(texlive-bin): Simplify package.
[inputs]: Remove "texlive-extra-src" and "texlive-scripts" inputs.  Remove
labels from other inputs.
[propagated-inputs]: Add TEXLIVE-SCRIPTS.
[arguments]: Use G-expressions.
<#:configure-flags>: Add "--disable-linked-scripts".
<#:phases>: Remove phases relative to scripts.
* guix/profiles.scm (texlive-font-maps): Fetch executables from both
TEXLIVE-SCRIPTS and TEXLIVE-BIN.
* guix/import/texlive.scm (tlpdb-file): Grab file from TEXLIVE-SCRIPTS instead
of TEXLIVE-BIN.
2023-07-18 18:15:05 +02:00
Nicolas Goaziou
ec97cf1569
guix: Let texlive importer handle linked scripts.
* guix/import/texlive.scm (tlpdb): Also retrieve so-called binfiles.
(formats):
(linked-scripts): New functions.
(tlpdb->package): Use new functions to set #:LINK-SCRIPTS argument and
possibly INPUTS.
* tests/texlive.scm (%fake-tlpdb): Add test data.
("texlive->guix-package, single script, no extension"):
("texlive->guix-package, multiple scripts, with extensions"):
("texlive->guix-package, script with associated input"):  New tests.
2023-07-18 18:15:05 +02:00
Nicolas Goaziou
ecc1c3af11
guix: texlive importer: Set #:texlive-latex-bin? when appropriate.
* guix/import/texlive.scm (latex-bin-dependency-tree): New function.
(tlpdb->package): Set #:TEXLIVE-LATEX-BIN? when appropriate.
* tests/texlive.scm ("texlive->guix-package, lonely `hyphen-base' dependency
and ARCH"): Update test.
2023-07-18 18:15:03 +02:00