[84693] trunk/dports/_resources/port1.0/group/ocaml-1.0.tcl

mww at macports.org mww at macports.org
Thu Sep 29 13:12:50 PDT 2011


Revision: 84693
          http://trac.macports.org/changeset/84693
Author:   mww at macports.org
Date:     2011-09-29 13:12:48 -0700 (Thu, 29 Sep 2011)
Log Message:
-----------
new port group: ocaml-1.0

Added Paths:
-----------
    trunk/dports/_resources/port1.0/group/ocaml-1.0.tcl

Added: trunk/dports/_resources/port1.0/group/ocaml-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/ocaml-1.0.tcl	                        (rev 0)
+++ trunk/dports/_resources/port1.0/group/ocaml-1.0.tcl	2011-09-29 20:12:48 UTC (rev 84693)
@@ -0,0 +1,88 @@
+# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
+# $Id$
+
+# Copyright (c) 2011 Markus Weissmann <mww at macports.org>
+# Copyright (c) 2011 The MacPorts Project
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its
+#    contributors may be used to endorse or promote products derived from
+#    this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#
+# Usage:
+# PortGroup     ocaml 1.0
+
+# ocaml executable
+global ocaml
+set ocaml "${prefix}/bin/ocaml"
+
+# standard place to install OCaml libraries -- same as [exec ocamlfind printconf destdir]
+global ocamlfind_dir
+set ocamlfind_dir "${prefix}/lib/ocaml/site-lib"
+
+# most often it is used with a 'destroot' prefix
+global ocamlfind_destdir
+set ocamlfind_destdir "${destroot}${ocamlfind_dir}"
+
+# ocamlfind wrapper -- automagicaly obeys destroot
+global ocamlfind_wrapper
+set ocamlfind_wrapper "${workpath}/ocamlfind"
+
+depends_lib-append  port:ocaml
+
+# create a clever wrapper for ocamlfind
+post-extract {
+    set wrapper [open ${ocamlfind_wrapper} "w"]
+    puts ${wrapper} "#!/bin/sh"
+    puts ${wrapper} "if \[ \"\$1\" = \"install\" \]; then"
+    puts ${wrapper} "    ${prefix}/bin/ocamlfind \$* -destdir ${ocamlfind_destdir} -ldconf ignore"
+    puts ${wrapper} "else"
+    puts ${wrapper} "    ${prefix}/bin/ocamlfind \$*"
+    puts ${wrapper} "fi"
+    close ${wrapper}
+    file attributes ${ocamlfind_wrapper} -permissions +x
+}
+
+# if this is an oasis/setup.ml based installation
+proc use_oasis {option} {
+    depends_build-append port:caml-findlib
+    if {${option} == "yes"} {
+        global ocaml prefix ocamlfind_wrapper
+        global configure.cmd configure.pre_args
+        configure.cmd ${ocaml}
+        configure.pre_args "setup.ml -configure --override prefix ${prefix} --override ocamlfind ${ocamlfind_wrapper}"
+        global build.cmd build.target
+        build.cmd ${configure.cmd}
+        build.target "setup.ml -build"
+        global destroot.cmd destroot.target
+        destroot.cmd ${configure.cmd}
+        destroot.target "setup.ml -install"
+    }
+}
+
+pre-destroot {
+    xinstall -m 755 -d ${ocamlfind_destdir}/stublibs
+}
+


Property changes on: trunk/dports/_resources/port1.0/group/ocaml-1.0.tcl
___________________________________________________________________
Added: svn:keywords
   + Id
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110929/43ec30f9/attachment-0001.html>


More information about the macports-changes mailing list