guix: opam: Add coq support in the importer.
* guix/import/opam.scm (get-opam-repository): Add support for coq repositories. (ocaml-name->guix-name): Properly name coq package. * doc/guix.texi (Invoking guix import): Document it.
This commit is contained in:
parent
a8dccd4bdc
commit
ccc4d287b7
2 changed files with 27 additions and 0 deletions
|
@ -11291,6 +11291,25 @@ in Guix.
|
||||||
@cindex OCaml
|
@cindex OCaml
|
||||||
Import metadata from the @uref{https://opam.ocaml.org/, OPAM} package
|
Import metadata from the @uref{https://opam.ocaml.org/, OPAM} package
|
||||||
repository used by the OCaml community.
|
repository used by the OCaml community.
|
||||||
|
|
||||||
|
Additional options include:
|
||||||
|
|
||||||
|
@table @code
|
||||||
|
@item --recursive
|
||||||
|
@itemx -r
|
||||||
|
Traverse the dependency graph of the given upstream package recursively
|
||||||
|
and generate package expressions for all those packages that are not yet
|
||||||
|
in Guix.
|
||||||
|
@item --repo
|
||||||
|
Select the given repository (a repository name). Possible values include:
|
||||||
|
@itemize
|
||||||
|
@item @code{opam}, the default opam repository,
|
||||||
|
@item @code{coq} or @code{coq-released}, the stable repository for coq packages,
|
||||||
|
@item @code{coq-core-dev}, the repository that contains development versions of coq,
|
||||||
|
@item @code{coq-extra-dev}, the repository that contains development versions
|
||||||
|
of coq packages.
|
||||||
|
@end itemize
|
||||||
|
@end table
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
The structure of the @command{guix import} code is modular. It would be
|
The structure of the @command{guix import} code is modular. It would be
|
||||||
|
|
|
@ -126,12 +126,19 @@ path to the repository."
|
||||||
(let ((url (cond
|
(let ((url (cond
|
||||||
((or (not repo) (equal? repo 'opam))
|
((or (not repo) (equal? repo 'opam))
|
||||||
"https://github.com/ocaml/opam-repository")
|
"https://github.com/ocaml/opam-repository")
|
||||||
|
((string-prefix? "coq-" (symbol->string repo))
|
||||||
|
"https://github.com/coq/opam-coq-archive")
|
||||||
|
((equal? repo 'coq) "https://github.com/coq/opam-coq-archive")
|
||||||
(else (throw 'unknown-repository repo)))))
|
(else (throw 'unknown-repository repo)))))
|
||||||
(receive (location commit _)
|
(receive (location commit _)
|
||||||
(update-cached-checkout url)
|
(update-cached-checkout url)
|
||||||
(cond
|
(cond
|
||||||
((or (not repo) (equal? repo 'opam))
|
((or (not repo) (equal? repo 'opam))
|
||||||
location)
|
location)
|
||||||
|
((equal? repo 'coq)
|
||||||
|
(string-append location "/released"))
|
||||||
|
((string-prefix? "coq-" (symbol->string repo))
|
||||||
|
(string-append location "/" (substring (symbol->string repo) 4)))
|
||||||
(else location)))))
|
(else location)))))
|
||||||
|
|
||||||
(define (latest-version versions)
|
(define (latest-version versions)
|
||||||
|
@ -168,6 +175,7 @@ path to the repository."
|
||||||
(substitute-char
|
(substitute-char
|
||||||
(cond
|
(cond
|
||||||
((equal? name "ocamlfind") "ocaml-findlib")
|
((equal? name "ocamlfind") "ocaml-findlib")
|
||||||
|
((equal? name "coq") name)
|
||||||
((string-prefix? "ocaml" name) name)
|
((string-prefix? "ocaml" name) name)
|
||||||
((string-prefix? "conf-" name) (substring name 5))
|
((string-prefix? "conf-" name) (substring name 5))
|
||||||
(else (string-append "ocaml-" name)))
|
(else (string-append "ocaml-" name)))
|
||||||
|
|
Reference in a new issue