[95032] trunk/dports/devel/ocaml-findlib
mww at macports.org
mww at macports.org
Wed Jul 4 05:29:23 PDT 2012
Revision: 95032
https://trac.macports.org/changeset/95032
Author: mww at macports.org
Date: 2012-07-04 05:29:22 -0700 (Wed, 04 Jul 2012)
Log Message:
-----------
ocaml-findlib: add the camlp4find wrapper script; inc revision;
Modified Paths:
--------------
trunk/dports/devel/ocaml-findlib/Portfile
Added Paths:
-----------
trunk/dports/devel/ocaml-findlib/files/camlp4find
Modified: trunk/dports/devel/ocaml-findlib/Portfile
===================================================================
--- trunk/dports/devel/ocaml-findlib/Portfile 2012-07-04 12:15:22 UTC (rev 95031)
+++ trunk/dports/devel/ocaml-findlib/Portfile 2012-07-04 12:29:22 UTC (rev 95032)
@@ -4,7 +4,7 @@
name ocaml-findlib
version 1.3.2
-revision 2
+revision 3
distname findlib-${version}
categories devel ml
maintainers mww openmaintainer
@@ -52,7 +52,8 @@
set ocamlfind_destdir [file normalize ${prefix}/lib/ocaml/site-lib/stublibs]
destroot.keepdirs ${destroot}${ocamlfind_destdir}
post-destroot {
- file mkdir ${destroot}${ocamlfind_destdir}
+ xinstall -m 755 -d ${destroot}${ocamlfind_destdir}
+ xinstall -m 755 ${filespath}/camlp4find ${destroot}${prefix}/bin/camlp4find
}
post-activate {
Added: trunk/dports/devel/ocaml-findlib/files/camlp4find
===================================================================
--- trunk/dports/devel/ocaml-findlib/files/camlp4find (rev 0)
+++ trunk/dports/devel/ocaml-findlib/files/camlp4find 2012-07-04 12:29:22 UTC (rev 95032)
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+# A camlp4o/ocamlfind combo
+# Public Domain. Use at your own risk.
+# Please report bugs and fixes to Martin Jambon <martin_jambon at emailuser.net>
+# Thanks to Gerd Stolpmann
+
+src=''
+pkg=''
+syntax='camlp4o'
+libfiles=''
+
+usage(){
+ echo 'camlp4find is a preprocessing command which can be used instead
+of camlp4o or camlp4r in order to use ocamlfind packages.
+
+Usage: camlp4find [camlp4o|camlp4r] [packages] [files to parse]
+ camlp4find -echo
+ camlp4find -help
+
+A "file to parse" can be specified as follows:
+ somefile.ml
+ somefile.mli
+ -impl anyfile
+ -intf anyfile
+
+-echo displays the command which should be executed and exits
+
+-help displays this message
+
+Example:
+
+The following command assumes that the packages pa_tryfinally, pa_openin
+and micmatch_pcre are installed. pr_o.cmo is the standard module which
+will generate a human-readable output for the preprocessed OCaml code.
+The file to process does not end in .ml, so we have to use the -impl
+option exactly like with camlp4o:
+
+ camlp4find pa_tryfinally pa_openin micmatch_pcre pr_o.cmo -impl somefile.mml
+' 1>&2
+ exit 2
+}
+
+while : ; do
+ case "$1" in
+ "") break;;
+ camlp4o) syntax=camlp4o;;
+ camlp4r) syntax=camlp4r;;
+ -impl) shift; src="$src -impl $1";;
+ -intf) shift; src="$src -intf $1";;
+ *.ml) src="$src $1";;
+ *.cmo|*.cma) libfiles="$libfiles $1";;
+ -echo) echo=true;;
+ -*) usage;;
+ *) pkg="$pkg $1";;
+ esac
+ shift
+done
+
+i_options=`ocamlfind query -predicates "syntax,preprocessor,$syntax" \
+$pkg -i-format`
+a_options=`ocamlfind query -predicates "syntax,preprocessor,$syntax" \
+$pkg -a-format`
+
+cmd="$syntax $i_options $a_options -I +camlp4 $libfiles $src"
+if [ -z "$echo" ]
+then exec $cmd
+else echo $cmd
+fi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120704/2e72f8d4/attachment.html>
More information about the macports-changes
mailing list