summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* gexp: Leave grafting as is when lowering allowed/disallowed references.Ludovic Courtès2021-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/50676>. Reported by Mathieu Othacehe <othacehe@gnu.org>. Commit a779363b6aa581e88eda21f9f35530962d54ac25 was partially incorrect: references passed to #:allowed-references or #:references-graphs *can* be lowered as references to grafted elements. This is for example the case when doing: (computed-file "partition.img" exp #:options `(#:references-graphs ,inputs)) Here INPUTS must be lowered as a reference to suitably grafted elements. Failing to do that, the reference graph will not match the actual INPUTS. However, when building a package, those references must indeed refer only to ungrafted packages. This commit preserves that by having build systems pass #:graft? #f. * guix/gexp.scm (lower-reference-graphs, lower-references): Remove uses of 'without-grafting'. This reverts a779363b6aa581e88eda21f9f35530962d54ac25. * guix/build-system/cmake.scm (cmake-build, cmake-cross-build): Pass #:graft? #f. * guix/build-system/glib-or-gtk.scm (glib-or-gtk-build) (glib-or-gtk-cross-build): Likewise. * guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Likewise. * guix/build-system/meson.scm (meson-build, meson-cross-build): Likewise. * guix/build-system/trivial.scm (trivial-build, trivial-cross-build): Likewise. * tests/gexp.scm ("lower-object, computed-file + grafts"): New test. * tests/packages.scm ("trivial with #:allowed-references + grafts"): New test.
* tests: Add missing module import.Marius Bakke2021-09-17
| | | | | | This is a follow-up to commit 9bea983e4f5a1c07737336163bc6835f6c582a6e. * tests/builders.scm: Import (guix grafts).
* Merge branch 'master' into core-updates-frozenMarius Bakke2021-09-17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: gnu/packages/bioinformatics.scm gnu/packages/chez.scm gnu/packages/docbook.scm gnu/packages/ebook.scm gnu/packages/gnome.scm gnu/packages/linux.scm gnu/packages/networking.scm gnu/packages/python-web.scm gnu/packages/python-xyz.scm gnu/packages/tex.scm gnu/packages/version-control.scm gnu/packages/xml.scm guix/build-system/dune.scm guix/build-system/go.scm guix/build-system/linux-module.scm guix/packages.scm
| * store: 'map/accumulate-builds' processes the whole list in case of cutoff.Ludovic Courtès2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/50264>. Reported by Lars-Dominik Braun <lars@6xq.net>. This fixes a regression introduced in fa81971cbae85b39183ccf8f51e8d96ac88fb4ac 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.
| * import: cabal: Treat identifier names correctly.Xinglu Chen2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * packages: Add 'package-definition-location'.Ludovic Courtès2021-09-13
| | | | | | | | | | | | | | | | | | | | 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.
| * transformations: Git tags and 'git describe' style IDs are used as version.Marius Bakke2021-09-08
| | | | | | | | | | | | | | | | | | | | * 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.
* | tests: Adjust '--with-input' test.Ludovic Courtès2021-09-07
| | | | | | | | | | | | | | This is a followup to 09b002622e2113c2f14c11ccd43fa01fd343fb95, which changed the dependency of graphviz from guile@2.0 to guile@3.0. * tests/guix-build.sh: Adjust '--with-input' test.
* | tests: Disable grafts in 'tests/builders.scm'.Ludovic Courtès2021-09-07
| | | | | | | | | | | | | | | | This is required since the introduction of the OpenSSL graft in the parent commit so that calling 'package-derivation' in the Python tests would not trigger a build. * tests/builders.scm <top level>: Add '%graft?' call.
* | Merge branch 'master' into core-updates-frozenLudovic Courtès2021-09-07
|\|
| * import: go: Improve error handling.zimoun2021-09-01
| | | | | | | | | | | | | | | | | | | | * guix/import/go.scm (go-module->guix-package*): Handle errors, remove memoize. (go-module-recursive-import): Remove 'guard', add memoize. * guix/scripts/import/go.scm (guix-import-go): Adjust. * tests/go.scm: Adjust. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| * import: utils: Skip not found packages.Sarah Morgensen2021-09-01
| | | | | | | | | | | | | | | | * guix/import/utils.scm (recursive-import): Skip packages when the package returned by 'repo->guix-package' is false. * tests/import-utils.scm: New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| * Migrate to the new 'targets' field of bootloader-configuration.Maxim Cournoyer2021-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old 'target' field is deprecated; adjust the sources to use the new 'targets' one instead. * doc/guix-cookbook.texi<target>: Replace by 'targets'. * gnu/bootloader/grub.scm: Likewise. * gnu/installer/parted.scm: Likewise. * gnu/machine/digital-ocean.scm: Likewise. * gnu/system/examples/asus-c201.tmpl: Likewise * gnu/system/examples/bare-bones.tmpl: Likewise * gnu/system/examples/bare-hurd.tmpl: Likewise * gnu/system/examples/beaglebone-black.tmpl: Likewise * gnu/system/examples/desktop.tmpl: Likewise * gnu/system/examples/docker-image.tmpl: Likewise * gnu/system/examples/lightweight-desktop.tmpl: Likewise * gnu/system/examples/vm-image.tmpl: Likewise * gnu/system/examples/yggdrasil.tmpl: Likewise * gnu/system/hurd.scm: Likewise * gnu/system/images/hurd.scm: Likewise * gnu/system/images/novena.scm: Likewise * gnu/system/images/pine64.scm: Likewise * gnu/system/images/pinebook-pro.scm: Likewise * gnu/system/images/rock64.scm: Likewise * gnu/system/install.scm: Likewise * gnu/system/vm.scm: Likewise * gnu/tests.scm: Likewise * gnu/tests/ganeti.scm: Likewise * gnu/tests/install.scm: Likewise * gnu/tests/nfs.scm: Likewise * gnu/tests/telephony.scm: Likewise * tests/boot-parameters.scm: Likewise * tests/system.scm: Likewise
| * gnu: bootloader: Support multiple targets.Maxim Cournoyer2021-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/40997>. * gnu/bootloader.scm (<bootloader-configuration>): New 'targets' field. (%bootloader-configuration-target): New procedure. (bootloader-configuration-target): Add deprecation warning. (bootloader-configuration-targets): New procedure. * guix/scripts/system.scm (install): Access targets via bootloader-configuration-targets. (perform-action)[bootloader-target]: Remove unused argument and update doc. Access targets via bootloader-configuration-targets and fix indentation. (process-action): Access targets via bootloader-configuration-targets. Do not provide the unused BOOTLOADER-TARGET argument when applying `perform-action'. * guix/scripts/system/reconfigure.scm (install-bootloader-program): Rename DEVICE argument to DEVICES. Adjust doc and comment. Apply `installer' and `disk-installer' for every DEVICES. (install-bootloader): Access targets via bootloader-configuration-targets and rename variable from DEVICE to DEVICES. * gnu/tests/install.scm: Adjust accordingly. * tests/guix-system.sh: Likewise. * gnu/tests/reconfigure.scm (run-install-bootloader-test): Adjust the DEVICES argument so that it is a list. * doc/guix.texi: Update doc.
| * guix: opam: More flexibility in the importer.Alice BRENON2021-08-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/scripts/import/opam.scm: Pass all instances of --repo as a list to the importer. * guix/import/opam.scm (opam-fetch): Stop expecting "expanded" repositories and call get-opam-repository instead to keep values "symbolic" as long as possible and factorize. (get-opam-repository): Use the same repository source as CLI opam does (i.e. HTTP-served index.tar.gz instead of git repositories). (find-latest-version): Be more flexible on the repositories structure instead of expecting packages/PACKAGE-NAME/PACKAGE-NAME.VERSION/. * tests/opam.scm: Update the call to opam->guix-package since repo is now expected to be a list and remove the mocked get-opam-repository deprecated by the support for local folders by the actual implementation. * doc/guix.texi: Document the new semantics and valid arguments for the --repo option. Signed-off-by: Julien Lepiller <julien@lepiller.eu>
| * guix: Add ContentDB importer.Maxime Devos2021-08-20
| | | | | | | | | | | | | | | | | | | | | | * guix/import/contentdb.scm: New file. * guix/scripts/import/contentdb.scm: New file. * tests/contentdb.scm: New file. * Makefile.am (MODULES, SCM_TESTS): Register them. * po/guix/POTFILES.in: Likewise. * doc/guix.texi (Invoking guix import): Document it. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
| * records: Support field sanitizers.Ludovic Courtès2021-08-12
| | | | | | | | | | | | | | | | | | | | * guix/records.scm (make-syntactic-constructor): Add #:sanitizers. [field-sanitizer]: New procedure. [wrap-field-value]: Honor F's sanitizer. (define-record-type*)[field-sanitizer]: New procedure. Pass #:sanitizer to 'make-syntactic-constructor'. * tests/records.scm ("define-record-type* & sanitize") ("define-record-type* & sanitize & thunked"): New tests.
* | Merge branch 'master' into core-updates-frozenMarius Bakke2021-08-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: gnu/packages/algebra.scm gnu/packages/games.scm gnu/packages/golang.scm gnu/packages/kerberos.scm gnu/packages/mail.scm gnu/packages/python.scm gnu/packages/ruby.scm gnu/packages/scheme.scm gnu/packages/tex.scm gnu/packages/tls.scm gnu/packages/version-control.scm
| * transformations: 'with-patch' works on non-origin sources.Ludovic Courtès2021-08-11
| | | | | | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/49697>. Reported by Philippe Swartvagher <philippe.swartvagher@inria.fr>. * guix/transformations.scm (patched-source): New procedure. (transform-package-patches)[package-with-extra-patches]: Use it when (package-source p) is not an origin. * tests/transformations.scm ("options->transformation, with-commit + with-patch"): New test.
| * Reinstate "services: Add a service for Jami."Maxim Cournoyer2021-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4673f817938d9d2b1b40a072ab2e0c44a32ccc97, which reverted commit 69dcc24c9f0cdfea674eb690e7755d26a25ced2b with the fix detailed below. Thanks to Christopher Baines for reporting the failure and proposing a fix. * guix/self.scm (compiled-guix) [*system-test-modules*]: Add the test data files via the 'extra-files' argument. * gnu/local.mk (dist_patch_DATA): Move the tests/data/jami-dummy-account.dat file to... * gnu/local.mk (MODULES_NOT_COMPILED): ... here.
| * Revert "services: Add a service for Jami."Maxim Cournoyer2021-08-02
| | | | | | | | | | This reverts commit 69dcc24c9f0cdfea674eb690e7755d26a25ced2b. It broke 'guix pull'.
| * services: Add a service for Jami.Maxim Cournoyer2021-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnu/services/telephony.scm (string-or-computed-file?) (string-list?, account-fingerprint-list?): New procedures. (maybe-string-list, maybe-account-fingerprint-list) (maybe-boolean, maybe-string, jami-account-list): New configuration field types. (serialize-string-list, serialize-boolean, serialize-string) (jami-account, jami-account->alist, jami-configuration) (jami-account-list?, jami-account-list-maybe): New procedures. (%jami-accounts): New variable. (jami-configuration->command-line-arguments): New procedure. (jami-dbus-session-activation, jami-shepherd-services): New procedures. (jami-service-type): New variable. * gnu/build/jami-service.scm: New file. * gnu/tests/data/jami-dummy-account.dat: Likewise. * gnu/tests/telephony.scm: Likewise. * gnu/local.mk (GNU_SYSTEM_MODULES): Register them. * Makefile.am (SCM_TESTS): Register the test file. (dist_patch_DATA): Register the new data file. * doc/guix.texi (Telephony Services): Document it.
* | import: hackage: Emit new-style package inputs.Sarah Morgensen2021-07-20
| | | | | | | | | | | | | | | | | | | | | | | | * guix/import/hackage.scm (hackage-module->sexp)[dependencies] [native-dependencies]: Make into a list of symbols. [maybe-inputs]: Wrap INPUTS in 'list' instead of 'quasiquote'. * 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>
* | import: opam: Emit new-style package inputs.Sarah Morgensen2021-07-20
| | | | | | | | | | | | | | | | | | * guix/import/opam.scm (opam->guix-package): Wrap INPUTS and NATIVE-INPUTS in 'list' instead of 'quasiquote'. (dependency-list->inputs): Return a list of symbols. * tests/opam.scm ("opam->guix-package"): Adjust accordingly. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* | import: gem: Emit new-style package inputs.Sarah Morgensen2021-07-20
| | | | | | | | | | | | | | | | | | * guix/import/gem.scm (make-gem-sexp): Wrap inputs in 'list' instead of 'quasiquote'. * tests/gem.scm ("gem->guix-package") ("gem-recursive-import"): Adjust accordingly. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* | import: egg: Emit new-style package inputs.Sarah Morgensen2021-07-20
| | | | | | | | | | | | | | | | | | | | * guix/import/egg.scm (egg->guix-package): Generate dependency list from a list of symbols. [egg-parse-dependency]: Return a list of symbols. [maybe-inputs]: Wrap INPUTS in 'list' instead of 'quasiquote'. * tests/egg.scm (match-chicken-foo): Adjust accordingly. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* | Merge branch 'master' into core-updatesLudovic Courtès2021-07-18
|\|
| * pack: Streamline how files are included in tarballs.Maxim Cournoyer2021-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks to Guillem Jover <guillem@debian.org> on the OFTC's #debian-dpkg channel for helping with troubleshooting. Letting GNU Tar recursively walk the complete files hierarchy side-steps the risks associated with providing a list of file names: 1. Duplicated files in the archive (recorded as hard links by GNU Tar) 2. Missing parent directories. The above would cause dpkg to malfunction, for example by aborting early and skipping triggers when there were missing parent directories. * guix/scripts/pack.scm (self-contained-tarball/builder): Do not call POPULATE-SINGLE-PROFILE-DIRECTORY, which creates extraneous files such as /root. Instead, call POPULATE-STORE and INSTALL-DATABASE-AND-GC-ROOTS individually to more precisely generate the file system. Replace the list of files by the current directory, "." and streamline the way options are passed. * gnu/system/file-systems.scm (reduce-directories): Remove procedure. * tests/file-systems.scm ("reduce-directories"): Remove test.
| * pack: Allow embedding custom control files in deb packs.Maxim Cournoyer2021-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/scripts/pack.scm (self-contained-tarball/builder) [extra-options]: New argument. (self-contained-tarball, squashfs-image, docker-image) (debian-archive): Likewise. Remove two TODO comments. Document EXTRA-OPTIONS. Use the custom control files when provided. (%deb-format-options): New variable. (show-deb-format-options, show-deb-format-options/detailed): New procedures. (%options): Register new options. (show-help): Augment with new usage. (guix-pack): Validate and propagate new argument values. * doc/guix.texi (Invoking guix pack)[deb]: Document how to list advanced options. Add an example. * tests/pack.scm (deb archive...): Provide extra-options to the debian-archive procedure, and validate that the provided files are embedded in the pack.
| * import: go: Upgrade go.mod parser.Sarah Morgensen2021-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upgrade the go.mod parser to handle the full go.mod spec, and to gracefully handle unexpected/malformed syntax. Restructure parser usage, making the parse tree available for other uses. guix/import/go.scm (parse-go.mod): Parse using (ice-9 peg) instead of regex matching for more robustness. Return a list of directives. (go.mod-directives): New procedure. (go.mod-requirements): Likewise. (go-module->guix-package): Use it. (%go.mod-replace-directive-rx): Remove unused variable. tests/go.scm (testing-parse-mod): Adjust accordingly. (go.mod-requirements) (fixture-go-mod-unparseable) (fixture-go-mod-retract) (fixture-go-mod-strings): New variables. ("parse-go.mod: simple") ("parse-go.mod: comments and unparseable lines") ("parse-go.mod: retract") ("parse-go.mod: raw strings and quoted strings") ("parse-go.mod: complete"): New tests. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
| * tests/go: Remove unused variable.Maxim Cournoyer2021-07-17
| | | | | | | | | | * tests/go.scm: Delete extraneous newline. (fixture-latest-for-go-check): Remove variable.
| * lint: Check for leading whitespace in description.Brice Waegeneire2021-07-13
| | | | | | | | | | * guix/lint.scm (check-description-style): Check for leading whitespace. * tests/lint.scm: ("description: leading whitespace"): New test.
| * lint: Lint usages of 'wrap-program' without a "bash" input.Maxime Devos2021-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using 'wrap-program', "bash" (or "bash-minimal") should be in inputs. Otherwise, when cross-compiling, 'wrap-program' will use a native bash instead of the cross bash and the 'patch-shebangs' won't be able to correct this. Tobias Geerinckx-Rice is added to the copyright lines because a part of the "straw-viewer" package definition is included. This linter detects 365 problematic package definitions at time of writing. * guix/lint.scm (report-wrap-program-error): New procedure. (check-wrapper-inputs): New linter. (%local-checkers)[wrapper-inputs]: Add the new linter. ("explicit #:sh argument to 'wrap-program' is acceptable") ("'check-wrapper-inputs' detects 'wrap-program' without \"bash\" in inputs") ("'check-wrapper-inputs' detects 'wrap-qt-program' without \"bash\" in inputs") ("\"bash\" in 'inputs' satisfies 'check-wrapper-inputs'") ("\"bash-minimal\" in 'inputs' satisfies 'check-wrapper-inputs'") ("'cut' doesn't hide bad usages of 'wrap-program'") ("bogus phase specifications don't crash the linter"): New tests. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
| * lint: Verify if #:tests? is respected in the 'check' phase.Maxime Devos2021-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There have been a few patches to the mailing list lately not respecting this, and this linter detects 630 package definitions that could be modified to support the --without-tests package transformation. * guix/lint.scm (check-optional-tests): New linter. (%local-checkers)[optional-tests]: Add it. * tests/lint.scm (package-with-phase-changes): New procedure. ("optional-tests: no check phase") ("optional-tests: check hase respects #:tests?") ("optional-tests: check phase ignores #:tests?") ("optional-tests: do not crash when #:phases is invalid") ("optional-tests: allow G-exps (no warning)") ("optional-tests: allow G-exps (warning)") ("optional-tests: complicated 'check' phase") ("optional-tests: 'check' phase is not first phase"): New tests. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
| * guix: gexp: Define gexp->approximate-sexp.Maxime Devos2021-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | It will be used in the 'optional-tests' linter. * guix/gexp.scm (gexp->approximate-sexp): New procedure. * tests/gexp.scm ("no references", "unquoted gexp", "unquoted gexp (native)") ("spliced gexp", "unspliced gexp, approximated") ("unquoted gexp, approximated"): Test it. * doc/gexp.scm ("G-Expressions"): Document it. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
| * pack: Add support for the deb format.Maxim Cournoyer2021-06-29
| | | | | | | | | | | | | | | | | | | | | | * .dir-locals.el (scheme-mode)[gexp->derivation]: Define indentation rule. * guix/scripts/pack.scm (debian-archive): New procedure. (%formats): Register the new deb format. (show-formats): Add it to the usage string. * tests/pack.scm (%ar-bootstrap): New variable. (deb archive with symlinks): New test. * doc/guix.texi (Invoking guix pack): Document it. * NEWS: Add news entry.
| * tests: pack: Fix compressor extension.Maxim Cournoyer2021-06-29
| | | | | | | | | | * tests/pack.scm (%gzip-compressor): Add the missing leading period to the gzip compressor file extension.
| * pack: Prevent duplicate files in tar archives.Maxim Cournoyer2021-06-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Tar translate duplicate files in the archive into hard links. These can cause problems, as not every tool support them; for example dpkg doesn't. * gnu/system/file-systems.scm (reduce-directories): New procedure. (file-prefix?): Lift the restriction on file prefix. The procedure can be useful for comparing relative file names. Adjust doc. (file-name-depth): New procedure, extracted from ... (btrfs-store-subvolume-file-name): ... here. * guix/scripts/pack.scm (self-contained-tarball/builder): Use reduce-directories. * tests/file-systems.scm ("reduce-directories"): New test.
| * services: configuration: Allow specifying prefix for serializer names.Xinglu Chen2021-06-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes two configurations might have the same types for their field values, but the values might be serialized in two completely different ways (e.g. because the two programs have different configuration languages). An example of this would be the ‘serialize-boolean’ procedure in (gnu services mail) and (gnu services getmail). They both serialize a boolean value, but because the Dovecot’s configuration language has a different syntax to the configuration language for Getmail, two different procedures have to be defined. One way to workaround this would be to specify custom serializers for many fields in order to separate the serialization of the values that have the same type but serialize in different ways. This could get very tedious, especially if there are many configurations in the same module. Another way would be to move one of the configurations to its own module, like what was done with (gnu services getmail). However, this would mean that there would be multiple modules containing configurations for related programs, e.g. we have (gnu services mail) and (gnu services getmail), it doesn’t make much sense to keep the Getmail configuration in its own module. This patch will allow one to write something like this: (define-configuration foo-configuration (bar (string "bob") "Option bar.") (prefix bar-)) and the value of the ‘bar’ field would be serialized using a procedure named ‘bar-serialize-string’ instead of just ‘serialize-string’. * gnu/services/configuration.scm (define-maybe-helper): Accept ‘prefix’ argument for using serializer with custom prefix. (define-maybe): Pattern match on ‘prefix’ literal. (define-configuration-helper): Accept ‘prefix’ argument for using serializer with custom prefix. (define-configuration): Pattern match on ‘prefix’ literal. * tests/services/configuration.scm ("serialize-configuration with prefix"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| * import: hackage: Support "common" field and importsPhilip Munksgaard2021-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/48701>. * guix/import/cabal.scm (make-cabal-parser): Modify. (is-common): New variable. (lex-common): New procedure. (is-id): Modify. (eval-cabal): Modify. * tests/hackage.scm ("hackage->guix-package test cabal import") New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* | packages: Define this-package-input and this-package-native-input.Maxime Devos2021-07-14
| | | | | | | | | | | | | | | | | | | | | | | | | | These macros are intended to be used in build phases. More precisely, (assoc-ref %build-inputs "input") can be replaced by #$(this-package-input "input") or #+(this-package-native-input "native-input") as appropriate. * guix/packages.scm (package-input, package-native-input): New (unexported) procedures. (this-package-input, this-package-native-input): New macros. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* | utils: Define a target-x86-32? and target-x86-64? predicate.Maxime Devos2021-07-14
| | | | | | | | | | | | | | * guix/utils.scm (target-x86-32?, target-x86-64?): New predicates. * tests/utils.scm ("target-x86-32?", "target-x86-64?"): New tests. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* | utils: Define 'target-linux?' predicate.Maxime Devos2021-07-14
| | | | | | | | | | | | | | | | | | * guix/utils.scm (target-linux?): New predicate. * tests/utils.scm ("target-linux?"): Test it. ("target-mingw?"): Also test ‘target-mingw?’. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* | import: print: Emit new-style package inputs when possible.Ludovic Courtès2021-07-11
| | | | | | | | | | | | | | | | * 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.
* | import: cran: Emit new-style package inputs.Ludovic Courtès2021-07-11
| | | | | | | | | | | | | | * guix/import/cran.scm (format-inputs): Emit symbols or 'specification->package' calls. (maybe-inputs): Wrap in 'list' instead of 'quasiquote'. * tests/cran.scm ("description->package"): Adjust accordingly.
* | import: pypi: Emit new-style package inputs.Ludovic Courtès2021-07-11
| | | | | | | | | | | | | | | | * guix/import/pypi.scm (maybe-inputs): Wrap PACKAGE-INPUTS in 'list' instead of 'quasiquote'. (compute-inputs)[requirement->package-name/sort]: Return a list of symbols. * tests/pypi.scm ("pypi->guix-package, no wheel") ("pypi->guix-package, wheels"): Adjust accordingly.
* | Add 'guix style'.Ludovic Courtès2021-07-11
| | | | | | | | | | | | | | | | | | * guix/scripts/style.scm, tests/style.scm: New files. * Makefile.am (MODULES, SCM_TESTS): Add them. * po/guix/POTFILES.in: Add 'guix/scripts/style.scm'. * doc/guix.texi (Invoking guix style): New node. (package Reference): Reference it. (Invoking guix lint): Likewise.
* | lint: Add 'input-labels' checker.Ludovic Courtès2021-07-11
| | | | | | | | | | | | | | | | * guix/lint.scm (check-input-labels): New procedure. (%local-checkers): Add 'input-labels' checker. * tests/lint.scm ("input labels: no warnings") ("input labels: one warning"): New tests. * doc/guix.texi (Invoking guix lint): Mention it.
* | packages: Allow inputs to be plain package lists.Ludovic Courtès2021-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/packages.scm (add-input-label, sanitize-inputs): New procedures. (<package>)[inputs, propagated-inputs, native-inputs]: Add 'sanitize' property. * doc/guix.texi (Defining Packages, package Reference): (Defining Package Variants): Adjust examples accordingly. * tests/packages.scm ("transaction-upgrade-entry, zero upgrades, propagated inputs") ("transaction-upgrade-entry, grafts") ("package-transitive-inputs") ("package-transitive-supported-systems") ("package-closure") ("supported-package?") ("package-derivation, inputs deduplicated") ("package-transitive-native-search-paths") ("package-grafts, indirect grafts") ("package-grafts, indirect grafts, propagated inputs") ("package-grafts, same replacement twice") ("package-grafts, dependency on several outputs") ("replacement also grafted") ("package->bag, sensitivity to %current-target-system") ("package->bag, propagated inputs") ("package->bag, sensitivity to %current-system") ("package-input-rewriting/spec, identity") ("package-input-rewriting, identity"): Use the label-less input style.
* | records: Support field sanitizers.Ludovic Courtès2021-07-11
| | | | | | | | | | | | | | | | | | | | * guix/records.scm (make-syntactic-constructor): Add #:sanitizers. [field-sanitizer]: New procedure. [wrap-field-value]: Honor F's sanitizer. (define-record-type*)[field-sanitizer]: New procedure. Pass #:sanitizer to 'make-syntactic-constructor'. * tests/records.scm ("define-record-type* & sanitize") ("define-record-type* & sanitize & thunked"): New tests.