pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Two fixes to the ocaml-findlib-register pkginstall ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/81aed96eab86
branches:  trunk
changeset: 348616:81aed96eab86
user:      jaapb <jaapb%pkgsrc.org@localhost>
date:      Fri Jun 17 08:53:42 2016 +0000

description:
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:

 mk/ocaml.mk                          |   4 ++--
 mk/pkginstall/bsd.pkginstall.mk      |  17 +++++++++--------
 mk/pkginstall/ocaml-findlib-register |   8 +++++---
 3 files changed, 16 insertions(+), 13 deletions(-)

diffs (97 lines):

diff -r 18234d0b1f8a -r 81aed96eab86 mk/ocaml.mk
--- a/mk/ocaml.mk       Fri Jun 17 08:15:16 2016 +0000
+++ b/mk/ocaml.mk       Fri Jun 17 08:53:42 2016 +0000
@@ -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 @@
 .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 -r 18234d0b1f8a -r 81aed96eab86 mk/pkginstall/bsd.pkginstall.mk
--- a/mk/pkginstall/bsd.pkginstall.mk   Fri Jun 17 08:15:16 2016 +0000
+++ b/mk/pkginstall/bsd.pkginstall.mk   Fri Jun 17 08:53:42 2016 +0000
@@ -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_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+=          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 -r 18234d0b1f8a -r 81aed96eab86 mk/pkginstall/ocaml-findlib-register
--- a/mk/pkginstall/ocaml-findlib-register      Fri Jun 17 08:15:16 2016 +0000
+++ b/mk/pkginstall/ocaml-findlib-register      Fri Jun 17 08:53:42 2016 +0000
@@ -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 @@
 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 @@
 ${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)



Home | Main Index | Thread Index | Old Index