Subject: Re: [bug#30096] [PATCH 4/6] gnu: Add ocaml-ocb-stubblr.

From: Julien Lepiller <[email-masked]>
Date: Sat, 13 Jan 2018 14:10:59 +0100

Le Sat, 13 Jan 2018 05:25:52 -0600,
Peter Kreye <[email-masked]> a écrit :

> * gnu/packages/ocaml.scm (ocaml-ocb-stubblr): New variable.
> ---
>  gnu/packages/ocaml.scm | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
> index 40303c808..a60922c02 100644
> --- a/gnu/packages/ocaml.scm
> +++ b/gnu/packages/ocaml.scm
> @@ -3814,6 +3814,42 @@ functions that you want to call, then bind
> directly to those functions -- all without writing or generating any
> C!") (license license:expat)))
>  
> +(define-public ocaml-ocb-stubblr
> +  (package
> +   (name "ocaml-ocb-stubblr")
> +   (version "0.1.1")
> +   (home-page "https://github.com/pqwy/ocb-stubblr")
> +   (source (origin
> +             (method url-fetch)
> +             (uri (string-append
> +                   home-page "/releases/download/v0.1.1/ocb-stubblr-"
> +                   version ".tbz"))
> +             (file-name (string-append name "-" version ".tbz"))
> +             (sha256
> +              (base32
> +
> "167b7x1j21mkviq8dbaa0nmk4rps2ilvzwx02igsc2706784z72f"))))
> +   (build-system ocaml-build-system)
> +   (arguments
> +     `(#:tests? #f
> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure)
> +         (replace 'build
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let ((libdir (string-append (assoc-ref %build-inputs
> "findlib")
> +                                          "/lib/ocaml/site-lib")))
> +               (zero? (system* "ocaml" "-I" libdir "pkg/pkg.ml"
> "build"))))))))
You don't need to replace the build phase, use #:build-flags (list
"build").

> +   (inputs
> +    `(("findlib" ,ocaml-findlib-1.7.3)
Similarly, I think it's better to use #:findlib.

> +      ("topkg" ,ocaml-topkg)
> +      ("astring" ,ocaml-astring)
> +      ("opam", opam)))
> +   (synopsis "OCamlbuild plugin for C stubs")
> +   (description "Ocb-stubblr is about ten lines of code that you
> need to +repeat over, over, over and over again if you are using
> ocamlbuild to build +OCaml projects that contain C stubs.")
> +   (license license:isc)))
> +
>  (define-public coq-flocq
>    (package
>      (name "coq-flocq")