;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Julien Lepiller ;;; Copyright © 2023 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (test-composer) #:use-module (guix import composer) #:use-module (guix base32) #:use-module (gcrypt hash) #:use-module (guix tests http) #:use-module (guix grafts) #:use-module (srfi srfi-64) #:use-module (web client) #:use-module (ice-9 match)) ;; Globally disable grafts because they can trigger early builds. (%graft? #f) (define test-json "{ \"packages\": { \"foo/bar\": { \"0.1\": { \"name\": \"foo/bar\", \"description\": \"description\", \"keywords\": [\"testing\"], \"homepage\": \"http://example.com\", \"version\": \"0.1\", \"license\": [\"BSD-3-Clause\"], \"source\": { \"type\": \"url\", \"url\": \"http://example.com/Bar-0.1.tar.gz\" }, \"require\": {}, \"require-dev\": {\"phpunit/phpunit\": \"1.0.0\"} } } } }") (define test-source "foobar") (test-begin "composer") (test-assert "composer->guix-package" ;; Replace network resources with sample data. (with-http-server `((200 ,test-json) (200 ,test-source)) (parameterize ((%composer-base-url (%local-url)) (current-http-proxy (%local-url))) (match (composer->guix-package "foo/bar") (`(package (name "php-foo-bar") (version "0.1") (source (origin (method url-fetch) (uri "http://example.com/Bar-0.1.tar.gz") (sha256 (base32 ,(? string? hash))))) (build-system composer-build-system) (native-inputs (list php-phpunit-phpunit)) (synopsis "") (description "description") (home-page "http://example.com") (license license:bsd-3)) (string=? (bytevector->nix-base32-string (call-with-input-string test-source port-sha256)) hash)) (x (pk 'fail x #f)))))) (test-end "composer") on): Remove it. * gnu/bootloader.scm (warn-target-field-deprecation): Use define-with-syntax-properties. * gnu/system.scm (ensure-setuid-program-list): Ditto. Also rename the 'location' variable to 'properties'. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Josselin Poiret 2021-08-30bootloader: Report location of the deprecated 'target' field....This is a followup to 2ca982ff41270288913ad6b7d5d9e1cad87b06d9. * gnu/bootloader.scm (warn-target-field-deprecation): New macro. (<bootloader-configuration>)[target]: Add 'sanitize' property. (%warn-target-field-deprecation): New procedure. (bootloader-configuration-target): Define using 'define-deprecated'. (bootloader-configuration-targets): Use '%bootloader-configuration-target' rather than the deprecated one. Ludovic Courtès 2021-08-29gnu: bootloader: Support multiple targets....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. Maxim Cournoyer