all messages for Guix-related lists mirrored at yhetil.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

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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.