source: trunk/dports/devel/ocaml3-findlib/Portfile

Last change on this file was 114649, checked in by mww@…, 4 years ago

ocaml3-findlib: version 1.4

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1# $Id: Portfile 114649 2013-12-13 10:56:04Z ryandesign@macports.org $
2
3PortSystem 1.0
4
5name                ocaml3-findlib
6version             1.4
7distname            findlib-${version}
8categories          devel ml
9maintainers         mww openmaintainer
10platforms           darwin
11license             MIT
12description         Objective Caml library management system
13long_description    The findlib library provides a scheme to manage reusable \
14                    software components (packages), and includes tools that support \
15                    this scheme. Packages are collections of OCaml modules for which \
16                    metainformation can be stored. The packages are kept in the filesystem \
17                    hierarchy, but with strict directory structure. The library contains \
18                    functions to look the directory up that stores a package, to query \
19                    metainformation about a package, and to retrieve dependency information \
20                    about multiple packages. There is also a tool that allows the user to \
21                    enter queries on the command-line. In order to simplify compilation and \
22                    linkage, there are new frontends of the various OCaml compilers that \
23                    can directly deal with packages.
24homepage            http://projects.camlcity.org/projects/findlib.html
25master_sites        http://download.camlcity.org/download/
26checksums           rmd160  ab81e1521fe51ab69427d791347ad21ad404855a \
27                    sha256  6e4065e5d79d31176ec213ff94599c4eae17c3904c2896e845d0379a99f1bdf8
28
29livecheck.type      regex
30livecheck.regex     "findlib-(.*?).tar.gz"
31
32depends_lib         port:ocaml3
33
34patchfiles          patch-site-lib-src-camlp4.310-META.in.diff
35
36configure.env-append PATH=${prefix}/libexec/ocaml3:$env(PATH)
37configure.args      -bindir ${prefix}/libexec/ocaml3 \
38                    -mandir ${prefix}/share/man \
39                    -sitelib ${prefix}/lib/ocaml3/site-lib \
40                    -config ${prefix}/etc/ocaml3/findlib.conf
41
42configure.pre_args  ""
43
44use_parallel_build  no
45build.env-append    PATH=${prefix}/libexec/ocaml3:$env(PATH)
46build.target        all opt
47
48destroot.destdir    prefix=${destroot}
49
50universal_variant   no
51
52# `ocamlfind printconf destdir` returns nothing if the dir isn't in place
53# but we know it's the same as our site-lib dir
54set ocamlfind_destdir ${prefix}/lib/ocaml3/site-lib/stublibs
55destroot.keepdirs   ${destroot}${ocamlfind_destdir}
56post-destroot {
57    xinstall -m 755 -d ${destroot}${ocamlfind_destdir}
58    xinstall -m 755 ${filespath}/camlp4find ${destroot}${prefix}/libexec/ocaml3/camlp4find
59    delete ${destroot}${prefix}/share/man
60}
61
62post-activate {
63        # Add our stublibs dir path to ld.conf
64        set ldconfpath [exec ${prefix}/libexec/ocaml3/ocamlfind printconf ldconf]
65        # ld.conf should exist since ocaml is installed, but lets just be safe anyway
66        if {[file exists $ldconfpath]} then {
67          # make sure ld.conf doesn't already have this line, so if the user installs,
68          # uninstalls, then installs again, we won't duplicate it
69          set has_line 0
70          set ldconf [open $ldconfpath r+]
71          while {[gets $ldconf line] != -1 && !$has_line} {
72            if {[string equal $line $ocamlfind_destdir]} then {
73              set has_line 1
74            }
75          }
76          if {!$has_line} {
77            if {${registry.format} == "receipt_flat"} {
78                ui_msg "## Adding line `${ocamlfind_destdir}' to file ${ldconfpath}"
79                ui_msg "## Be sure to remove this line if you uninstall ${name}"
80            }
81            puts $ldconf $ocamlfind_destdir
82          }
83          close $ldconf
84        } else {
85          ui_warn "File ${ldconfpath} doesn't seem to be installed."
86          ui_warn "Is ocaml installed properly?"
87        }
88}
89
90pre-deactivate {
91        # remove our stublibs dir path from ld.conf
92        set ocamlfind_destdir [file normalize ${prefix}/lib/ocaml3/site-lib/stublibs]
93        set ldconfpath [exec ${prefix}/libexec/ocaml3/ocamlfind printconf ldconf]
94        set ldconfoutpath [file dirname $ldconfpath]/.[file tail $ldconfpath]~
95        if {[file exists $ldconfpath]} then {
96          set ldconf [open $ldconfpath r]
97          set ldconfout [open $ldconfoutpath w]
98          while {[gets $ldconf line] != -1} {
99            if {![string equal $line $ocamlfind_destdir]} {
100              puts $ldconfout $line
101            }
102          }
103          close $ldconfout
104          close $ldconf
105          file rename -force $ldconfoutpath $ldconfpath
106        }
107}
108
109variant toolbox description {build the toolbox wizard, requires labltk} {
110        configure.args-append -with-toolbox
111        depends_lib bin:lablgtk:lablgtk
112}
Note: See TracBrowser for help on using the repository browser.