Commit Graph

19 Commits

Author SHA1 Message Date
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
Ludovic Courtès 3a317f7476
Merge branch 'master' into core-updates-frozen 2021-11-17 23:43:14 +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
Marius Bakke b029be2ee0
Merge branch 'master' into core-updates-frozen
Conflicts:
	gnu/packages/bioinformatics.scm
	gnu/packages/cmake.scm
	gnu/packages/curl.scm
	gnu/packages/emacs-xyz.scm
	gnu/packages/gpodder.scm
	gnu/packages/music.scm
	gnu/packages/patches/glibc-bootstrap-system.patch
	gnu/packages/python-xyz.scm
	gnu/packages/shells.scm
	gnu/packages/statistics.scm
2021-07-29 22:34:57 +02:00
itd 51157d474f
import/print: package->code: Fix license object.
* guix/import/print.scm (package->code)<license->code>: Update generated
licence object to match record constructor.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-07-19 19:57:51 +02:00
Ludovic Courtès ff992fcfaf
import: print: Emit new-style package inputs when possible.
* guix/import/print.scm (redundant-input-labels?): New procedure.
(package->code)[package-lists->code]: Rename to...
[inputs->code]: ... this.  When 'redundant-input-labels?' returns true,
emit label-less inputs.  Adjust callers to new name.
* tests/print.scm (pkg-with-inputs): Adjust accordingly.
2021-07-11 00:49:16 +02:00
Ludovic Courtès 96aa98b6ca
import: print: Improve origin method name guesswork.
Fixes <https://bugs.gnu.org/47375>.
Reported by Léo Le Bouter <lle-bout@zaclys.net>.

* guix/import/print.scm (package->code): For METHOD, use 'variable-name'
preferably, and call 'procedure-name' as a last resort.
2021-03-26 00:04:04 +01:00
Ricardo Wurmus 649786f0cb
import/print: package->code: Fix branching.
* guix/import/print.scm (package->code)<license->code>: Branch on VAR, not on
the SYMBOL-APPEND return value.
2020-12-27 12:04:22 +01:00
Helio Machado a9105c2c4c
import: print: Fix deprecation warning for origin-sha256.
* guix/import/print.scm (source->code source version): Replace
'origin-sha256' by 'origin-hash' and handle non-SHA256 hashes.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-10-19 13:28:38 +02:00
Ricardo Wurmus 3c0422b9be
import/print: Don't factorize URI if there's no version match.
* guix/import/print.scm (package->code): If FACTORIZE-URI returns just the
unmodified string use that as the URI.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 3532fc39ff
import/utils: alist->package: Ignore known inputs.
* guix/import/utils.scm (alist->package): Accept optional list of known
inputs, which are excluded from the specification lookup.
* guix/import/print.scm (package->code)[package-lists->code]: Handle inputs
which are just symbols.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 86a3b540d0
import/print: package->code: Wrap S-expression in definition.
* guix/import/print.scm (package->code): Return a definition, not just a
package expression.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 6269dd567e
import/print: package->code: Wrap build system value in module reference.
* guix/import/print.scm (package->code): Return build system value with
corresponding module.
2020-04-16 23:41:52 +02:00
Ricardo Wurmus 1475d45112
import/print: Return license with prefix.
* guix/import/print.scm (license->code): Prepend license: prefix.
2020-04-16 23:41:49 +02:00
Ludovic Courtès c0a4db6697
import: print: Honor the outputs of inputs (!).
Fixes <http://bugs.gnu.org/35893>.
Reported by Jesse Gibbons <jgibbons2357@gmail.com>.

* guix/import/print.scm (package->code)[package-lists->code]: Preserve
OUT in the result.
* tests/print.scm (define-with-source): New macro.
(pkg): Use it.
(pkg-source): New variable.
(pkg-with-inputs, pkg-with-inputs-source): New variables.
("simple package"): Refer to 'pkg-source'.
("package with inputs"): New test.
2019-06-07 22:49:47 +02:00
Ricardo Wurmus 68a91a183b
import: Add package->code.
* guix/import/print.scm: New file.
* tests/print.scm: New file.
* Makefile.am (SCM_TESTS): Add new test file.
(MODULES): Add print.scm.
2017-09-28 13:10:10 +02:00