[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dune-based package design trouble

From: Julien Lepiller
Subject: Re: dune-based package design trouble
Date: Thu, 21 Sep 2023 07:57:30 +0200

Le Wed, 20 Sep 2023 09:52:03 +0200,
Erwan Jahier <> a écrit :

> Hello,
> I am a newguix tring to package some of his software.
> Since I already  have opam packages, I used =guix  import opam=, that
> helped a  little. Of course,  my packages have dependancies,  and not
> all of them exist in the main guix repo.
> I have  able to build  some of them  (ocaml-junit,
> ocaml-junit-alcotest, ocaml-yaml,  ocaml-functory,
> ocaml-conf-graphviz),   but  I  am  having trouble with
> ocaml-mlgmpidl, for  which the build  phase isn't  able to
> (ocaml-)find gmp (see below).  So I've tried to package ocaml-gmp,
> but I am stuck again.
> The error  "/bin/sh: bad interpreter:  No such file or  directory" is
> raised  during the  build phase  that  runs a  =configure= script
> that refers to a non existing /bin/sh.
> The  problem  is that  the  =patch-source-shebangs=  phase cannot  be
> applied, as this  =configure= script is generated and  run inside the
> build phase (via =dune build=).
> I feel like it might be a dune expert question, but I try my luck
> here.
> Erwan.

It's not very clean, but this works:

(define-public ocaml-mlgmpidl
    (name "ocaml-mlgmpidl")
    (version "1.2.15")
    (source (origin
              (method url-fetch)
       (build-system ocaml-build-system)
     `(#:tests? #f;
        (modify-phases %standard-phases
          (replace 'configure
            (lambda* (#:key outputs inputs #:allow-other-keys)
              (substitute* "configure"
                ((".*query gmp.*") "echo \"$camlidl_prefix\n\" \n")
                 (string-append "camlidl_prefix=\"" (assoc-ref inputs
"camlidl") "/lib/ocaml/site-lib/camlidl\"\n")))
              (invoke "./configure" "--prefix" (assoc-ref outputs
    (inputs (list perl ocaml-findlib camlidl gmp mpfr
    (synopsis "OCaml interface to the GMP library")
    (description #f)
    (license license:lgpl2.1)) ; with linking exception

reply via email to

[Prev in Thread] Current Thread [Next in Thread]