ocaml: patches needed

Yaakov (Cygwin/X) yselkowitz@users.sourceforge.net
Mon Oct 11 06:17:00 GMT 2010


Damien,

Thanks for updating OCaml to use FlexDLL.  There are some further
patches required for a fully-functional OCaml:

1) libcamlrun_shared is not a dynlink module, it is a
dynamically-linkable OCaml interpreter (similar to libperl or libpython)
to be used by mod_ocaml.  Therefore, it must be a DLL installed
into /usr/bin with only an import lib in /usr/lib/ocaml.

2) ocamlmktop is a script, not a program, so it must not have an .exe
suffix.

3) On Cygwin we use *NIX APIs, not Win32 ones, and ocaml is coded to
work with either.  Therefore the _WIN32 define must be removed for
Cygwin so that the correct APIs are used.

As for the packaging, there are several enhancements which I would
suggest:

1) install the emacs mode;
2) package camlp4 separately due to its size;
3) install the compiler libs, packaged separately;
4) strip the libcamlrun_shared DLL and /usr/bin/*.opt.exe native
executables.

A .cygport for 3.12.0 which does all these things is attached.  All
these files are also available from Ports git:

http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/ports;a=tree;f=lang/ocaml

HTH,


Yaakov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3.11.1-libcamlrun_shared.patch
Type: text/x-patch
Size: 1168 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20101011/b95059c6/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3.11.2-exeext.patch
Type: text/x-patch
Size: 543 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20101011/b95059c6/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3.11.2-not-win32.patch
Type: text/x-patch
Size: 521 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20101011/b95059c6/attachment-0002.bin>
-------------- next part --------------
DESCRIPTION="Objective Caml interpreter"
HOMEPAGE="http://caml.inria.fr/ocaml/"
SRC_URI="http://caml.inria.fr/pub/distrib/ocaml-${PV_MAJ_MIN}/${P}.tar.bz2"
PATCH_URI="
	3.11.2-not-win32.patch
	3.11.1-libcamlrun_shared.patch
	3.11.2-exeext.patch
"

OCAML_LIBDIR=/usr/lib/ocaml

PKG_NAMES="${PN} ${PN}-camlp4 ${PN}-compiler-libs emacs-caml"
PKG_HINTS="setup camlp4 compiler-libs labltk emacs"
ocaml_CONTENTS="--exclude=*camlp4* --exclude=compiler-libs --exclude=labltk
                --exclude=dll*tk*.so --exclude=emacs usr/"
ocaml_camlp4_CONTENTS="usr/bin/*camlp4* ${OCAML_LIBDIR#/}/camlp4/"
ocaml_compiler_libs_CONTENTS="${OCAML_LIBDIR#/}/compiler-libs/"
#ocaml_labltk_CONTENTS="usr/bin/labltk ${OCAML_LIBDIR#/}/labltk/
#                       ${OCAML_LIBDIR#/}/stublibs/dll*tk*.so"
emacs_caml_CONTENTS="usr/share/emacs/"

src_compile() {
	lndirs
	cd ${B}
	./configure \
		-prefix /usr \
		-bindir /usr/bin \
		-libdir ${OCAML_LIBDIR} \
		-mandir /usr/share/man \
		-cc "${CC}" \
		-with-pthread \
		|| error "configure failed"
	cygmake -j1 world opt opt.opt # ocamlnat
	cygmake -C emacs ocamltags
}

src_test() { :; }

src_install() {
	cd ${B}
	cyginstall -j1 \
		BINDIR=${D}/usr/bin \
		LIBDIR=${D}${OCAML_LIBDIR} \
		MANDIR=${D}/usr/share/man

	cygmake -j1 -C emacs install-ocamltags simple-install \
		BINDIR=${D}/usr/bin \
		EMACSDIR=${D}/usr/share/emacs/site-lisp

	# http://alain.frisch.fr/natdynlink.html#topl
#	dobin ocamlnat.exe

	# Install the compiler libs
	for d in parsing typing utils
	do
		insinto ${OCAML_LIBDIR}/compiler-libs/${d}
		doins ${d}/*.{mli,cmi,cmo,cmx,o}
	done

	# Symlink the headers to the right place
	dodir /usr/include
	dosym ../${OCAML_LIBDIR#/usr/}/caml /usr/include/caml

	# Remove ${D} from ld.conf, as the buildsystem isn't $(DESTDIR) aware
	sed -i -e "s:${D}::g" ${D}${OCAML_LIBDIR}/ld.conf

	dodoc Updating

	# These are false positives with the 'Caml1999X008' file magic test
	strip ${D}/usr/bin/*.{dll,opt.exe}
}

-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list