pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   jaapb
Date:           Fri Jun 17 08:53:42 UTC 2016

Modified Files:
        pkgsrc/mk: ocaml.mk
        pkgsrc/mk/pkginstall: bsd.pkginstall.mk ocaml-findlib-register

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 pkgsrc/mk/ocaml.mk
cvs rdiff -u -r1.68 -r1.69 pkgsrc/mk/pkginstall/bsd.pkginstall.mk
cvs rdiff -u -r1.1 -r1.2 pkgsrc/mk/pkginstall/ocaml-findlib-register

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/ocaml.mk
diff -u pkgsrc/mk/ocaml.mk:1.8 pkgsrc/mk/ocaml.mk:1.9
--- pkgsrc/mk/ocaml.mk:1.8      Fri May  6 14:13:23 2016
+++ pkgsrc/mk/ocaml.mk  Fri Jun 17 08:53:42 2016
@@ -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_SITELI
 .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
 

Index: pkgsrc/mk/pkginstall/bsd.pkginstall.mk
diff -u pkgsrc/mk/pkginstall/bsd.pkginstall.mk:1.68 pkgsrc/mk/pkginstall/bsd.pkginstall.mk:1.69
--- pkgsrc/mk/pkginstall/bsd.pkginstall.mk:1.68 Tue Apr 12 16:01:06 2016
+++ pkgsrc/mk/pkginstall/bsd.pkginstall.mk      Fri Jun 17 08:53:42 2016
@@ -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_F
 
 ${_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}

Index: pkgsrc/mk/pkginstall/ocaml-findlib-register
diff -u pkgsrc/mk/pkginstall/ocaml-findlib-register:1.1 pkgsrc/mk/pkginstall/ocaml-findlib-register:1.2
--- pkgsrc/mk/pkginstall/ocaml-findlib-register:1.1     Tue Apr 12 15:52:29 2016
+++ pkgsrc/mk/pkginstall/ocaml-findlib-register Fri Jun 17 08:53:42 2016
@@ -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)



Home | Main Index | Thread Index | Old Index