mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
guix build: Support '--with-source=PACKAGE@VERSION=URI'.
* guix/scripts/build.scm (numeric-extension?, tarball-base-name): New procedures, formerly in 'package-with-source'. (transform-package-source)[new-sources]: Look for '=' in URI. Each element of the list of now a (PKG VERSION SOURCE) tuple. Pass VERSION to 'package-with-source'. (package-with-source): Add 'version' parameter and honor it. * tests/scripts-build.scm ("options->transformation, with-source, PKG=URI") ("options->transformation, with-source, PKG@VER=URI"): New tests. * doc/guix.texi (Package Transformation Options): Document the new forms.
This commit is contained in:
parent
85f075a057
commit
3e30cdf1c3
3 changed files with 94 additions and 36 deletions
|
@ -96,6 +96,35 @@
|
|||
(string-contains (get-output-string port)
|
||||
"had no effect"))))))
|
||||
|
||||
(test-assert "options->transformation, with-source, PKG=URI"
|
||||
(let* ((p (dummy-package "foo"))
|
||||
(s (search-path %load-path "guix.scm"))
|
||||
(f (string-append "foo=" s))
|
||||
(t (options->transformation `((with-source . ,f)))))
|
||||
(with-store store
|
||||
(let ((new (t store p)))
|
||||
(and (not (eq? new p))
|
||||
(string=? (package-name new) (package-name p))
|
||||
(string=? (package-version new)
|
||||
(package-version p))
|
||||
(string=? (package-source new)
|
||||
(add-to-store store (basename s) #t
|
||||
"sha256" s)))))))
|
||||
|
||||
(test-assert "options->transformation, with-source, PKG@VER=URI"
|
||||
(let* ((p (dummy-package "foo"))
|
||||
(s (search-path %load-path "guix.scm"))
|
||||
(f (string-append "foo@42.0=" s))
|
||||
(t (options->transformation `((with-source . ,f)))))
|
||||
(with-store store
|
||||
(let ((new (t store p)))
|
||||
(and (not (eq? new p))
|
||||
(string=? (package-name new) (package-name p))
|
||||
(string=? (package-version new) "42.0")
|
||||
(string=? (package-source new)
|
||||
(add-to-store store (basename s) #t
|
||||
"sha256" s)))))))
|
||||
|
||||
(test-assert "options->transformation, with-input"
|
||||
(let* ((p (dummy-package "guix.scm"
|
||||
(inputs `(("foo" ,(specification->package "coreutils"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue