diff options
author | Wael Nasreddine <wael.nasreddine@gmail.com> | 2019-03-08 21:07:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-08 21:07:11 -0800 |
commit | a7f4fd00149d30651d1b16f708a95e5b76950d63 (patch) | |
tree | 188709a40edd03fac4b2770e4f128d049696549c /doc/languages-frameworks/ocaml.xml | |
parent | b7ebfec61f2f93e922ecdff60ac80a08e911b443 (diff) |
doc: format the documentation (#57102)
Diffstat (limited to 'doc/languages-frameworks/ocaml.xml')
-rw-r--r-- | doc/languages-frameworks/ocaml.xml | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/doc/languages-frameworks/ocaml.xml b/doc/languages-frameworks/ocaml.xml index ea077061680..0deadf2edd0 100644 --- a/doc/languages-frameworks/ocaml.xml +++ b/doc/languages-frameworks/ocaml.xml @@ -4,39 +4,38 @@ <title>OCaml</title> <para> - OCaml libraries should be installed in - <literal>$(out)/lib/ocaml/${ocaml.version}/site-lib/</literal>. Such - directories are automatically added to the <literal>$OCAMLPATH</literal> - environment variable when building another package that depends on them - or when opening a <literal>nix-shell</literal>. + OCaml libraries should be installed in + <literal>$(out)/lib/ocaml/${ocaml.version}/site-lib/</literal>. Such + directories are automatically added to the <literal>$OCAMLPATH</literal> + environment variable when building another package that depends on them or + when opening a <literal>nix-shell</literal>. </para> <para> - Given that most of the OCaml ecosystem is now built with dune, - nixpkgs includes a convenience build support function called - <literal>buildDunePackage</literal> that will build an OCaml package - using dune, OCaml and findlib and any additional dependencies provided - as <literal>buildInputs</literal> or <literal>propagatedBuildInputs</literal>. + Given that most of the OCaml ecosystem is now built with dune, nixpkgs + includes a convenience build support function called + <literal>buildDunePackage</literal> that will build an OCaml package using + dune, OCaml and findlib and any additional dependencies provided as + <literal>buildInputs</literal> or <literal>propagatedBuildInputs</literal>. </para> <para> - Here is a simple package example. It defines an (optional) attribute - <literal>minimumOCamlVersion</literal> that will be used to throw a - descriptive evaluation error if building with an older OCaml is attempted. - It uses the <literal>fetchFromGitHub</literal> fetcher to get its source. - It sets the <literal>doCheck</literal> (optional) attribute to - <literal>true</literal> which means that tests will be run with - <literal>dune runtest -p angstrom</literal> after the build - (<literal>dune build -p angstrom</literal>) is complete. - It uses <literal>alcotest</literal> as a build input (because it is needed - to run the tests) and <literal>bigstringaf</literal> and - <literal>result</literal> as propagated build inputs (thus they will also - be available to libraries depending on this library). - The library will be installed using the <literal>angstrom.install</literal> - file that dune generates. + Here is a simple package example. It defines an (optional) attribute + <literal>minimumOCamlVersion</literal> that will be used to throw a + descriptive evaluation error if building with an older OCaml is attempted. It + uses the <literal>fetchFromGitHub</literal> fetcher to get its source. It + sets the <literal>doCheck</literal> (optional) attribute to + <literal>true</literal> which means that tests will be run with <literal>dune + runtest -p angstrom</literal> after the build (<literal>dune build -p + angstrom</literal>) is complete. It uses <literal>alcotest</literal> as a + build input (because it is needed to run the tests) and + <literal>bigstringaf</literal> and <literal>result</literal> as propagated + build inputs (thus they will also be available to libraries depending on this + library). The library will be installed using the + <literal>angstrom.install</literal> file that dune generates. </para> - <programlisting> +<programlisting> { stdenv, fetchFromGitHub, buildDunePackage, alcotest, result, bigstringaf }: buildDunePackage rec { @@ -66,14 +65,14 @@ buildDunePackage rec { </programlisting> <para> - Here is a second example, this time using a source archive generated with - <literal>dune-release</literal>. It is a good idea to use this archive when - it is available as it will usually contain substituted variables such as a - <literal>%%VERSION%%</literal> field. This library does not depend - on any other OCaml library and no tests are run after building it. + Here is a second example, this time using a source archive generated with + <literal>dune-release</literal>. It is a good idea to use this archive when + it is available as it will usually contain substituted variables such as a + <literal>%%VERSION%%</literal> field. This library does not depend on any + other OCaml library and no tests are run after building it. </para> - <programlisting> +<programlisting> { stdenv, fetchurl, buildDunePackage }: buildDunePackage rec { @@ -95,5 +94,4 @@ buildDunePackage rec { }; } </programlisting> - </section> |