Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jun 2005 12:27:44 +0200
From:      Marwan Burelle <Marwan.Burelle@lri.fr>
To:        Thierry Thomas <thierry@FreeBSD.org>
Cc:        marwan.burelle@lri.fr, freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/81868: [maintainer update] lang/ocaml : take maintainership and adding some options
Message-ID:  <20050607102744.GA66459@pc5-179.lri.fr>
In-Reply-To: <200506042219.j54MJoH5013206@freefall.freebsd.org>
References:  <200506042219.j54MJoH5013206@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--l76fUT7nc3MelDdI
Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q"
Content-Disposition: inline


--Q68bSM7Ycu6FN28Q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jun 04, 2005 at 10:19:50PM +0000, Thierry Thomas wrote:
> Synopsis: [maintainer update] lang/ocaml : take maintainership and adding=
 some options
>=20
> State-Changed-From-To: open->feedback
> State-Changed-By: thierry
> State-Changed-When: Sat Jun 4 22:11:19 GMT 2005
> State-Changed-Why:=20
>=20
> 1) Since compiler libs are needed to build other ports, it
> would be better to have it defined by default, and to replace
>=20
> .if defined(WITH_COMPILER_LIB)
>=20
> by
>=20
> .if !defined(WITHOUT_COMPILER_LIB)

Ok done.

> 2) When installed as a port with WITH_OPT_DEFAULT, optimized
> code is a link; however, when installed as a package, the code
> is duplicated: '@exec ln' should be used.

Ok, also done. The next step is to verify that this could be the
default behaviour (it is not in the OCaml distribution since there
isn't native compilation for all plateform.)

The patch is attached to the mail.

Thanks Thierry for so fast feedback ;)

    Marwan Burelle.

--=20
Burelle Marwan,
Equipe Bases de Donnees - LRI
http://www.cduce.org
(burelle@lri.fr | Marwan.Burelle@ens.fr)
--Q68bSM7Ycu6FN28Q
Content-Type: text/plain; charset=us-ascii
Content-Description: ocaml-port.patch
Content-Disposition: attachment; filename=new-ocaml-ports
Content-Transfer-Encoding: quoted-printable

diff -ruN /usr/ports/lang/ocaml/Makefile ocaml/Makefile
--- /usr/ports/lang/ocaml/Makefile	Mon May 23 02:12:42 2005
+++ ocaml/Makefile	Tue Jun  7 12:13:48 2005
@@ -7,31 +7,31 @@
=20
 PORTNAME=3D	ocaml
 PORTVERSION=3D	3.08.3
-PORTREVISION=3D	1
+PORTREVISION=3D	2
 CATEGORIES=3D	lang
 MASTER_SITES=3D	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=3D	${SFX}
=20
-MAINTAINER?=3D	ports@FreeBSD.org
+MAINTAINER?=3D	marwan.burelle@lri.fr
 COMMENT?=3D	The Objective Caml compiler and programming environment
=20
 .if defined(WITHOUT_X11)
 PLIST_SUB+=3D	X11=3D"@comment " TK=3D"@comment "
 WITHOUT_TK=3D	yes
 SFX=3D		-nox11
-CONFLICTS=3D	ocaml-[0-9]* ocaml-notk-*
+CONFLICTS=3D	ocaml-[0-9]* ocaml-notk-[0-9]*
 .else
 PLIST_SUB+=3D	X11=3D""
 USE_XLIB=3D	yes
 .if defined(WITHOUT_TK)
 PLIST_SUB+=3D	TK=3D"@comment "
 SFX=3D		-notk
-CONFLICTS=3D	ocaml-[0-9]* ocaml-nox11-*
+CONFLICTS=3D	ocaml-[0-9]* ocaml-nox11-[0-9]*
 .else
 PLIST_SUB+=3D	TK=3D""
-CONFLICTS=3D	ocaml-nox11-* ocaml-notk-*
+CONFLICTS=3D	ocaml-nox11-[0-9]* ocaml-notk-[0-9]*
=20
 BUILD_DEPENDS+=3D	${LOCALBASE}/include/tcl8.4:${PORTSDIR}/lang/tcl84 \
 		${LOCALBASE}/include/tk8.4:${PORTSDIR}/x11-toolkits/tk84
@@ -135,5 +135,72 @@
 		${XARGS} -0 -n 5 -x \
 		${CHMOD} ${SHAREMODE}
 	@${CHMOD} u+w ${PREFIX}/lib/ocaml/ld.conf
-	=09
+# Do we want .opt version of tools to be the default ?
+.if defined(WITH_OPT_DEFAULT)
+# First, we save bytecode version
+	@${MV} ${PREFIX}/bin/camlp4o ${PREFIX}/bin/camlp4o.byte
+	@${MV} ${PREFIX}/bin/camlp4r ${PREFIX}/bin/camlp4r.byte
+	@${MV} ${PREFIX}/bin/ocamlc ${PREFIX}/bin/ocamlc.byte
+	@${MV} ${PREFIX}/bin/ocamldep ${PREFIX}/bin/ocamldep.byte
+	@${MV} ${PREFIX}/bin/ocamldoc ${PREFIX}/bin/ocamldoc.byte
+	@${MV} ${PREFIX}/bin/ocamllex ${PREFIX}/bin/ocamllex.byte
+	@${MV} ${PREFIX}/bin/ocamlopt ${PREFIX}/bin/ocamlopt.byte
+# Next make .opt version be the default one (as link)
+	@${LN} ${PREFIX}/bin/camlp4o.opt ${PREFIX}/bin/camlp4o
+	@${ECHO_CMD} "bin/camlp4o.opt" >> ${TMPPLIST}
+	@${ECHO_CMD} "@exec ln %D/%F %B/camlp4o" >> ${TMPPLIST}
+	@${ECHO_CMD} "@unexec rm %B/camlp4o" >> ${TMPPLIST}
+	@${LN} ${PREFIX}/bin/camlp4r.opt ${PREFIX}/bin/camlp4r
+	@${ECHO_CMD} "bin/camlp4r.opt" >> ${TMPPLIST}
+	@${ECHO_CMD} "@exec ln %D/%F %B/camlp4r" >> ${TMPPLIST}
+	@${ECHO_CMD} "@unexec rm %B/camlp4r" >> ${TMPPLIST}
+	@${LN} ${PREFIX}/bin/ocamlc.opt ${PREFIX}/bin/ocamlc
+	@${ECHO_CMD} "bin/ocamlc.opt" >> ${TMPPLIST}
+	@${ECHO_CMD} "@exec ln %D/%F %B/ocamlc" >> ${TMPPLIST}
+	@${ECHO_CMD} "@unexec rm %B/ocamlc" >> ${TMPPLIST}
+	@${LN} ${PREFIX}/bin/ocamldep.opt ${PREFIX}/bin/ocamldep
+	@${ECHO_CMD} "bin/ocamldep.opt" >> ${TMPPLIST}
+	@${ECHO_CMD} "@exec ln %D/%F %B/ocamldep" >> ${TMPPLIST}
+	@${ECHO_CMD} "@unexec rm %B/ocamldep" >> ${TMPPLIST}
+	@${LN} ${PREFIX}/bin/ocamldoc.opt ${PREFIX}/bin/ocamldoc
+	@${ECHO_CMD} "bin/ocamldoc.opt" >> ${TMPPLIST}
+	@${ECHO_CMD} "@exec ln %D/%F %B/ocamldoc" >> ${TMPPLIST}
+	@${ECHO_CMD} "@unexec rm %B/ocamldoc" >> ${TMPPLIST}
+	@${LN} ${PREFIX}/bin/ocamllex.opt ${PREFIX}/bin/ocamllex
+	@${ECHO_CMD} "bin/ocamllex.opt" >> ${TMPPLIST}
+	@${ECHO_CMD} "@exec ln %D/%F %B/ocamllex" >> ${TMPPLIST}
+	@${ECHO_CMD} "@unexec rm %B/ocamllex" >> ${TMPPLIST}
+	@${LN} ${PREFIX}/bin/ocamlopt.opt ${PREFIX}/bin/ocamlopt
+	@${ECHO_CMD} "bin/ocamlopt.opt" >> ${TMPPLIST}
+	@${ECHO_CMD} "@exec ln %D/%F %B/ocamlopt" >> ${TMPPLIST}
+	@${ECHO_CMD} "@unexec rm %B/ocamlopt" >> ${TMPPLIST}
+# Add files to the PLIST
+	@${FIND} ${PREFIX}/bin/ -type f -name \?caml\*.byte -or -name camlp4\?.by=
te \
+		| ${SED} "s,^${PREFIX}/,," >> ${TMPPLIST}
+.else
+	@${ECHO_CMD} "bin/camlp4o" >> ${TMPPLIST}
+	@${ECHO_CMD} "bin/camlp4r" >> ${TMPPLIST}
+	@${ECHO_CMD} "bin/ocamlc" >> ${TMPPLIST}
+	@${ECHO_CMD} "bin/ocamldep" >> ${TMPPLIST}
+	@${ECHO_CMD} "bin/ocamldoc" >> ${TMPPLIST}
+	@${ECHO_CMD} "bin/ocamllex" >> ${TMPPLIST}
+	@${ECHO_CMD} "bin/ocamlopt" >> ${TMPPLIST}
+	@${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 -ruN /usr/ports/lang/ocaml/pkg-plist ocaml/pkg-plist
--- /usr/ports/lang/ocaml/pkg-plist	Sat May 21 21:57:06 2005
+++ ocaml/pkg-plist	Tue Jun  7 11:53:35 2005
@@ -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 @@
 %%TK%%@dirrm lib/ocaml/labltk
 @dirrm lib/ocaml/camlp4
 @dirrm lib/ocaml/caml
-@dirrm lib/ocaml

--Q68bSM7Ycu6FN28Q--

--l76fUT7nc3MelDdI
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)

iD8DBQFCpXagI+2UvUKfgvgRAugOAKCAVTEx58j6PGLhJtM5xK4XvS0fzgCeKaGn
2E27CzTNoXabrpd/QyiS8a8=
=t7Mx
-----END PGP SIGNATURE-----

--l76fUT7nc3MelDdI--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050607102744.GA66459>