1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

Make bsd.ocaml.mk more stage friendly

Reviewed by:	bapt
With hat:	portmgr
This commit is contained in:
Antoine Brodin 2014-03-26 20:07:11 +00:00
parent e45387b904
commit 578bdcd05d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=349286
2 changed files with 21 additions and 9 deletions

View File

@ -108,25 +108,19 @@ post-install-script: ocaml-findlib ocaml-ldconfig ocaml-wash
#
BUILD_DEPENDS+= ${OCAMLFIND_DEPEND}
RUN_DEPENDS+= ${OCAMLFIND_DEPEND}
MAKE_ENV+= OCAMLFIND_DESTDIR="${OCAMLFIND_DESTDIR}" \
MAKE_ENV+= OCAMLFIND_DESTDIR="${STAGEDIR}${OCAMLFIND_DESTDIR}" \
OCAMLFIND_LDCONF="${OCAMLFIND_LDCONF}"
#
# Directories under site-lib to process automatically
#
OCAML_PKGDIRS?= ${PORTNAME}
. if !target(pre-install-script)
pre-install-script:
.if !exists(${OCAMLFIND_DESTDIR})
@${MKDIR} "${PREFIX}/${OCAML_SITELIBDIR}"
.endif
. endif
. 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}
@${FIND} ${STAGEDIR}${PREFIX}/${OCAML_SITELIBDIR}/${DIR}/ -type f -print | ${SED} -e \
's,^${STAGEDIR}${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" \
@ -143,7 +137,9 @@ OCAML_LDLIBS?= ${OCAML_SITELIBDIR}/${PORTNAME}
. if !target(ocaml-ldconfig)
ocaml-ldconfig:
. for LIB in ${OCAML_LDLIBS}
. if defined(NO_STAGE)
@${ECHO_CMD} "${PREFIX}/${LIB}" >> "${PREFIX}/${OCAML_LDCONF}"
. endif
@${ECHO_CMD} "@exec ${ECHO_CMD} "%D/${LIB}" >> %D/${OCAML_LDCONF}" \
>> ${TMPPLIST}
@${ECHO_CMD} "@unexec ${SED} -i \"\" -e '/${LIB:S#/#\/#g}/d' %D/${OCAML_LDCONF}" >> ${TMPPLIST}
@ -199,3 +195,15 @@ add-plist-post:
.endif
.endif #!defined(OCAML_include)
.if defined(_POSTMKINCLUDED)
.if defined(USE_OCAML_FINDLIB)
pre-install: ${STAGEDIR}${OCAMLFIND_DESTDIR}
${STAGEDIR}${OCAMLFIND_DESTDIR}:
@${MKDIR} ${.TARGET}
.endif
.endif # _POSTMKINCLUDED

View File

@ -1845,6 +1845,10 @@ IGNORE= Do not define STAGEDIR in command line
.include "${PORTSDIR}/Mk/bsd.java.mk"
.endif
.if defined(USE_OCAML)
.include "${PORTSDIR}/Mk/bsd.ocaml.mk"
.endif
.if defined(USE_LINUX_RPM)
.include "${PORTSDIR}/Mk/bsd.linux-rpm.mk"
.endif