diff options
author | jaapb <jaapb> | 2016-06-17 08:53:42 +0000 |
---|---|---|
committer | jaapb <jaapb> | 2016-06-17 08:53:42 +0000 |
commit | c80492da048a4fe66203e25d4dcf4bbe38939bf7 (patch) | |
tree | dc4933fd39bc14df7cf1085ed6001ddc350c9527 /mk | |
parent | 1217217ba0117f7721ac511fb3378c069987a4e9 (diff) | |
download | pkgsrc-c80492da048a4fe66203e25d4dcf4bbe38939bf7.tar.gz |
Two fixes to the ocaml-findlib-register pkginstall fragment:
- set a sensible default for OCAML_FINDLIB_DIRS (and factorise out
OCAML_SITELIBDIR)
- make it possible not to register any directory by setting
OCAML_FINDLIB_REGISTER to no
Diffstat (limited to 'mk')
-rw-r--r-- | mk/ocaml.mk | 4 | ||||
-rw-r--r-- | mk/pkginstall/bsd.pkginstall.mk | 17 | ||||
-rw-r--r-- | mk/pkginstall/ocaml-findlib-register | 8 |
3 files changed, 16 insertions, 13 deletions
diff --git a/mk/ocaml.mk b/mk/ocaml.mk index 1b9ab9a0519..0c46c51d993 100644 --- a/mk/ocaml.mk +++ b/mk/ocaml.mk @@ -1,4 +1,4 @@ -# $NetBSD: ocaml.mk,v 1.8 2016/05/06 14:13:23 jaapb Exp $ +# $NetBSD: ocaml.mk,v 1.9 2016/06/17 08:53:42 jaapb Exp $ # # This Makefile fragment handles the common variables used by OCaml packages. # @@ -108,7 +108,7 @@ PRINT_PLIST_AWK+= { gsub(/${OCAML_SITELIBDIR:S|/|\\/|g}/, \ .if ${OCAML_USE_FINDLIB} == "yes" .include "../../devel/ocaml-findlib/buildlink3.mk" INSTALLATION_DIRS+= ${OCAML_SITELIBDIR} -OCAML_FINDLIB_DIRS?= ${OCAML_SITELIBDIR}/${PKGBASE} +OCAML_FINDLIB_DIRS?= ${PKGBASE:S/^ocaml-//} OCAML_FINDLIB_REGISTER?= yes .endif diff --git a/mk/pkginstall/bsd.pkginstall.mk b/mk/pkginstall/bsd.pkginstall.mk index 53214ba9c7f..89fea92cfc1 100644 --- a/mk/pkginstall/bsd.pkginstall.mk +++ b/mk/pkginstall/bsd.pkginstall.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkginstall.mk,v 1.68 2016/04/12 16:01:06 jaapb Exp $ +# $NetBSD: bsd.pkginstall.mk,v 1.69 2016/06/17 08:53:42 jaapb Exp $ # # This Makefile fragment is included by bsd.pkg.mk and implements the # common INSTALL/DEINSTALL scripts framework. To use the pkginstall @@ -792,22 +792,22 @@ _INSTALL_UNPACK_TMPL+= ${_INSTALL_OFR_FILE} ${_INSTALL_OFR_FILE}: ../../mk/pkginstall/ocaml-findlib-register ${RUN}${MKDIR} ${.TARGET:H} -.if defined(OCAML_FINDLIB_REGISTER) +.if !empty(OCAML_FINDLIB_REGISTER:M[Yy][Ee][Ss]) ${RUN}${SED} ${FILES_SUBST_SED} \ ../../mk/pkginstall/ocaml-findlib-register > ${.TARGET} .else - ${RUN} ${RM} -f ${.TARGET}; \ + ${RUN}${RM} -f ${.TARGET}; \ ${TOUCH} ${TOUCH_ARGS} ${.TARGET} .endif .PHONY: install-script-data-ocaml-findlib-register install-script-data: install-script-data-ocaml-findlib-register install-script-data-ocaml-findlib-register: -.if defined(OCAML_FINDLIB_REGISTER) - ${RUN} \ - cd ${PKG_DB_TMPDIR} && ${PKGSRC_SETENV} ${INSTALL_SCRIPTS_ENV} \ - ${_PKG_DEBUG_SCRIPT} ${INSTALL_FILE} ${PKGNAME} \ - UNPACK +OCAML_FINDLIB_REGISTER +.if !empty(OCAML_FINDLIB_REGISTER:M[Yy][Ee][Ss]) + ${RUN} \ + cd ${PKG_DB_TMPDIR} && ${PKGSRC_SETENV} ${INSTALL_SCRIPTS_ENV} \ + ${_PKG_DEBUG_SCRIPT} ${INSTALL_FILE} ${PKGNAME} \ + UNPACK +OCAML_FINDLIB_REGISTER .endif # PKG_SHELL contains the pathname of the shell that should be added or @@ -1060,6 +1060,7 @@ FILES_SUBST+= LS=${LS:Q} FILES_SUBST+= MKDIR=${MKDIR:Q} FILES_SUBST+= MV=${MV:Q} FILES_SUBST+= OCAML_FINDLIB_DIRS=${OCAML_FINDLIB_DIRS:Q} +FILES_SUBST+= OCAML_SITELIBDIR=${OCAML_SITELIBDIR:Q} FILES_SUBST+= PERL5=${PERL5:Q} FILES_SUBST+= PKG_ADMIN=${PKG_ADMIN_CMD:Q} FILES_SUBST+= PKG_INFO=${PKG_INFO_CMD:Q} diff --git a/mk/pkginstall/ocaml-findlib-register b/mk/pkginstall/ocaml-findlib-register index 8a709bb6188..82aef07fcc2 100644 --- a/mk/pkginstall/ocaml-findlib-register +++ b/mk/pkginstall/ocaml-findlib-register @@ -1,4 +1,4 @@ -# $NetBSD: ocaml-findlib-register,v 1.1 2016/04/12 15:52:29 jaapb Exp $ +# $NetBSD: ocaml-findlib-register,v 1.2 2016/06/17 08:53:42 jaapb Exp $ # # Generate an +OCAML_FINDLIB_REGISTER script that handles registration for # findlib after a binary installation @@ -20,6 +20,8 @@ ECHO="@ECHO@" GREP="@GREP@" MV="@MV@" OCAML_FINDLIB_DIRS="@OCAML_FINDLIB_DIRS@" +OCAML_FINDLIB_REGISTER="@OCAML_FINDLIB_REGISTER@" +OCAML_SITELIBDIR="@OCAML_SITELIBDIR@" PWD_CMD="@PWD_CMD@" RM="@RM@" TOUCH="@TOUCH@" @@ -46,11 +48,11 @@ esac ${TOUCH} ${LDCONF}.tmp for i in ${OCAML_FINDLIB_DIRS} do - ${GREP} -F -v -- "$i" < "${LDCONF}" >> "${LDCONF}.tmp" + ${GREP} -F -v -- "${OCAML_SITELIBDIR}/$i" < "${LDCONF}" >> "${LDCONF}.tmp" case $ACTION in ADD) $echo "${PKGNAME}: adding $i to ${LDCONF}" - ${ECHO} "@PREFIX@/$i" >> "${LDCONF}.tmp" + ${ECHO} "@PREFIX@/${OCAML_SITELIBDIR}/$i" >> "${LDCONF}.tmp" ;; REMOVE) |