Check-point ocamlfind buildlink3.mk; overwrite "ocamlfind install" command

to ease ${DESTDIR} support.
This commit is contained in:
uebayasi 2011-06-15 05:25:46 +00:00
parent 371cf76755
commit f641f824f8
2 changed files with 60 additions and 0 deletions

View file

@ -0,0 +1,34 @@
# $NetBSD: buildlink3.mk,v 1.3 2011/06/15 05:25:46 uebayasi Exp $
BUILDLINK_TREE+= ocaml-findlib
.if !defined(OCAML_FINDLIB_BUILDLINK3_MK)
OCAML_FINDLIB_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.ocaml-findlib+=ocaml-findlib>=1.2
BUILDLINK_ABI_DEPENDS.ocaml-findlib+=ocaml-findlib>=1.2
BUILDLINK_PKGSRCDIR.ocaml-findlib?= ../../devel/ocaml-findlib
BUILDLINK_TARGETS+= ocaml-findlib-wrappers ocaml-findlib-ldconf
.PHONY: ocaml-findlib-wrappers
ocaml-findlib-wrappers:
${RUN} \
${SED} -e 's|@SH@|'${SH:Q}'|g' \
-e 's|@OCAML_FINDLIB_PREFIX@|${BUILDLINK_PREFIX.ocaml-findlib}|g' \
-e 's|@BUILDLINK_DIR@|${BUILDLINK_DIR}|g' \
< ${.CURDIR}/../../devel/ocaml-findlib/files/ocamlfind.sh \
> ${BUILDLINK_DIR}/bin/ocamlfind; \
${CHMOD} +x ${BUILDLINK_DIR}/bin/ocamlfind
.PHONY: ocaml-findlib-ldconf
ocaml-findlib-ldconf:
${RUN} \
${CP} ${BUILDLINK_PREFIX.ocaml}/lib/ocaml/ld.conf \
${BUILDLINK_DIR}/lib/ocaml
.endif # OCAML_FINDLIB_BUILDLINK3_MK
INSTALLATION_DIRS+= lib/ocaml/site-lib
BUILDLINK_TREE+= -ocaml-findlib

View file

@ -0,0 +1,26 @@
#!@SH@
# $NetBSD: ocamlfind.sh,v 1.1 2011/06/15 05:25:47 uebayasi Exp $
args="$@"
case "$args" in
*install*)
install_args=
case "$args" in
*-destdir*) ;;
*)
install_args="${install_args} -destdir ${DESTDIR}@OCAML_FINDLIB_PREFIX@/lib/ocaml/site-lib"
;;
esac
case "$args" in
*-ldconf*) ;;
*)
install_args="${install_args} -ldconf @BUILDLINK_DIR@/lib/ocaml/ld.conf"
;;
esac
args="${args%%install*}install ${install_args}${args##*install}"
;;
*) ;;
esac
exec "@OCAML_FINDLIB_PREFIX@/bin/`basename $0`" ${args}