mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
packages: Allow inputs to be plain package lists.
* 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.
This commit is contained in:
parent
8be1632199
commit
8524349f78
3 changed files with 108 additions and 61 deletions
|
@ -6476,7 +6476,7 @@ package looks like this:
|
||||||
"0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"))))
|
"0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"))))
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(arguments '(#:configure-flags '("--enable-silent-rules")))
|
(arguments '(#:configure-flags '("--enable-silent-rules")))
|
||||||
(inputs `(("gawk" ,gawk)))
|
(inputs (list gawk))
|
||||||
(synopsis "Hello, GNU world: An example GNU package")
|
(synopsis "Hello, GNU world: An example GNU package")
|
||||||
(description "Guess what GNU Hello prints!")
|
(description "Guess what GNU Hello prints!")
|
||||||
(home-page "https://www.gnu.org/software/hello/")
|
(home-page "https://www.gnu.org/software/hello/")
|
||||||
|
@ -6564,8 +6564,8 @@ Reference Manual}).
|
||||||
|
|
||||||
@item
|
@item
|
||||||
The @code{inputs} field specifies inputs to the build process---i.e.,
|
The @code{inputs} field specifies inputs to the build process---i.e.,
|
||||||
build-time or run-time dependencies of the package. Here, we define an
|
build-time or run-time dependencies of the package. Here, we add
|
||||||
input called @code{"gawk"} whose value is that of the @code{gawk}
|
an input, a reference to the @code{gawk}
|
||||||
variable; @code{gawk} is itself bound to a @code{<package>} object.
|
variable; @code{gawk} is itself bound to a @code{<package>} object.
|
||||||
|
|
||||||
@cindex backquote (quasiquote)
|
@cindex backquote (quasiquote)
|
||||||
|
@ -6690,20 +6690,41 @@ list, typically containing sequential keyword-value pairs.
|
||||||
@itemx @code{native-inputs} (default: @code{'()})
|
@itemx @code{native-inputs} (default: @code{'()})
|
||||||
@itemx @code{propagated-inputs} (default: @code{'()})
|
@itemx @code{propagated-inputs} (default: @code{'()})
|
||||||
@cindex inputs, of packages
|
@cindex inputs, of packages
|
||||||
These fields list dependencies of the package. Each one is a list of
|
These fields list dependencies of the package. Each element of these
|
||||||
tuples, where each tuple has a label for the input (a string) as its
|
lists is either a package, origin, or other ``file-like object''
|
||||||
first element, a package, origin, or derivation as its second element,
|
(@pxref{G-Expressions}); to specify the output of that file-like object
|
||||||
and optionally the name of the output thereof that should be used, which
|
that should be used, pass a two-element list where the second element is
|
||||||
defaults to @code{"out"} (@pxref{Packages with Multiple Outputs}, for
|
the output (@pxref{Packages with Multiple Outputs}, for more on package
|
||||||
more on package outputs). For example, the list below specifies three
|
outputs). For example, the list below specifies three inputs:
|
||||||
inputs:
|
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
|
(list libffi libunistring
|
||||||
|
`(,glib "bin")) ;the "bin" output of GLib
|
||||||
|
@end lisp
|
||||||
|
|
||||||
|
In the example above, the @code{"out"} output of @code{libffi} and
|
||||||
|
@code{libunistring} is used.
|
||||||
|
|
||||||
|
@quotation Compatibility Note
|
||||||
|
Until version 1.3.0, input lists were a list of tuples,
|
||||||
|
where each tuple has a label for the input (a string) as its
|
||||||
|
first element, a package, origin, or derivation as its second element,
|
||||||
|
and optionally the name of the output thereof that should be used, which
|
||||||
|
defaults to @code{"out"}. For example, the list below is equivalent to
|
||||||
|
the one above, but using the @dfn{old input style}:
|
||||||
|
|
||||||
|
@lisp
|
||||||
|
;; Old input style (deprecated).
|
||||||
`(("libffi" ,libffi)
|
`(("libffi" ,libffi)
|
||||||
("libunistring" ,libunistring)
|
("libunistring" ,libunistring)
|
||||||
("glib:bin" ,glib "bin")) ;the "bin" output of Glib
|
("glib:bin" ,glib "bin")) ;the "bin" output of GLib
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
|
This style is now deprecated; it is still supported but support will be
|
||||||
|
removed in a future version. It should not be used for new package
|
||||||
|
definitions.
|
||||||
|
@end quotation
|
||||||
|
|
||||||
@cindex cross compilation, package dependencies
|
@cindex cross compilation, package dependencies
|
||||||
The distinction between @code{native-inputs} and @code{inputs} is
|
The distinction between @code{native-inputs} and @code{inputs} is
|
||||||
necessary when considering cross-compilation. When cross-compiling,
|
necessary when considering cross-compilation. When cross-compiling,
|
||||||
|
@ -6789,7 +6810,7 @@ cross-compiling:
|
||||||
;; When cross-compiled, Guile, for example, depends on
|
;; When cross-compiled, Guile, for example, depends on
|
||||||
;; a native version of itself. Add it here.
|
;; a native version of itself. Add it here.
|
||||||
(native-inputs (if (%current-target-system)
|
(native-inputs (if (%current-target-system)
|
||||||
`(("self" ,this-package))
|
(list this-package)
|
||||||
'())))
|
'())))
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
|
@ -7105,8 +7126,7 @@ depends on it:
|
||||||
(name name)
|
(name name)
|
||||||
(version "3.0")
|
(version "3.0")
|
||||||
;; several fields omitted
|
;; several fields omitted
|
||||||
(inputs
|
(inputs (list lua))
|
||||||
`(("lua" ,lua)))
|
|
||||||
(synopsis "Socket library for Lua")))
|
(synopsis "Socket library for Lua")))
|
||||||
|
|
||||||
(define-public lua5.1-socket
|
(define-public lua5.1-socket
|
||||||
|
|
|
@ -366,6 +366,14 @@ (define %cuirass-supported-systems
|
||||||
;; <https://lists.gnu.org/archive/html/guix-devel/2017-03/msg00790.html>.
|
;; <https://lists.gnu.org/archive/html/guix-devel/2017-03/msg00790.html>.
|
||||||
(fold delete %supported-systems '("mips64el-linux" "powerpc-linux")))
|
(fold delete %supported-systems '("mips64el-linux" "powerpc-linux")))
|
||||||
|
|
||||||
|
(define-inlinable (sanitize-inputs inputs)
|
||||||
|
"Sanitize INPUTS by turning it into a list of name/package tuples if it's
|
||||||
|
not already the case."
|
||||||
|
(cond ((null? inputs) inputs)
|
||||||
|
((and (pair? (car inputs))
|
||||||
|
(string? (caar inputs)))
|
||||||
|
inputs)
|
||||||
|
(else (map add-input-label inputs))))
|
||||||
|
|
||||||
;; A package.
|
;; A package.
|
||||||
(define-record-type* <package>
|
(define-record-type* <package>
|
||||||
|
@ -380,11 +388,14 @@ (define-record-type* <package>
|
||||||
(default '()) (thunked))
|
(default '()) (thunked))
|
||||||
|
|
||||||
(inputs package-inputs ; input packages or derivations
|
(inputs package-inputs ; input packages or derivations
|
||||||
(default '()) (thunked))
|
(default '()) (thunked)
|
||||||
|
(sanitize sanitize-inputs))
|
||||||
(propagated-inputs package-propagated-inputs ; same, but propagated
|
(propagated-inputs package-propagated-inputs ; same, but propagated
|
||||||
(default '()) (thunked))
|
(default '()) (thunked)
|
||||||
|
(sanitize sanitize-inputs))
|
||||||
(native-inputs package-native-inputs ; native input packages/derivations
|
(native-inputs package-native-inputs ; native input packages/derivations
|
||||||
(default '()) (thunked))
|
(default '()) (thunked)
|
||||||
|
(sanitize sanitize-inputs))
|
||||||
|
|
||||||
(outputs package-outputs ; list of strings
|
(outputs package-outputs ; list of strings
|
||||||
(default '("out")))
|
(default '("out")))
|
||||||
|
@ -415,6 +426,24 @@ (define-record-type* <package>
|
||||||
source-properties->location))
|
source-properties->location))
|
||||||
(innate)))
|
(innate)))
|
||||||
|
|
||||||
|
(define (add-input-label input)
|
||||||
|
"Add an input label to INPUT."
|
||||||
|
(match input
|
||||||
|
((? package? package)
|
||||||
|
(list (package-name package) package))
|
||||||
|
(((? package? package) output) ;XXX: ugly?
|
||||||
|
(list (package-name package) package output))
|
||||||
|
((? gexp-input?) ;XXX: misplaced because 'native?' field is ignored?
|
||||||
|
(let ((obj (gexp-input-thing input))
|
||||||
|
(output (gexp-input-output input)))
|
||||||
|
`(,(if (package? obj)
|
||||||
|
(package-name obj)
|
||||||
|
"_")
|
||||||
|
,obj
|
||||||
|
,@(if (string=? output "out") '() (list output)))))
|
||||||
|
(x
|
||||||
|
`("_" ,x))))
|
||||||
|
|
||||||
(set-record-type-printer! <package>
|
(set-record-type-printer! <package>
|
||||||
(lambda (package port)
|
(lambda (package port)
|
||||||
(let ((loc (package-location package))
|
(let ((loc (package-location package))
|
||||||
|
|
|
@ -137,7 +137,7 @@ (define %store
|
||||||
;; inputs. See <https://bugs.gnu.org/35872>.
|
;; inputs. See <https://bugs.gnu.org/35872>.
|
||||||
(let* ((dep (dummy-package "dep" (version "2")))
|
(let* ((dep (dummy-package "dep" (version "2")))
|
||||||
(old (dummy-package "foo" (version "1")
|
(old (dummy-package "foo" (version "1")
|
||||||
(propagated-inputs `(("dep" ,dep)))))
|
(propagated-inputs (list dep))))
|
||||||
(drv (package-derivation %store old))
|
(drv (package-derivation %store old))
|
||||||
(tx (mock ((gnu packages) find-best-packages-by-name
|
(tx (mock ((gnu packages) find-best-packages-by-name
|
||||||
(const (list old)))
|
(const (list old)))
|
||||||
|
@ -225,7 +225,7 @@ (define %store
|
||||||
(bar (dummy-package "bar" (version "0")
|
(bar (dummy-package "bar" (version "0")
|
||||||
(replacement old)))
|
(replacement old)))
|
||||||
(new (dummy-package "foo" (version "1")
|
(new (dummy-package "foo" (version "1")
|
||||||
(inputs `(("bar" ,bar)))))
|
(inputs (list bar))))
|
||||||
(tx (mock ((gnu packages) find-best-packages-by-name
|
(tx (mock ((gnu packages) find-best-packages-by-name
|
||||||
(const (list new)))
|
(const (list new)))
|
||||||
(transaction-upgrade-entry
|
(transaction-upgrade-entry
|
||||||
|
@ -275,13 +275,13 @@ (define read-at
|
||||||
(test-assert "package-transitive-inputs"
|
(test-assert "package-transitive-inputs"
|
||||||
(let* ((a (dummy-package "a"))
|
(let* ((a (dummy-package "a"))
|
||||||
(b (dummy-package "b"
|
(b (dummy-package "b"
|
||||||
(propagated-inputs `(("a" ,a)))))
|
(propagated-inputs (list a))))
|
||||||
(c (dummy-package "c"
|
(c (dummy-package "c"
|
||||||
(inputs `(("a" ,a)))))
|
(inputs (list a))))
|
||||||
(d (dummy-package "d"
|
(d (dummy-package "d"
|
||||||
(propagated-inputs `(("x" "something.drv")))))
|
(propagated-inputs `(("x" "something.drv")))))
|
||||||
(e (dummy-package "e"
|
(e (dummy-package "e"
|
||||||
(inputs `(("b" ,b) ("c" ,c) ("d" ,d))))))
|
(inputs (list b c d)))))
|
||||||
(and (null? (package-transitive-inputs a))
|
(and (null? (package-transitive-inputs a))
|
||||||
(equal? `(("a" ,a)) (package-transitive-inputs b))
|
(equal? `(("a" ,a)) (package-transitive-inputs b))
|
||||||
(equal? `(("a" ,a)) (package-transitive-inputs c))
|
(equal? `(("a" ,a)) (package-transitive-inputs c))
|
||||||
|
@ -327,19 +327,19 @@ (define read-at
|
||||||
(b (dummy-package "b"
|
(b (dummy-package "b"
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(supported-systems '("x" "y"))
|
(supported-systems '("x" "y"))
|
||||||
(inputs `(("a" ,a)))))
|
(inputs (list a))))
|
||||||
(c (dummy-package "c"
|
(c (dummy-package "c"
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(supported-systems '("y" "z"))
|
(supported-systems '("y" "z"))
|
||||||
(inputs `(("b" ,b)))))
|
(inputs (list b))))
|
||||||
(d (dummy-package "d"
|
(d (dummy-package "d"
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(supported-systems '("x" "y" "z"))
|
(supported-systems '("x" "y" "z"))
|
||||||
(inputs `(("b" ,b) ("c" ,c)))))
|
(inputs (list b c))))
|
||||||
(e (dummy-package "e"
|
(e (dummy-package "e"
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(supported-systems '("x" "y" "z"))
|
(supported-systems '("x" "y" "z"))
|
||||||
(inputs `(("d" ,d))))))
|
(inputs (list d)))))
|
||||||
(list (package-transitive-supported-systems a)
|
(list (package-transitive-supported-systems a)
|
||||||
(package-transitive-supported-systems b)
|
(package-transitive-supported-systems b)
|
||||||
(package-transitive-supported-systems c)
|
(package-transitive-supported-systems c)
|
||||||
|
@ -355,13 +355,13 @@ (define read-at
|
||||||
(build-system trivial-build-system))))))
|
(build-system trivial-build-system))))))
|
||||||
(let* ((a (dummy-package/no-implicit "a"))
|
(let* ((a (dummy-package/no-implicit "a"))
|
||||||
(b (dummy-package/no-implicit "b"
|
(b (dummy-package/no-implicit "b"
|
||||||
(propagated-inputs `(("a" ,a)))))
|
(propagated-inputs (list a))))
|
||||||
(c (dummy-package/no-implicit "c"
|
(c (dummy-package/no-implicit "c"
|
||||||
(inputs `(("a" ,a)))))
|
(inputs (list a))))
|
||||||
(d (dummy-package/no-implicit "d"
|
(d (dummy-package/no-implicit "d"
|
||||||
(native-inputs `(("b" ,b)))))
|
(native-inputs (list b))))
|
||||||
(e (dummy-package/no-implicit "e"
|
(e (dummy-package/no-implicit "e"
|
||||||
(inputs `(("c" ,c) ("d" ,d))))))
|
(inputs (list c d)))))
|
||||||
(lset= eq?
|
(lset= eq?
|
||||||
(list a b c d e)
|
(list a b c d e)
|
||||||
(package-closure (list e))
|
(package-closure (list e))
|
||||||
|
@ -384,12 +384,11 @@ (define read-at
|
||||||
(u (dummy-origin))
|
(u (dummy-origin))
|
||||||
(i (dummy-origin))
|
(i (dummy-origin))
|
||||||
(a (dummy-package "a"))
|
(a (dummy-package "a"))
|
||||||
(b (dummy-package "b"
|
(b (dummy-package "b" (inputs (list a i))))
|
||||||
(inputs `(("a" ,a) ("i" ,i)))))
|
|
||||||
(c (package (inherit b) (source o)))
|
(c (package (inherit b) (source o)))
|
||||||
(d (dummy-package "d"
|
(d (dummy-package "d"
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(source u) (inputs `(("c" ,c))))))
|
(source u) (inputs (list c)))))
|
||||||
(test-assert "package-direct-sources, no source"
|
(test-assert "package-direct-sources, no source"
|
||||||
(null? (package-direct-sources a)))
|
(null? (package-direct-sources a)))
|
||||||
(test-equal "package-direct-sources, #f source"
|
(test-equal "package-direct-sources, #f source"
|
||||||
|
@ -457,7 +456,7 @@ (define read-at
|
||||||
(supported-systems '("x86_64-linux"))))
|
(supported-systems '("x86_64-linux"))))
|
||||||
(p (dummy-package "foo"
|
(p (dummy-package "foo"
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(inputs `(("d" ,d)))
|
(inputs (list d))
|
||||||
(supported-systems '("x86_64-linux" "armhf-linux")))))
|
(supported-systems '("x86_64-linux" "armhf-linux")))))
|
||||||
(and (supported-package? p "x86_64-linux")
|
(and (supported-package? p "x86_64-linux")
|
||||||
(not (supported-package? p "i686-linux"))
|
(not (supported-package? p "i686-linux"))
|
||||||
|
@ -706,7 +705,7 @@ (define compressors '(("gzip" . "gz")
|
||||||
|
|
||||||
(test-assert "package-derivation, inputs deduplicated"
|
(test-assert "package-derivation, inputs deduplicated"
|
||||||
(let* ((dep (dummy-package "dep"))
|
(let* ((dep (dummy-package "dep"))
|
||||||
(p0 (dummy-package "p" (inputs `(("dep" ,dep)))))
|
(p0 (dummy-package "p" (inputs (list dep))))
|
||||||
(p1 (package (inherit p0)
|
(p1 (package (inherit p0)
|
||||||
(inputs `(("dep" ,(package (inherit dep)))
|
(inputs `(("dep" ,(package (inherit dep)))
|
||||||
,@(package-inputs p0))))))
|
,@(package-inputs p0))))))
|
||||||
|
@ -770,7 +769,7 @@ (define right-system?
|
||||||
(parameterize ((%graft? #f))
|
(parameterize ((%graft? #f))
|
||||||
(let* ((dep (dummy-package "dep"))
|
(let* ((dep (dummy-package "dep"))
|
||||||
(p (dummy-package "p"
|
(p (dummy-package "p"
|
||||||
(inputs `(("dep" ,dep "non-existent"))))))
|
(inputs (list `(,dep "non-existent"))))))
|
||||||
(guard (c ((derivation-missing-output-error? c)
|
(guard (c ((derivation-missing-output-error? c)
|
||||||
(and (string=? (derivation-missing-output c) "non-existent")
|
(and (string=? (derivation-missing-output c) "non-existent")
|
||||||
(equal? (package-derivation %store dep)
|
(equal? (package-derivation %store dep)
|
||||||
|
@ -928,12 +927,12 @@ (define right-system?
|
||||||
(p1 (dummy-package "p1" (native-search-paths (sp "PATH1"))))
|
(p1 (dummy-package "p1" (native-search-paths (sp "PATH1"))))
|
||||||
(p2 (dummy-package "p2"
|
(p2 (dummy-package "p2"
|
||||||
(native-search-paths (sp "PATH2"))
|
(native-search-paths (sp "PATH2"))
|
||||||
(inputs `(("p0" ,p0)))
|
(inputs (list p0))
|
||||||
(propagated-inputs `(("p1" ,p1)))))
|
(propagated-inputs (list p1))))
|
||||||
(p3 (dummy-package "p3"
|
(p3 (dummy-package "p3"
|
||||||
(native-search-paths (sp "PATH3"))
|
(native-search-paths (sp "PATH3"))
|
||||||
(native-inputs `(("p0" ,p0)))
|
(native-inputs (list p0))
|
||||||
(propagated-inputs `(("p2" ,p2))))))
|
(propagated-inputs (list p2)))))
|
||||||
(lset= string=?
|
(lset= string=?
|
||||||
'("PATH1" "PATH2" "PATH3")
|
'("PATH1" "PATH2" "PATH3")
|
||||||
(map search-path-specification-variable
|
(map search-path-specification-variable
|
||||||
|
@ -987,7 +986,7 @@ (define right-system?
|
||||||
(dep* (package (inherit dep) (replacement new)))
|
(dep* (package (inherit dep) (replacement new)))
|
||||||
(dummy (dummy-package "dummy"
|
(dummy (dummy-package "dummy"
|
||||||
(arguments '(#:implicit-inputs? #f))
|
(arguments '(#:implicit-inputs? #f))
|
||||||
(inputs `(("dep" ,dep*))))))
|
(inputs (list dep*)))))
|
||||||
(equal? (package-grafts %store dummy)
|
(equal? (package-grafts %store dummy)
|
||||||
(list (graft
|
(list (graft
|
||||||
(origin (package-derivation %store dep))
|
(origin (package-derivation %store dep))
|
||||||
|
@ -1019,11 +1018,11 @@ (define right-system?
|
||||||
(dep (package (inherit new) (version "0.0")))
|
(dep (package (inherit new) (version "0.0")))
|
||||||
(dep* (package (inherit dep) (replacement new)))
|
(dep* (package (inherit dep) (replacement new)))
|
||||||
(prop (dummy-package "propagated"
|
(prop (dummy-package "propagated"
|
||||||
(propagated-inputs `(("dep" ,dep*)))
|
(propagated-inputs (list dep*))
|
||||||
(arguments '(#:implicit-inputs? #f))))
|
(arguments '(#:implicit-inputs? #f))))
|
||||||
(dummy (dummy-package "dummy"
|
(dummy (dummy-package "dummy"
|
||||||
(arguments '(#:implicit-inputs? #f))
|
(arguments '(#:implicit-inputs? #f))
|
||||||
(inputs `(("prop" ,prop))))))
|
(inputs (list prop)))))
|
||||||
(equal? (package-grafts %store dummy)
|
(equal? (package-grafts %store dummy)
|
||||||
(list (graft
|
(list (graft
|
||||||
(origin (package-derivation %store dep))
|
(origin (package-derivation %store dep))
|
||||||
|
@ -1036,16 +1035,16 @@ (define right-system?
|
||||||
(dep (package (inherit new) (version "0") (replacement new)))
|
(dep (package (inherit new) (version "0") (replacement new)))
|
||||||
(p1 (dummy-package "intermediate1"
|
(p1 (dummy-package "intermediate1"
|
||||||
(arguments '(#:implicit-inputs? #f))
|
(arguments '(#:implicit-inputs? #f))
|
||||||
(inputs `(("dep" ,dep)))))
|
(inputs (list dep))))
|
||||||
(p2 (dummy-package "intermediate2"
|
(p2 (dummy-package "intermediate2"
|
||||||
(arguments '(#:implicit-inputs? #f))
|
(arguments '(#:implicit-inputs? #f))
|
||||||
;; Here we copy DEP to have an equivalent package that is not
|
;; Here we copy DEP to have an equivalent package that is not
|
||||||
;; 'eq?' to DEP. This is similar to what happens with
|
;; 'eq?' to DEP. This is similar to what happens with
|
||||||
;; 'package-with-explicit-inputs' & co.
|
;; 'package-with-explicit-inputs' & co.
|
||||||
(inputs `(("dep" ,(package (inherit dep)))))))
|
(inputs (list (package (inherit dep))))))
|
||||||
(p3 (dummy-package "final"
|
(p3 (dummy-package "final"
|
||||||
(arguments '(#:implicit-inputs? #f))
|
(arguments '(#:implicit-inputs? #f))
|
||||||
(inputs `(("p1" ,p1) ("p2" ,p2))))))
|
(inputs (list p1 p2)))))
|
||||||
(equal? (package-grafts %store p3)
|
(equal? (package-grafts %store p3)
|
||||||
(list (graft
|
(list (graft
|
||||||
(origin (package-derivation %store
|
(origin (package-derivation %store
|
||||||
|
@ -1063,8 +1062,7 @@ (define right-system?
|
||||||
(p0* (package (inherit p0) (version "1.1")))
|
(p0* (package (inherit p0) (version "1.1")))
|
||||||
(p1 (dummy-package "p1"
|
(p1 (dummy-package "p1"
|
||||||
(arguments '(#:implicit-inputs? #f))
|
(arguments '(#:implicit-inputs? #f))
|
||||||
(inputs `(("p0" ,p0)
|
(inputs (list p0 `(,p0 "lib"))))))
|
||||||
("p0:lib" ,p0 "lib"))))))
|
|
||||||
(lset= equal? (pk (package-grafts %store p1))
|
(lset= equal? (pk (package-grafts %store p1))
|
||||||
(list (graft
|
(list (graft
|
||||||
(origin (package-derivation %store p0))
|
(origin (package-derivation %store p0))
|
||||||
|
@ -1112,7 +1110,7 @@ (define right-system?
|
||||||
#t)))))
|
#t)))))
|
||||||
(p2r (dummy-package "P2"
|
(p2r (dummy-package "P2"
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(inputs `(("p1" ,p1)))
|
(inputs (list p1))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:guile ,%bootstrap-guile
|
`(#:guile ,%bootstrap-guile
|
||||||
#:builder (let ((out (assoc-ref %outputs "out")))
|
#:builder (let ((out (assoc-ref %outputs "out")))
|
||||||
|
@ -1133,7 +1131,7 @@ (define right-system?
|
||||||
#t)))))
|
#t)))))
|
||||||
(p3 (dummy-package "p3"
|
(p3 (dummy-package "p3"
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(inputs `(("p2" ,p2)))
|
(inputs (list p2))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:guile ,%bootstrap-guile
|
`(#:guile ,%bootstrap-guile
|
||||||
#:builder (let ((out (assoc-ref %outputs "out")))
|
#:builder (let ((out (assoc-ref %outputs "out")))
|
||||||
|
@ -1202,7 +1200,7 @@ (define right-system?
|
||||||
(lower lower)))
|
(lower lower)))
|
||||||
(dep (dummy-package "dep" (build-system bs)))
|
(dep (dummy-package "dep" (build-system bs)))
|
||||||
(pkg (dummy-package "example"
|
(pkg (dummy-package "example"
|
||||||
(native-inputs `(("dep" ,dep)))))
|
(native-inputs (list dep))))
|
||||||
(do-not-build (lambda (continue store lst . _) lst)))
|
(do-not-build (lambda (continue store lst . _) lst)))
|
||||||
(equal? (with-build-handler do-not-build
|
(equal? (with-build-handler do-not-build
|
||||||
(parameterize ((%current-target-system "powerpc64le-linux-gnu")
|
(parameterize ((%current-target-system "powerpc64le-linux-gnu")
|
||||||
|
@ -1229,9 +1227,9 @@ (define right-system?
|
||||||
(test-assert "package->bag, propagated inputs"
|
(test-assert "package->bag, propagated inputs"
|
||||||
(let* ((dep (dummy-package "dep"))
|
(let* ((dep (dummy-package "dep"))
|
||||||
(prop (dummy-package "prop"
|
(prop (dummy-package "prop"
|
||||||
(propagated-inputs `(("dep" ,dep)))))
|
(propagated-inputs (list dep))))
|
||||||
(dummy (dummy-package "dummy"
|
(dummy (dummy-package "dummy"
|
||||||
(inputs `(("prop" ,prop)))))
|
(inputs (list prop))))
|
||||||
(inputs (bag-transitive-inputs (package->bag dummy #:graft? #f))))
|
(inputs (bag-transitive-inputs (package->bag dummy #:graft? #f))))
|
||||||
(match (assoc "dep" inputs)
|
(match (assoc "dep" inputs)
|
||||||
(("dep" package)
|
(("dep" package)
|
||||||
|
@ -1244,7 +1242,7 @@ (define right-system?
|
||||||
`(("libxml2" ,libxml2))
|
`(("libxml2" ,libxml2))
|
||||||
'()))))
|
'()))))
|
||||||
(pkg (dummy-package "foo"
|
(pkg (dummy-package "foo"
|
||||||
(native-inputs `(("dep" ,dep)))))
|
(native-inputs (list dep))))
|
||||||
(bag (package->bag pkg (%current-system) "i586-gnu")))
|
(bag (package->bag pkg (%current-system) "i586-gnu")))
|
||||||
(equal? (parameterize ((%current-system "x86_64-linux"))
|
(equal? (parameterize ((%current-system "x86_64-linux"))
|
||||||
(bag-transitive-inputs bag))
|
(bag-transitive-inputs bag))
|
||||||
|
@ -1257,7 +1255,7 @@ (define right-system?
|
||||||
`(("libxml2" ,libxml2))
|
`(("libxml2" ,libxml2))
|
||||||
'()))))
|
'()))))
|
||||||
(pkg (dummy-package "foo"
|
(pkg (dummy-package "foo"
|
||||||
(native-inputs `(("dep" ,dep)))))
|
(native-inputs (list dep))))
|
||||||
(bag (package->bag pkg (%current-system) "foo86-hurd")))
|
(bag (package->bag pkg (%current-system) "foo86-hurd")))
|
||||||
(equal? (parameterize ((%current-target-system "foo64-gnu"))
|
(equal? (parameterize ((%current-target-system "foo64-gnu"))
|
||||||
(bag-transitive-inputs bag))
|
(bag-transitive-inputs bag))
|
||||||
|
@ -1563,11 +1561,11 @@ (define toolchain-packages
|
||||||
(build-system trivial-build-system)))
|
(build-system trivial-build-system)))
|
||||||
(glib (dummy-package "glib"
|
(glib (dummy-package "glib"
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(propagated-inputs `(("libffi" ,libffi)))))
|
(propagated-inputs (list libffi))))
|
||||||
(gobject (dummy-package "gobject-introspection"
|
(gobject (dummy-package "gobject-introspection"
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(inputs `(("glib" ,glib)))
|
(inputs (list glib))
|
||||||
(propagated-inputs `(("libffi" ,libffi)))))
|
(propagated-inputs (list libffi))))
|
||||||
(rewrite (package-input-rewriting/spec
|
(rewrite (package-input-rewriting/spec
|
||||||
`(("glib" . ,identity)))))
|
`(("glib" . ,identity)))))
|
||||||
(and (= (length (package-transitive-inputs gobject))
|
(and (= (length (package-transitive-inputs gobject))
|
||||||
|
@ -1584,11 +1582,11 @@ (define toolchain-packages
|
||||||
(build-system trivial-build-system)))
|
(build-system trivial-build-system)))
|
||||||
(glib (dummy-package "glib"
|
(glib (dummy-package "glib"
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(propagated-inputs `(("libffi" ,libffi)))))
|
(propagated-inputs (list libffi))))
|
||||||
(gobject (dummy-package "gobject-introspection"
|
(gobject (dummy-package "gobject-introspection"
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(inputs `(("glib" ,glib)))
|
(inputs (list glib))
|
||||||
(propagated-inputs `(("libffi" ,libffi)))))
|
(propagated-inputs (list libffi))))
|
||||||
(rewrite (package-input-rewriting `((,glib . ,glib)))))
|
(rewrite (package-input-rewriting `((,glib . ,glib)))))
|
||||||
(and (= (length (package-transitive-inputs gobject))
|
(and (= (length (package-transitive-inputs gobject))
|
||||||
(length (package-transitive-inputs (rewrite gobject))))
|
(length (package-transitive-inputs (rewrite gobject))))
|
||||||
|
|
Loading…
Reference in a new issue