After starting godi_console type «2» to enter the menu «Select source packages». The list of available and installed packages appears (shown in figure 1.1). You can select (and deselect) packages by entering the number and typing «b» to build the package, «k» to keep the package as it is, or «r» to remove the package (in the corresponding submenu). Finally, press «s» to start the installation, a procedure comprising the following steps:+-------------------------------- GODI Console --------------------------------+
> > > Select Source Packages < < <
FL NAME INSTALLED AVAILABLE COMMENT
==========Packages available as source code:====================================
[ 1] apps-camlmix 1.1 1.1 Processes macros written in pu
[ 2] apps-cduce 0.2.1 0.2.1 XML-oriented functional langua
[ 3] apps-cduce-cvs 20040829 XML-oriented functional langua
[ 4] apps-godiva 0.9.2 0.9.2 High-level tool for simplifyin
[ 5] apps-headache 1.03 1.03 Tool for managing headers in s
[ 6] apps-ledit 1.11 1.11 Line editor wrapper
[ 7] apps-schoca 0.2.0 Scheme interpreter written by
[ 8] apps-unison 2.10.2 2.10.2 File synchronizer
[ 9] base-curl 7.11.2#2 7.11.2#2 The version of CURL for GODI
[ 10] base-expat 1.95.7#3 1.95.7#3 The version of expat for GODI
[ 11] base-gdbm 1.8.3#4 The GNU database manager
[ 12] base-pcre 4.5#1 4.5#1 The version of PCRE for GODI
[ 13] base-subversion-c$ 1.0.6 The subversion client allows d
[ 14] conf-curl 3 3 Configures which curl library
[ 15] conf-expat 6 6 Configures which expat library
[ 16] conf-freetype2 1#1 1#1 Configures which freetype2 lib
----------------------------------------------------------------(more)----------
[p]rev [n]ext [u]pgrade all [s]tart/continue installation [h]elp e[x]it menu
>
SEARCH_LIBS += /opt/phantasyin the global configuration file <PREFIX>/etc/godi.conf. This parameter is respected by most packages that need external libraries (but not by all, as there are other, incompatible methods of looking up libraries, see below).
GODI_BASEPKG_PCRE=yesThe rest is again fully automatic.
$ ocamlFor example, define the faculty function as (note that the # at the beginngin of the line is the prompt symbol, and that the ;; at the end of the line indicates the end of the user input):
Objective Caml version 3.08.1
#
# let rec fac n = if n <= 1 then 1 else n * fac(n-1);;The toploop answers with:
val fac : int -> int = <fun>This means that fac is a function taking integers as input, and returning integers as results. Call the function as
# fac 10;;and you get the result 3628800. Of course, we cannot give here an introduction into the O'Caml language, so we stop here. It is recommended to install the package godi-ocaml-manual which includes both introductory and reference documentation of the O'Caml language. The installed manual can be found in the directory <PREFIX>/doc/godi-ocaml-manual.
$ ledit ocamlThis enables a number of keys (cursor keys, delete key, etc.).
#use "topfind";;This installs a number of additional toploop directives:
#require "pxp";;loads the XML parser PXP into the toploop, including all predecessor libraries PXP is dependent on.
Cannot load required shared library:The workaround is to create a custom toploop that statically links the needed libraries. For example, to create a custom toploop with support for PXP, run the command
dynamic loading not supported on this platform.
$ ocamlfind ocamlmktop -o mytop -package pxp,findlib -linkpkgwhich creates a toploop program called mytop which can be used instead of the pre-built toploop ocaml. Note that findlib must always be mentioned as package. The toploop mytop has already built-in support for findlib, so you need not to «#use» topfind at the beginning of every session. The «#require» directive for PXP is still necessary, however.
$ ocamlfind ocamlc -c sample.ml -package pxpWhen linking executables, the option -linkpkg must be passed to indicate that the libraries must be linked, too:
$ ocamlfind ocamlc -o sample sample.cmo -package pxp -linkpkgThe tool ocamlfind can also be used as wrapper for ocamlcp, ocamlopt, ocamlmktop, ocamldep, ocamldoc, and ocamlbrowser. The latter is very convenient to browse the interfaces of add-on libraries, e.g. to view the definitions of PXP, run
$ ocamlfind ocamlbrowser -package pxp-engine(Note that we refer to pxp-engine, and not pxp, as the latter is only an empty pseudo package, and the ocamlbrowser call does not resolve dependencies.)
$ ocamlfind ocamlc ... -syntax camlp4oThis enables camlp4 with standard syntax. Replace camlp4r for camlp4o to get the revised syntax. The interesting feature of ocamlfind is that one can easily specify camlp4 extensions. For example, to get the xstrp4 extension, just use
$ ocamlfind ocamlc ... -syntax camlp4o -package xstrp4i.e. add such extensions simply to the list of included packages.
GODI_FINDLIB_TOOLBOX = yesand rebuild findlib. You will also need godi-ocaml-labltk (and thus tcl/tk) in order to build this special version of findlib (which is the reason why this option is disabled by default). The result is that the «Makefile wizard» is included in the findlib package. Call the wizard with
$ ocamlfind findlib/make_wizardand follow the instructions in the new window that pops up.
ScriptAlias /godi-bin <PREFIX>/doc/cgi-bininto the configuration file httpd.conf, and to restart the web server. The CGI becomes visible under the URL http://servername/godi-bin/browser.cgi. There are also other ways of configuring Apache for this purpose.
<directory <PREFIX>/doc/cgi-bin>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</directory>
description = "The library foo"and is seldom more complicated.
version = "1.0"
archive(byte) = "foo.cma"
archive(native) = "foo.cmxa"
cd <PREFIX>/build/packages/AllSometimes this does not work, however, because the old package is not compatible with the current set of predecessor or successor packages (godi_add reports a conflict). You can try to replace the problematic packages by historic versions, too, but this is a very complex task, and it is even unclear whether it is possible at all. As explained in section 4.3, package files may be overwritten in certain circumstances, and this means that the required old files might be lost.
godi_add -u <NAME>.tgz
cd <PREFIX>/buildAfter that, at least the build instructions of the older release are downloaded, and you can start to build packages. You might still encounter strange effects, though, because package downgrades are a somewhat hairy operation, as necessary information about compatibility between old and new packages are missing.
rm -rf apps/* base/* conf/* godi/*
<PREFIX>/build/<CAT>/<CAT>-<NAME>You find here the following files and directories:
godi_make configurecontinues the build process until at least the configure stage is reached.
pre-configure:causes that these commands are executed before the predefined actions of the configure stage. In the same way, a post-configure rule would be executed after the predefined actions of the configure stage.
<commands>
.include "../../mk/bsd.prefs.mk"Of course, this is only rarely enough, but often only a few additions are needed. We will discuss possible additions below. The «.include» directives are mandatory, and load the rest of the build framework. The variables have this meaning:
VERSION= ...
PKGNAME= ...-${VERSION}
PKGREVISION= ...
DISTNAME=...
DISTFILES=....tar.gz
CATEGORIES=...
MASTER_SITES= ...
MAINTAINER=...
HOMEPAGE=...
COMMENT=...
.include "../../mk/bsd.pkg.mk"
patch-<letter><letter>-<info>where the two letters define the order in which the patches are applied. The info suffix is just a descriptive string, e.g. one can mention the patched file (if it is only one file).
CONFIGURE_ARGS="word1 word2" word3passes two arguments to the script where the first one is composed of two words.
CONFIGURE_ARGS=-prefix ${LOCALBASE:Q}so LOCALBASE is here always an argument of its own.
CONFIGURE_ARGS+=-prefix ${LOCALBASE:Q}This operator appends the new value to the already existing list, and ensures that there is a space character as separator.
CONFIGURE_ARGS+=-with-foo
CONFIGURE_ENV+=var=valuewhere var is the name of the variable, and value the new value.
MAKE_ENV+=var=valuewhere var is the name of the variable, and value the new value.
.if ${GODI_HAVE_OCAMLOPT} == "yes"(or some variation). The variable GODI_HAVE_OCAMLOPT expands to yes when the ocamlopt compiler is available, and to no otherwise. (Note that there are some more variables that describe the properties of the O'Caml core, see the variable reference.)
ALL_TARGET= all opt
.else
ALL_TARGET= all
.endif
MAKE_ENV+= ${BUILD_OCAMLFIND_ENV}If forgotten, it may happen that the build fails because a required library is not found, or in the wrong version.
post-install:There are a number of further variables here:
${MKDIR} ${PREFIX}/doc/godi-getopt
${CP} ${WRKSRC}/README ${WRKSRC}/COPYING
${PREFIX}/doc/godi-getopt
../../<CATEGORY>/<BASENAME>where <CATEGORY> is the category prefix of <BASENAME> (apps, godi, etc.). The <PATH> is the relative path where to find the build directory of the package one refers to.
bin/fooThis one-liner means that the package consists only of the executable bin/foo. Filenames are relative to the installation prefix of GODI, and it is an error to use absolute path names.
lib/foo/bar.txtAs lib is again shared, it is not necessary to add another @dirrm directive for it. These directives should come after the files contained in the directories, and when private directories occur within private directories, the @dirrm directives must be in the order such that the inner directory comes first. (As you guess it, at package deletion time the PLIST is just interpreted line by line from top to bottom, and the removal actions are performed in this order.)
lib/foo/baz.a
@dirrm lib/foo
.include "../../mk/bsd.prefs.mk"The corresponding PLIST file:
VERSION= 0.2.1
PKGNAME= godi-xstr-${VERSION}
DISTNAME= xstr
DISTFILES= xstr-${VERSION}.tar.gz
CATEGORIES= godi
MASTER_SITES= http://ocaml-programming.de/packages/
MAINTAINER= gerd@gerd-stolpmann.de
HOMEPAGE= http://ocaml-programming.de
COMMENT= additional string functions
DEPENDS+= godi-ocaml>=3.06:../../godi/godi-ocaml
BUILD_DEPENDS+= godi-findlib>=0.8.1:../../godi/godi-findlib
MAKE_ENV+= ${BUILD_OCAMLFIND_ENV}
USE_GMAKE= yes
ALL_TARGET= all
.if ${GODI_HAVE_OCAMLOPT} == "yes"
ALL_TARGET+= opt
.endif
post-install:
${MKDIR} ${LOCALBASE}/doc/godi-xstr
. for F in README LICENSE
${CP} ${WRKSRC}/${F} ${LOCALBASE}/doc/godi-xstr
. endfor
.include "../../mk/bsd.pkg.mk"
@findlib xstr
doc/godi-xstr/README
doc/godi-xstr/LICENSE
@dirrm doc/godi-xstr
svn checkout https://gps.dynxs.de/svn/godi-buildOf course, you need an account to modify any of the files. If you had one, you could do the following:
This document was translated from LATEX by HEVEA.