mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
guix: opam: Filter implicit inputs.
* guix/import/opam.scm (opam->guix-package, depends->inputs): Filter out implicit inputs.
This commit is contained in:
parent
4e110f61ac
commit
59873d94ce
1 changed files with 11 additions and 10 deletions
|
@ -235,12 +235,15 @@ (define (ocaml-names->guix-names names)
|
|||
(equal? "ocaml" name))
|
||||
names)))
|
||||
|
||||
(define (depends->inputs depends)
|
||||
(define (filter-dependencies depends)
|
||||
"Remove implicit dependencies from the list of dependencies in @var{depends}."
|
||||
(filter (lambda (name)
|
||||
(and (not (equal? "" name))
|
||||
(not (equal? "ocaml" name))
|
||||
(not (equal? "ocamlfind" name))))
|
||||
(map dependency->input depends)))
|
||||
(and (not (member name '("" "ocaml" "ocamlfind" "dune" "jbuilder")))
|
||||
(not (string-prefix? "base-" name))))
|
||||
depends))
|
||||
|
||||
(define (depends->inputs depends)
|
||||
(filter-dependencies (map dependency->input depends)))
|
||||
|
||||
(define (depends->native-inputs depends)
|
||||
(filter (lambda (name) (not (equal? "" name)))
|
||||
|
@ -272,7 +275,8 @@ (define* (opam->guix-package name #:key (repository (get-opam-repository)) versi
|
|||
(source-url (or (metadata-ref url-dict "src")
|
||||
(metadata-ref url-dict "archive")))
|
||||
(requirements (metadata-ref opam-content "depends"))
|
||||
(dependencies (dependency-list->names requirements))
|
||||
(names (dependency-list->names requirements))
|
||||
(dependencies (filter-dependencies names))
|
||||
(native-dependencies (depends->native-inputs requirements))
|
||||
(inputs (dependency-list->inputs (depends->inputs requirements)))
|
||||
(native-inputs (dependency-list->inputs
|
||||
|
@ -282,10 +286,7 @@ (define* (opam->guix-package name #:key (repository (get-opam-repository)) versi
|
|||
(lambda (name)
|
||||
(not (member name '("dune" "jbuilder"))))
|
||||
native-dependencies))))
|
||||
;; If one of these are required at build time, it means we
|
||||
;; can use the much nicer dune-build-system.
|
||||
(let ((use-dune? (or (member "dune" (append dependencies native-dependencies))
|
||||
(member "jbuilder" (append dependencies native-dependencies)))))
|
||||
(let ((use-dune? (member "dune" names)))
|
||||
(call-with-temporary-output-file
|
||||
(lambda (temp port)
|
||||
(and (url-fetch source-url temp)
|
||||
|
|
Loading…
Reference in a new issue