source: trunk/dports/devel/ocaml-findlib/Portfile @ 137992

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

inc. revision to rebuild library dependents of ocaml (ocaml update to version 4.02.2)

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