summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorThierry Thomas <thierry@FreeBSD.org>2005-06-08 21:16:02 +0000
committerThierry Thomas <thierry@FreeBSD.org>2005-06-08 21:16:02 +0000
commit2fabb6ed4717a9371536445bf925da1c9bda6ad8 (patch)
tree4fb8b81a61d44adbf8d2eab70aff5ca33ab9352d /lang
parentUpdate to 1.2.1. (diff)
- Add a knob WITHOUT_COMPILER_LIB, in order to install compiler libs
(additionnal libs needed to build programs manipulating OCaml modules, like the ocaml/cduce interface for example.); - add an option WITH_OPT_DEFAULT, telling the port to replace ocamlc and other tools by there native and faster version; WARNING: This option may break other ports! - Take maintainership. PR: ports/81868 Submitted by: Marwan Burelle <marwan.burelle (at) lri.fr>
Notes
Notes: svn path=/head/; revision=137077
Diffstat (limited to 'lang')
-rw-r--r--lang/ocaml/Makefile49
-rw-r--r--lang/ocaml/pkg-plist15
2 files changed, 43 insertions, 21 deletions
diff --git a/lang/ocaml/Makefile b/lang/ocaml/Makefile
index ff5d955e2ceb..599232c17b18 100644
--- a/lang/ocaml/Makefile
+++ b/lang/ocaml/Makefile
@@ -7,31 +7,31 @@
PORTNAME= ocaml
PORTVERSION= 3.08.3
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= lang
MASTER_SITES= http://caml.inria.fr/distrib/${DISTNAME:R}/ \
ftp://ftp.inria.fr/INRIA/caml-light/${DISTNAME:R}/ \
ftp://ftp.kurims.kyoto-u.ac.jp/pub/lang/caml-light/${DISTNAME:R}/
PKGNAMESUFFIX= ${SFX}
-MAINTAINER?= ports@FreeBSD.org
+MAINTAINER?= marwan.burelle@lri.fr
COMMENT?= The Objective Caml compiler and programming environment
.if defined(WITHOUT_X11)
PLIST_SUB+= X11="@comment " TK="@comment "
WITHOUT_TK= yes
SFX= -nox11
-CONFLICTS= ocaml-[0-9]* ocaml-notk-*
+CONFLICTS= ocaml-[0-9]* ocaml-notk-[0-9]*
.else
PLIST_SUB+= X11=""
USE_XLIB= yes
.if defined(WITHOUT_TK)
PLIST_SUB+= TK="@comment "
SFX= -notk
-CONFLICTS= ocaml-[0-9]* ocaml-nox11-*
+CONFLICTS= ocaml-[0-9]* ocaml-nox11-[0-9]*
.else
PLIST_SUB+= TK=""
-CONFLICTS= ocaml-nox11-* ocaml-notk-*
+CONFLICTS= ocaml-nox11-[0-9]* ocaml-notk-[0-9]*
BUILD_DEPENDS+= ${LOCALBASE}/include/tcl8.4:${PORTSDIR}/lang/tcl84 \
${LOCALBASE}/include/tk8.4:${PORTSDIR}/x11-toolkits/tk84
@@ -83,6 +83,8 @@ CONFIGURE_ARGS+= -tkdefs "-I${LOCALBASE}/include/tcl8.4 -I${LOCALBASE}/include/t
.endif
.endif
+MODOPT= camlp4o camlp4r ocamlc ocamldep ocamldoc ocamllex ocamlopt
+
.include <bsd.port.pre.mk>
.if ${ARCH} != "i386"
@@ -135,5 +137,40 @@ post-install:
${XARGS} -0 -n 5 -x \
${CHMOD} ${SHAREMODE}
@${CHMOD} u+w ${PREFIX}/lib/ocaml/ld.conf
-
+# Do we want .opt version of tools to be the default ?
+.if defined(WITH_OPT_DEFAULT)
+. for module in ${MODOPT}
+# First, we save bytecode version
+ @${MV} ${PREFIX}/bin/${module} ${PREFIX}/bin/${module}.byte
+# Next make .opt version be the default one (as link)
+ @${LN} ${PREFIX}/bin/${module}.opt ${PREFIX}/bin/${module}
+ @${ECHO_CMD} "bin/${module}.opt" >> ${TMPPLIST}
+ @${ECHO_CMD} "@exec ln %D/%F %B/${module}" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec rm %B/${module}" >> ${TMPPLIST}
+. endfor
+# Add files to the PLIST
+ @${FIND} ${PREFIX}/bin/ -type f -name \?caml\*.byte -or -name camlp4\?.byte \
+ | ${SED} "s,^${PREFIX}/,," >> ${TMPPLIST}
+.else
+. for module in ${MODOPT}
+ @${ECHO_CMD} ${module:S|^|bin/|} >> ${TMPPLIST}
+. endfor
+ @${FIND} ${PREFIX}/bin/ -type f -name \?caml\*.opt -or -name camlp4\?.opt \
+ | ${SED} "s,^${PREFIX}/,," >> ${TMPPLIST}
+.endif
+# Add compiler's libs if required
+.if !defined(WITHOUT_COMPILER_LIB)
+ @${MKDIR} ${PREFIX}/lib/ocaml/compiler-lib
+ @${INSTALL_DATA} ${WRKSRC}/utils/*.cm* ${PREFIX}/lib/ocaml/compiler-lib
+ @${INSTALL_DATA} ${WRKSRC}/utils/*.o ${PREFIX}/lib/ocaml/compiler-lib
+ @${INSTALL_DATA} ${WRKSRC}/parsing/*.cm* ${PREFIX}/lib/ocaml/compiler-lib
+ @${INSTALL_DATA} ${WRKSRC}/parsing/*.o ${PREFIX}/lib/ocaml/compiler-lib
+ @${INSTALL_DATA} ${WRKSRC}/typing/*.cm* ${PREFIX}/lib/ocaml/compiler-lib
+ @${INSTALL_DATA} ${WRKSRC}/typing/*.o ${PREFIX}/lib/ocaml/compiler-lib
+ @${FIND} ${PREFIX}/lib/ocaml/compiler-lib -type f | \
+ ${SED} "s,^${PREFIX}/,," >> ${TMPPLIST}
+ @${ECHO_CMD} "@dirrm lib/ocaml/compiler-lib" >> ${TMPPLIST}
+.endif
+ @${ECHO_CMD} "@dirrm lib/ocaml" >> ${TMPPLIST}
+
.include <bsd.port.post.mk>
diff --git a/lang/ocaml/pkg-plist b/lang/ocaml/pkg-plist
index b62542344ce8..4c3e4c806653 100644
--- a/lang/ocaml/pkg-plist
+++ b/lang/ocaml/pkg-plist
@@ -1,26 +1,12 @@
bin/camlp4
-bin/camlp4o
-bin/camlp4o.opt
-bin/camlp4r
-bin/camlp4r.opt
%%TK%%bin/labltk
bin/mkcamlp4
bin/ocaml
%%TK%%bin/ocamlbrowser
-bin/ocamlc
-bin/ocamlc.opt
bin/ocamlcp
bin/ocamldebug
-bin/ocamldep
-bin/ocamldep.opt
-bin/ocamldoc
-bin/ocamldoc.opt
-bin/ocamllex
-bin/ocamllex.opt
bin/ocamlmklib
bin/ocamlmktop
-bin/ocamlopt
-bin/ocamlopt.opt
bin/ocamlprof
bin/ocamlrun
bin/ocamlyacc
@@ -929,4 +915,3 @@ lib/ocaml/weak.mli
%%TK%%@dirrm lib/ocaml/labltk
@dirrm lib/ocaml/camlp4
@dirrm lib/ocaml/caml
-@dirrm lib/ocaml