From 15f93e6560405123cad7f93b6b13552c60c696ce Mon Sep 17 00:00:00 2001 From: Stanislav Sedov Date: Mon, 19 May 2008 07:05:35 +0000 Subject: [PATCH] - Add a knob to generate pkg-plist for ocaml findlib ports automatically. Now if USE_OCAMLFIND_PLIST is defined all files under findlib target directories will be added to pkg-plist and thus requires no entries in static pkg-plist. This is important since a number of ocaml ports install its package files conditionally depending on platform and ocaml configurations and thus static entries are not possible. PR: ports/122844 (based on) Submitted by: Jaap Boender --- Mk/bsd.ocaml.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Mk/bsd.ocaml.mk b/Mk/bsd.ocaml.mk index 5ae0e7a1d334..e92624bc699b 100644 --- a/Mk/bsd.ocaml.mk +++ b/Mk/bsd.ocaml.mk @@ -1,7 +1,7 @@ # ex:ts=4 # # $MBSDlabs: portmk/bsd.ocaml.mk,v 1.18 2006/08/06 18:47:23 stas Exp $ -# $FreeBSD: /tmp/pcvs/ports/Mk/bsd.ocaml.mk,v 1.2 2008-04-19 17:46:02 miwi Exp $ +# $FreeBSD: /tmp/pcvs/ports/Mk/bsd.ocaml.mk,v 1.3 2008-05-19 07:05:35 stas Exp $ # # bsd.ocaml.mk - Support for the Objective Caml language packages # @@ -20,6 +20,8 @@ # USE_OCAML_LDCONFIG - Set if your port installs shared libraries # into ocaml site-lib dir. OCaml ld.conf file # will be automatically processed. +# USE_OCAMLFIND_PLIST - Add contents of findlib target directories +# automatically. # USE_OCAML_WASH - Set if your port wants to automatically # purge shared Ocaml dirs on uninstall. It's # useful when installing to non-standard PREFIX @@ -122,6 +124,10 @@ pre-install-script: . if !target(ocaml-findlib) ocaml-findlib: . for DIR in ${OCAML_PKGDIRS} +. if defined(USE_OCAMLFIND_PLIST) + @${FIND} ${PREFIX}/${OCAML_SITELIBDIR}/${DIR}/ -type f -print | ${SED} -e \ + 's,^${PREFIX}/,,' >> ${TMPPLIST} +. endif @${ECHO_CMD} "@unexec rmdir %D/${OCAML_SITELIBDIR}/${DIR} 2>/dev/null || true" >> ${TMPPLIST} @${ECHO_CMD} "@unexec ${OCAMLFIND} remove ${DIR} 2>/dev/null" \ >> ${TMPPLIST}