ports/101100: [NEW PORT] devel/ocaml-camlidl: A stub code generator for using C/C++ libraries from ocaml

Stanislav Sedov ssedov at mbsd.msk.ru
Mon Jul 31 14:20:15 UTC 2006


>Number:         101100
>Category:       ports
>Synopsis:       [NEW PORT] devel/ocaml-camlidl: A stub code generator for using C/C++ libraries from ocaml
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 31 14:20:09 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Stanislav Sedov
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
MBSD labs, Inc.
>Environment:
System: FreeBSD fonon.realnet 7.0-CURRENT FreeBSD 7.0-CURRENT #7: Sun Jun 18 20:51:36 MSD 2006
>Description:
CamlIDL is a stub code generator and COM binding for Objective Caml.

CamlIDL comprises two parts:

	* A stub code generator that generates the C stub code required for the
Caml/C interface, based on an MIDL specification. (MIDL stands for Microsoft's
Interface Description Language; it looks like C header files with some extras
annotations, plus a notion of object interfaces that look like C++ classess
without inheritance.)

	* A (currently small) library of functions and tools to import COM
components in Caml applications, and export Caml code as COM components. 

WWW:	http://caml.inria.fr/pub/old_caml_site/camlidl/

I've decided to add bsd.ocaml.mk to ditribution, since it was't committed to
HEAD yet.

>How-To-Repeat:
>Fix:

--- ocaml-camlidl-1.05.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	ocaml-camlidl
#	ocaml-camlidl/pkg-descr
#	ocaml-camlidl/Makefile
#	ocaml-camlidl/pkg-plist
#	ocaml-camlidl/bsd.ocaml.mk
#	ocaml-camlidl/distinfo
#
echo c - ocaml-camlidl
mkdir -p ocaml-camlidl > /dev/null 2>&1
echo x - ocaml-camlidl/pkg-descr
sed 's/^X//' >ocaml-camlidl/pkg-descr << 'END-of-ocaml-camlidl/pkg-descr'
XCamlIDL is a stub code generator and COM binding for Objective Caml.
X
XCamlIDL comprises two parts:
X
X	* A stub code generator that generates the C stub code required for the
XCaml/C interface, based on an MIDL specification. (MIDL stands for Microsoft's
XInterface Description Language; it looks like C header files with some extras
Xannotations, plus a notion of object interfaces that look like C++ classess
Xwithout inheritance.)
X
X	* A (currently small) library of functions and tools to import COM
Xcomponents in Caml applications, and export Caml code as COM components. 
X
XWWW:	http://caml.inria.fr/pub/old_caml_site/camlidl/
END-of-ocaml-camlidl/pkg-descr
echo x - ocaml-camlidl/Makefile
sed 's/^X//' >ocaml-camlidl/Makefile << 'END-of-ocaml-camlidl/Makefile'
X# New ports collection makefile for:	camlidl
X# Date created:		2006-07-31
X# Whom:			Stanislav Sedov <ssedov at mbsd.msk.ru>
X#
X# $MBSDlabs$
X# $FreeBSD$
X#
X
XPORTNAME=	camlidl
XPORTVERSION=	1.05
XCATEGORIES=	devel
XMASTER_SITES=	http://caml.inria.fr/distrib/bazar-ocaml/
XPKGNAMEPREFIX=	ocaml-
XDISTFILES+=	${PORTNAME}-${PORTVERSION}.doc.html.tar.gz
XEXTRACT_ONLY=	${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}
X
XMAINTAINER=	ssedov at mbsd.msk.ru
XCOMMENT=	A stub code generator for using C/C++ libraries from ocaml
X
XUSE_OCAML=	yes
XPORTDOCS=	*
X
XMASTERPORT=	${PORTSDIR}/devel/ocaml-camlidl
X
X.include <bsd.port.pre.mk>
X.include "${MASTERPORT}/bsd.ocaml.mk"
X
Xpost-extract:
X	@${REINPLACE_CMD} -e "s,^\(OCAMLLIB=\).*,\1${PREFIX}/lib/ocaml,g" \
X		-e "s,^\(BINDIR=\).*,\1${PREFIX}/bin,g" \
X		-e "s,^CFLAGS=.*,#\&,g" \
X		-e "s,^\(CPP=\).*,\1/usr/bin/cpp,g" \
X		${WRKSRC}/config/Makefile.unix
X
X	@${REINPLACE_CMD} -e \
X		"/^install/,/^$$/s,\([ \t]*\)cp,\1${INSTALL_SCRIPT},g" \
X		${WRKSRC}/compiler/Makefile
X
X	@${REINPLACE_CMD} -e \
X		"/^install/,/^$$/s,\([ \t]*\)cp,\1${INSTALL_DATA},g" \
X		${WRKSRC}/lib/Makefile ${WRKSRC}/runtime/Makefile.unix
X
X	@${LN} -sf ${WRKSRC}/config/Makefile.unix ${WRKSRC}/config/Makefile
X
Xpre-install:
X.if !exists(${PREFIX}/lib/ocaml)
X	${MKDIR} ${PREFIX}/lib/ocaml
X	@${ECHO_CMD} "@dirrm lib/ocaml" >> ${TMPPLIST}
X.endif
X
X.if !exists(${PREFIX}/lib/ocaml/caml)
X	${MKDIR} ${PREFIX}/lib/ocaml/caml
X	@${ECHO_CMD} "@dirrm lib/ocaml/caml" >> ${TMPPLIST}
X.endif
X
Xpost-install:
X.if !defined(NOPORTDOCS)
X	${MKDIR} ${DOCSDIR}
X	${TAR} -C ${DOCSDIR} -xf \
X		${_DISTDIR}/${PORTNAME}-${PORTVERSION}.doc.html.tar.gz
X	${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DOCSDIR}
X	${FIND} ${DOCSDIR}/ -type f -exec chmod ${SHAREMODE} {} \;
X.endif
X
Xtest:
X	@${ECHO_CMD} "Testing IDL library"
X	@${REINPLACE_CMD} -e "s,^\(CCPP=\).*,\1${CXX},g" \
X		${WRKSRC}/tests/Makefile
X	cd ${WRKSRC}/tests && ${SETENV} ${MAKE_ENV} ${MAKE} all
X
X.include <bsd.port.post.mk>
END-of-ocaml-camlidl/Makefile
echo x - ocaml-camlidl/pkg-plist
sed 's/^X//' >ocaml-camlidl/pkg-plist << 'END-of-ocaml-camlidl/pkg-plist'
Xbin/camlidl
Xlib/ocaml/caml/camlidlruntime.h
Xlib/ocaml/com.a
Xlib/ocaml/com.cma
Xlib/ocaml/com.cmi
Xlib/ocaml/com.cmxa
Xlib/ocaml/libcamlidl.a
END-of-ocaml-camlidl/pkg-plist
echo x - ocaml-camlidl/bsd.ocaml.mk
sed 's/^X//' >ocaml-camlidl/bsd.ocaml.mk << 'END-of-ocaml-camlidl/bsd.ocaml.mk'
X# ex:ts=4
X#
X# $MBSDlabs: portmk/bsd.ocaml.mk,v 1.14 2006/07/29 18:54:54 stas Exp $
X# $FreeBSD$
X#
X# bsd.ocaml.mk - Support for the Objective Caml language packages
X#
X# Author: Stanislav Sedov <ssedov at mbsd.msk.ru>
X#
X# Feel free to send any comments and suggestions to maintainer.
X#
X# Currently recognised variables are:
X#
X# USE_OCAML		-	Set if your port uses OCaml to build/install.
X# NO_OCAML_BUILDDEPENDS	-	Don't add ocamlc to BUILD|EXTRACT|PATCH_DEPENDS.
X# NO_OCAML_RUNDEPENDS	-	Don't add ocamlc to RUN_DEPENDS.
X# USE_OCAML_FINDLIB	-	Set if your port uses ocamlfind to install
X#				packages. Package direcories will be
X#				automatically deleted.
X# USE_OCAML_LDCONFIG	-	Set if your port installs shared libraries
X#				into ocaml site-lib dir. OCaml ld.conf file
X#				will be automatically processed.
X# OCAML_PKGDIRS		-	Directories under site-lib to be processed
X#				if USE_OCAML_FINDLIB specified.
X#				Default: ${PORTNAME}
X# OCAML_LDLIBS		-	Directories under PREFIX to be automatically
X#				added/removed from ld.conf
X#				Default: ${OCAML_SITELIBDIR}/${PORTNAME}
X
X.if !defined(OCAML_include)
X
XOCAML_MAINTAINER=	ssedov at mbsd.msk.ru
XOCAML_include=		bsd.ocaml.mk
X
X#
X# OCaml programs location
X#
XOCAMLC?=		${LOCALBASE}/bin/ocamlc
XOCAMLC_OPT?=		${LOCALBASE}/bin/ocamlc.opt
XOCAMLCP?=		${LOCALBASE}/bin/ocamlcp
XOCAMLFIND?=		${LOCALBASE}/bin/ocamlfind
X
X#
X# Where to install site libraries
X#
XOCAML_SITELIBDIR?=	lib/ocaml/site-lib
X
X#
X# OCaml compiler port dependency
X#
XOCAMLC_PORT?=		${PORTSDIR}/lang/ocaml
XOCAMLC_DEPEND?=		${OCAMLC}:${OCAMLC_PORT}
X
X#
X# OCaml package manager port dependency
X#
XOCAMLFIND_PORT?=	${PORTSDIR}/devel/ocaml-findlib
XOCAMLFIND_DEPEND?=	${OCAMLFIND}:${OCAMLFIND_PORT}
X
X#
X# Location of OCaml ld.conf file
X#
XOCAML_LDCONF?=		lib/ocaml/ld.conf
X
XOCAMLFIND_DESTDIR?=	${PREFIX}/${OCAML_SITELIBDIR}
XOCAMLFIND_LDCONF?=	${PREFIX}/${OCAML_LDCONF}
X
X.if defined(USE_OCAML)
X. if !defined(NO_OCAML_BUILDDEPENDS)
XEXTRACT_DEPENDS+=	${OCAMLC_DEPEND}
XPATCH_DEPENDS+=		${OCAMLC_DEPEND}
XBUILD_DEPENDS+=		${OCAMLC_DEPEND}
X. endif
X. if !defined(NO_OCAML_RUNDEPENDS)
XRUN_DEPENDS+=		${OCAMLC_DEPEND}
X. endif
XPLIST_SUB+=	OCAML_SITELIBDIR="${OCAML_SITELIBDIR}"
X.endif
X
X.if defined(USE_OCAML_FINDLIB) || defined(USE_OCAML_LDCONFIG)
X. if !target(post-install-script)
Xpost-install-script: ocaml-findlib ocaml-ldconfig
X. endif
X.endif
X
X.if defined(USE_OCAML_FINDLIB)
X#
X# We'll additionally add ocamlfind to RUN_DEPENDS, since
X# if the port requires ocamlfind to install - it requires
X# some ocaml libraries and these libraries RUN_DEPENDS on
X# ocamlfind
X#
XBUILD_DEPENDS+=		${OCAMLFIND_DEPEND}
XRUN_DEPENDS+=		${OCAMLFIND_DEPEND}
XMAKE_ENV+=	OCAMLFIND_DESTDIR="${OCAMLFIND_DESTDIR}" \
X		OCAMLFIND_LDCONF="${OCAMLFIND_LDCONF}"
X
X#
X# Directories under site-lib to process automatically
X#
XOCAML_PKGDIRS?=	${PORTNAME}
X. if !target(pre-install-script)
Xpre-install-script:
X.if !exists(${OCAMLFIND_DESTDIR})
X	@${MKDIR} "${PREFIX}/${OCAML_SITELIBDIR}"
X.endif
X. endif
X. if !target(ocaml-findlib)
Xocaml-findlib:
X.  for DIR in ${OCAML_PKGDIRS}
X	@${ECHO_CMD} "@unexec rmdir %D/${OCAML_SITELIBDIR}/${DIR} 2>/dev/null || true" >> ${TMPPLIST}
X	@${ECHO_CMD} "@unexec ${OCAMLFIND} remove ${DIR} 2>/dev/null" \
X		>> ${TMPPLIST}
X.  endfor
X. endif
X.endif
X
X.if defined(USE_OCAML_LDCONFIG)
X#
X# Directories under PREFIX for appending to ld.conf
X#
XOCAML_LDLIBS?=	${OCAML_SITELIBDIR}/${PORTNAME}
X. if !target(ocaml-ldconfig)
Xocaml-ldconfig:
X.  for LIB in ${OCAML_LDLIBS}
X	@${ECHO_CMD} "${PREFIX}/${LIB}" >> "${PREFIX}/${OCAML_LDCONF}"
X	@${ECHO_CMD} "@exec ${ECHO_CMD} "%D/${LIB}" >> %D/${OCAML_LDCONF}" \
X		>> ${TMPPLIST}
X	@${ECHO_CMD} "@unexec ${SED} -i \"\" -e '/${LIB:S#/#\/#g}/d' %D/${OCAML_LDCONF}"  >> ${TMPPLIST}
X.  endfor
X. endif
X.endif
X
X.if !target(ocaml-findlib)
Xocaml-findlib:
X	@${DO_NADA}
X.endif
X
X.if !target(ocaml-ldconfig)
Xocaml-ldconfig:
X	@${DO_NADA}
X.endif
X
X.endif
END-of-ocaml-camlidl/bsd.ocaml.mk
echo x - ocaml-camlidl/distinfo
sed 's/^X//' >ocaml-camlidl/distinfo << 'END-of-ocaml-camlidl/distinfo'
XMD5 (camlidl-1.05.doc.html.tar.gz) = b7c7dad3ba62ddcc0f687bdebe295126
XSHA256 (camlidl-1.05.doc.html.tar.gz) = 00ac7822ec73cb3cb5cb23b5d34879436366d979887eb3a312e1adcae8c1c32c
XSIZE (camlidl-1.05.doc.html.tar.gz) = 45945
END-of-ocaml-camlidl/distinfo
exit
--- ocaml-camlidl-1.05.shar ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list