mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06:00
guix: ocaml-build-system: Support installer tool opaline.
* guix/build/ocaml-build-system.scm (install): Invoke `opaline` when `opam-installer` is not in $PATH. Change-Id: I6271b3acb028b7eb868bc690d14ef76529d1f856 Signed-off-by: Julien Lepiller <julien@lepiller.eu>
This commit is contained in:
parent
c0751f038d
commit
20e11809f7
1 changed files with 18 additions and 6 deletions
|
|
@ -89,13 +89,25 @@
|
|||
#:allow-other-keys)
|
||||
"Install the given package."
|
||||
(let ((out (assoc-ref outputs "out")))
|
||||
(if (and (file-exists? "setup.ml") (not use-make?))
|
||||
(cond
|
||||
((and (file-exists? "setup.ml") (not use-make?))
|
||||
(apply invoke "ocaml" "setup.ml"
|
||||
(string-append "-" install-target) build-flags)
|
||||
(if (file-exists? "Makefile")
|
||||
(apply invoke "make" install-target make-flags)
|
||||
(invoke "opam-installer" "-i" (string-append "--prefix=" out)
|
||||
(string-append "--libdir=" out "/lib/ocaml/site-lib")))))
|
||||
(string-append "-" install-target) build-flags))
|
||||
((file-exists? "Makefile")
|
||||
(apply invoke "make" install-target make-flags))
|
||||
;; Use either opam-installer or opaline, which both understand
|
||||
;; opam's `.install` file format. opam-installer is the standard
|
||||
;; platform tool, while opaline is a fallback for packages with
|
||||
;; circular dependencies involving opam.
|
||||
;; (https://codeberg.org/guix/guix/issues/3588)
|
||||
((which "opam-installer")
|
||||
(invoke "opam-installer" "-i" (string-append "--prefix=" out)
|
||||
(string-append "--libdir=" out "/lib/ocaml/site-lib")))
|
||||
((which "opaline")
|
||||
(invoke "opaline" "-prefix" out
|
||||
"-libdir" (string-append out "/lib/ocaml/site-lib")))
|
||||
(else (error (string-append "Either 'opam-installer' or 'opaline' "
|
||||
"must exist in $PATH at build time.")))))
|
||||
#t)
|
||||
|
||||
(define* (prepare-install #:key outputs #:allow-other-keys)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue