unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] document ocaml-build-system
@ 2017-01-28 11:14 Julien Lepiller
  2017-01-28 23:49 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Lepiller @ 2017-01-28 11:14 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 52 bytes --]

Hi,

here is a patch to document ocaml-build-system.

[-- Attachment #2: 0001-doc-Document-ocaml-build-system.patch --]
[-- Type: text/x-patch, Size: 3274 bytes --]

From 8854480a48e8096bf6bf8d94b3695fb049720038 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sat, 28 Jan 2017 12:11:42 +0100
Subject: [PATCH] doc: Document ocaml-build-system.

* doc/guix.texi (Build Systems) [ocaml-build-system]: New definition.
---
 doc/guix.texi | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 8c4067fbd..832721243 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3291,6 +3291,48 @@ specified with the @code{#:glib} parameter.
 Both phases are executed after the @code{install} phase.
 @end defvr
 
+@defvr {Scheme Variable} ocaml-build-system
+This variable is exported by @code{(guix build-sytem ocaml)}.  It is implements
+a build procedure for ocaml packages, which consists of choosing the correct
+set of commands to run for each package.  Ocaml packages can expect many
+different commands to be run.  This build system will try some of them.
+
+When the package has a @file{setup.ml} file present at the top-level, it will
+run @code{ocaml setup.ml -configure}, @code{ocaml setup.ml -build} and
+@code{ocaml setup.ml -install}.  The build system will assume that this file
+was generated by oasis and will take care of setting the prefix and enabling
+tests if they are not disabled.  You can pass configure and build flags with the
+@code{#:configure-flags} and @code{#:build-flags}.  The @code{#:test-flags} key
+can be passed to change the set of flags used to enable tests.  The
+@code{#:use-make?} key can be used to bypass this system in the build and
+install phases.
+
+When the package has a @file{configure} file, it is assumed that it is a
+hand-made configure script that requires a different argument format than
+in the @code{gnu-build-system}.  You can add more flags with the
+@code{#:configure-flags} key.
+
+When the package has a @file{Makefile} file (or @code{#:use-make?} is
+@code{#t}), it will be used and more flags can be passed to the build and
+install phases with the @code{#:make-flags} key.
+
+Finaly, some packages do not have these files and use a somewhat standard
+location for its build system.  In that case, the build system will run
+@code{ocaml pkg/pkg.ml} or @code{ocaml pkg/build.ml} and take care of
+providing the path to the required findlib module.  Additional flags can
+be passed via the @code{#:build-flags} key.  Install is taken care by
+@command{opam-installer}.  In this case, the @code{opam} package must
+be added to the @code{native-inputs} field of the package definition.
+
+Note that most ocaml packages assume they will be installed in the same
+directory as ocaml, which is not what we want in guix.  In particular, they
+will install @file{.so} files in their module's directory, which is usually
+fine because it is in the ocaml compiler directory.  In guix though, these
+libraries cannot be found and we use @code{CAML_LD_LIBRARY_PATH}. This variable
+points to @file{lib/ocaml/site-lib/stubslibs} and this is where @file{.so}
+libraries should be installed.
+@end defvr
+
 @defvr {Scheme Variable} python-build-system
 This variable is exported by @code{(guix build-system python)}.  It
 implements the more or less standard build procedure used by Python
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] document ocaml-build-system
  2017-01-28 11:14 [PATCH] document ocaml-build-system Julien Lepiller
@ 2017-01-28 23:49 ` Ludovic Courtès
  2017-01-29  9:16   ` Julien Lepiller
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2017-01-28 23:49 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: guix-devel

Hi!

Julien Lepiller <julien@lepiller.eu> skribis:

> From 8854480a48e8096bf6bf8d94b3695fb049720038 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Sat, 28 Jan 2017 12:11:42 +0100
> Subject: [PATCH] doc: Document ocaml-build-system.
>
> * doc/guix.texi (Build Systems) [ocaml-build-system]: New definition.

Awesome!  Minor comments:

> +@defvr {Scheme Variable} ocaml-build-system

Write “OCaml” (not “ocaml” or something else), “Guix”, and “OASIS”.

> +This variable is exported by @code{(guix build-sytem ocaml)}.  It is implements

s/is//

> +a build procedure for ocaml packages, which consists of choosing the correct

Since this is the first occurrence: s/ocaml/@uref{https://ocaml.org, OCaml}/

> +was generated by oasis and will take care of setting the prefix and enabling

s/oasis/@uref{http://oasis.forge.ocamlcore.org/, OASIS}/

> +Finaly, some packages do not have these files and use a somewhat standard
       ^
“Finally”

OK with these changes.

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] document ocaml-build-system
  2017-01-28 23:49 ` Ludovic Courtès
@ 2017-01-29  9:16   ` Julien Lepiller
  2017-01-30  9:10     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Lepiller @ 2017-01-29  9:16 UTC (permalink / raw)
  To: guix-devel

pushed. Sorry about the two commits, I forgot to add guix.texi after I
made a last change.

On Sun, 29 Jan 2017 00:49:43 +0100
ludo@gnu.org (Ludovic Courtès) wrote:

> Hi!
> 
> Julien Lepiller <julien@lepiller.eu> skribis:
> 
> > From 8854480a48e8096bf6bf8d94b3695fb049720038 Mon Sep 17 00:00:00
> > 2001 From: Julien Lepiller <julien@lepiller.eu>
> > Date: Sat, 28 Jan 2017 12:11:42 +0100
> > Subject: [PATCH] doc: Document ocaml-build-system.
> >
> > * doc/guix.texi (Build Systems) [ocaml-build-system]: New
> > definition.  
> 
> Awesome!  Minor comments:
> 
> > +@defvr {Scheme Variable} ocaml-build-system  
> 
> Write “OCaml” (not “ocaml” or something else), “Guix”, and “OASIS”.
> 
> > +This variable is exported by @code{(guix build-sytem ocaml)}.  It
> > is implements  
> 
> s/is//
> 
> > +a build procedure for ocaml packages, which consists of choosing
> > the correct  
> 
> Since this is the first occurrence: s/ocaml/@uref{https://ocaml.org,
> OCaml}/
> 
> > +was generated by oasis and will take care of setting the prefix
> > and enabling  
> 
> s/oasis/@uref{http://oasis.forge.ocamlcore.org/, OASIS}/
> 
> > +Finaly, some packages do not have these files and use a somewhat
> > standard  
>        ^
> “Finally”
> 
> OK with these changes.
> 
> Thank you!
> 
> Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] document ocaml-build-system
  2017-01-29  9:16   ` Julien Lepiller
@ 2017-01-30  9:10     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2017-01-30  9:10 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: guix-devel

Julien Lepiller <julien@lepiller.eu> skribis:

> pushed. Sorry about the two commits, I forgot to add guix.texi after I
> made a last change.

No problem, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-30  9:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-28 11:14 [PATCH] document ocaml-build-system Julien Lepiller
2017-01-28 23:49 ` Ludovic Courtès
2017-01-29  9:16   ` Julien Lepiller
2017-01-30  9:10     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).