1 ################################################################################
3 # ocaml.cygclass - functions for installing OCaml packages
5 # Part of cygport - Cygwin packaging application
6 # Copyright (C) 2006-2020 Cygport authors
7 # Provided by the Cygwin project <https://cygwin.com/>
9 # cygport is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # cygport is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with cygport. If not, see <https://www.gnu.org/licenses/>.
22 ################################################################################
24 #****h* Cygclasses/ocaml.cygclass
28 # OCaml (previously known as Objective Caml) is an object-oriented dialect
29 # of the ML programming language. Individual scripts can be run as with
30 # interpreted languages, but most commonly code is compiled into bytecode
31 # and/or stand-alone native code. A number of extension libraries are
32 # available in addition to the standard library.
34 # This cygclass provides definitions for OCaml-based packages, and an install
35 # function for OCaml library packages which use OCAMLFIND.
37 # OCaml bytecode executables, while behaving like an ordinary .exe, cannot be
38 # stripped. Cygport will automatically detect these and will not strip them
39 # during the automatic postinstall phase.
41 # ocaml, ocaml-findlib
44 # cross-compiling is not (yet?) supported
45 __cross_compiling_error
49 #****d* ocaml.cygclass/OCAML
51 # Absolute path to the OCaml interactive toplevel (interpreter).
53 OCAML=$(type -p ocaml)
55 #****d* ocaml.cygclass/OCAMLC
57 # Absolute path to the OCaml byte compiler.
59 OCAMLC=$(type -p ocamlc.opt)
61 #****d* ocaml.cygclass/OCAMLDOC
63 # Absolute path to the OCaml documentation generator.
65 OCAMLDOC=$(type -p ocamldoc.opt)
67 #****d* ocaml.cygclass/OCAMLFIND
69 # Absolute path to the OCaml library package manager.
71 OCAMLFIND=$(type -p ocamlfind)
73 #****d* ocaml.cygclass/OCAMLLEX
75 # Absolute path to the OCaml lexer generator.
77 OCAMLLEX=$(type -p ocamllex.opt)
79 #****d* ocaml.cygclass/OCAMLMKLIB
81 # Absolute path to the OCaml library linker.
83 OCAMLMKLIB=$(type -p ocamlmklib)
85 #****d* ocaml.cygclass/OCAMLMKTOP
87 # Absolute path to the OCaml custom toplevel linker.
89 OCAMLMKTOP=$(type -p ocamlmktop)
91 #****d* ocaml.cygclass/OCAMLOPT
93 # Absolute path to the OCaml native-code compiler.
95 OCAMLOPT=$(type -p ocamlopt.opt)
97 #****d* ocaml.cygclass/OCAML_LIBDIR
99 # Installation path for OCaml included libraries.
101 OCAML_LIBDIR=$(${OCAMLC} -where)
103 #****d* ocaml.cygclass/OCAML_INCLUDEDIR
105 # Absolute path to the directory containing the OCaml C headers.
107 OCAML_INCLUDEDIR=${OCAML_LIBDIR}/caml
109 #****d* ocaml.cygclass/OCAML_SITEDIR
111 # Installation path for OCaml third-party libraries.
113 OCAML_SITEDIR=${OCAML_LIBDIR}
115 #****d* ocaml.cygclass/OCAML_STUBDIR
117 # Installation path for OCaml C stub libraries.
119 OCAML_STUBDIR=${OCAML_LIBDIR}/stublibs
121 #****d* ocaml.cygclass/LIBCAMLRUN
123 # Link flags for the OCaml shared C library.
125 LIBCAMLRUN="-L${OCAML_LIBDIR} -lcamlrun_shared"
127 #****I* ocaml.cygclass/ocaml_install
129 # Defines some variables for OCAMLFIND before calling cyginstall.
132 dodir ${OCAML_STUBDIR}
133 export OCAMLFIND_DESTDIR="${D}${OCAML_LIBDIR}"
134 export OCAMLFIND_LDCONF=ignore
138 #****o* ocaml.cygclass/src_install (ocaml)
146 readonly -f ocaml_install