source: trunk/dports/devel/boost/Portfile @ 74050

Last change on this file since 74050 was 74050, checked in by takanori@…, 9 years ago

Increased revision number to link against the new library. (icu 4.6)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.5 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 74050 2010-12-03 05:36:14Z takanori@macports.org $
3
4PortSystem      1.0
5
6name            boost
7version         1.45.0
8revision        1
9license         Boost-1.0
10categories      devel
11platforms       darwin
12maintainers     adfernandes
13description     Collection of portable C++ source libraries
14
15long_description \
16    Boost provides free portable peer-reviewed C++ \
17    libraries. The emphasis is on portable libraries \
18    which work well with the C++ Standard Library.
19
20homepage        http://www.boost.org
21master_sites    sourceforge
22set distver     [join [split ${version} .] _]
23distname        ${name}_${distver}
24use_bzip2       yes
25
26checksums       md5     d405c606354789d0426bc07bea617e58 \
27                sha1    eb7424ef99df4e38af7431e38ff9849651b8aaf5 \
28                rmd160  1402cb49e0d680268109ef1bf16aea9bc4a127b0
29
30depends_lib     port:zlib \
31                port:expat \
32                port:bzip2
33
34proc write_jam s {
35    global worksrcpath
36    set config [open ${worksrcpath}/user-config.jam a]
37    puts ${config} ${s}
38    close ${config}
39}
40
41configure.cmd       ./bootstrap.sh
42configure.args      --without-libraries=python \
43                    --without-libraries=mpi \
44                    --without-icu
45configure.universal_args
46
47post-configure {
48
49    reinplace -E "s|-install_name \"|&${prefix}/lib/|" \
50        ${worksrcpath}/tools/build/v2/tools/darwin.jam
51
52    # Modified from 'portconfigure.tcl':
53    # set pre-compiler filter to use (ccache/distcc), if any.
54    if {[tbool configure.ccache] && [tbool configure.distcc]} {
55        set filter "ccache "
56        ui_msg "Warning: boost does not support distcc with ccache"
57    } elseif {[tbool configure.ccache]} {
58        set filter "ccache "
59    } elseif {[tbool configure.distcc]} {
60        set filter "distcc "
61    } else {
62        set filter ""
63    }
64    write_jam "using darwin : : ${filter}${configure.cxx} ;"
65
66}
67
68build.cmd       ${worksrcpath}/bjam
69build.target
70build.args      -d2 \
71                --layout=tagged \
72                --debug-configuration \
73                --user-config=user-config.jam \
74                -sBZIP2_INCLUDE=${prefix}/include \
75                -sBZIP2_LIBPATH=${prefix}/lib \
76                -sEXPAT_INCLUDE=${prefix}/include \
77                -sEXPAT_LIBPATH=${prefix}/lib \
78                -sZLIB_INCLUDE=${prefix}/include \
79                -sZLIB_LIBPATH=${prefix}/lib \
80                variant=release \
81                threading=single,multi \
82                link=static,shared
83
84use_parallel_build  no
85
86destroot.cmd            ${worksrcpath}/bjam
87destroot.post_args
88#
89pre-destroot {
90    eval destroot.args  ${build.args} --prefix=${destroot}${prefix}
91    system "find ${worksrcpath} -type f -name '*.gch' -exec rm {} \\;"
92}
93
94post-destroot {
95    set docdir ${prefix}/share/doc/${name}
96    xinstall -d ${destroot}${docdir}
97    set l [expr [string length ${worksrcpath}] + 1]
98    fs-traverse f [glob -directory ${worksrcpath} *] {
99        set dest ${destroot}${docdir}/[string range ${f} ${l} end]
100        if {[file isdirectory ${f}]} {
101            if {[file tail ${f}] eq "example"} {
102                copy ${f} ${dest}
103                continue
104            }
105            xinstall -d ${dest}
106        } elseif {[lsearch -exact {css htm html png svg} [string range [file extension ${f}] 1 end]] != -1} {
107            xinstall -m 644 ${f} ${dest}
108        }
109    }
110}
111
112set pythons_suffixes {24 25 26 27 31}
113
114set pythons_ports {}
115foreach s ${pythons_suffixes} {
116    lappend pythons_ports python${s}
117}
118
119proc python_dir {} {
120    global pythons_suffixes
121    foreach s ${pythons_suffixes} {
122        if {[variant_isset python${s}]} {
123            set p python[string index ${s} 0].[string index ${s} 1]
124            return [file normalize [exec ${p} -c "import sys; print sys.prefix"]/lib/${p}/site-packages]
125        }
126    }
127    error "Python support not enabled."
128}
129
130foreach s ${pythons_suffixes} {
131    set p python${s}
132    set v [string index ${s} 0].[string index ${s} 1]
133    set i [lsearch -exact ${pythons_ports} ${p}]
134    set c [lreplace ${pythons_ports} ${i} ${i}]
135    eval [subst {
136        variant ${p} description "Build Boost.Python for Python ${v}" conflicts ${c} {
137           
138            # There is a conflict with python and debug support, so we should really change the 'variant' line above
139            # to end with "conflicts ${c} debug" above. However, we leave it enabled for those who want to try it.
140            # The issue has been reported to both the MacPorts team and the boost team, as per:
141            # <http://trac.macports.org/ticket/23667> and <https://svn.boost.org/trac/boost/ticket/4461>
142           
143            depends_lib-append      port:${p}
144            configure.args-delete   --without-libraries=python
145            configure.args-append   --with-python=${prefix}/bin/python${v}
146           
147            patchfiles-append   patch-tools-build-v2-tools-python.jam.diff
148           
149            post-patch {
150                reinplace s|@PREFIX@|${prefix}| ${worksrcpath}/tools/build/v2/tools/python.jam
151            }
152           
153        }
154    }]
155}
156
157variant debug description {Builds debug versions of the libraries as well} {
158    build.args-delete   variant=release
159    build.args-append   variant=debug,release
160}
161
162variant icu description {Enable Unicode support in Boost.Regex through ICU} {
163    depends_lib-append      port:icu
164    configure.args-delete   --without-icu
165    configure.args-append   --with-icu=${prefix}
166}
167
168variant no_static description {Disable building static libraries} {
169    build.args-delete   link=shared,static
170    build.args-append   link=shared
171}
172
173variant no_single description {Disable building single-threaded libraries} {
174    build.args-delete   threading=single,multi
175    build.args-append   threading=multi
176}
177
178variant openmpi description {Build Boost.MPI} {
179   
180    # There is a conflict with python and debug support, so we should really change the 'variant' line above
181    # to end with "conflicts debug" above. However, we leave it enabled for those who want to try it.
182    # The issue has been reported to both the MacPorts team and the boost team, as per:
183    # <http://trac.macports.org/ticket/23667> and <https://svn.boost.org/trac/boost/ticket/4461>
184
185    depends_lib-append      port:openmpi
186    configure.args-delete   --without-libraries=mpi
187
188    post-configure {
189        write_jam "using mpi : ${prefix}/bin/openmpic++ : : ${prefix}/bin/openmpirun ;"
190    }
191
192    if {![catch python_dir]} {
193       
194        patchfiles-append patch-libs-mpi-build-Jamfile.v2.diff
195   
196        post-destroot {
197            set site_packages [python_dir]
198            xinstall -d ${destroot}${site_packages}/boost
199            xinstall -m 644 ${worksrcpath}/libs/mpi/build/__init__.py \
200                ${destroot}${site_packages}/boost
201   
202            set l ${site_packages}/boost/mpi.so
203            move ${destroot}${prefix}/lib/mpi.so ${destroot}${l}
204            system "install_name_tool -id ${l} ${destroot}${l}"
205        }
206
207    }
208   
209}
210
211variant regex_match_extra description \
212        "Enable access to extended capture information of submatches in Boost.Regex" {
213    notes \
214        You enabled +regex_match_extra variant, see the following page for an \
215        exhaustive list of the consequences of this feature:\n\t \
216        http://www.boost.org/doc/libs/${distver}/libs/regex/doc/html/boost_regex/ref/sub_match.html
217
218    post-patch {
219        reinplace {/#define BOOST_REGEX_MATCH_EXTRA/s:^// ::} \
220            ${worksrcpath}/boost/regex/user.hpp
221    }
222}
223
224variant universal {
225    build.args-append   pch=off
226
227    if {[lsearch ${universal_archs} ppc*] != -1} {
228        if {[lsearch ${universal_archs} *86*] != -1} {
229            build.args-append   architecture=combined
230        } else {
231            build.args-append   architecture=power
232        }
233
234        if {${os.arch} != "powerpc"} {
235            build.args-append   --disable-long-double
236        }
237    } else {
238        build.args-append   architecture=x86
239    }
240
241    if {[lsearch ${universal_archs} *64] != -1} {
242        if {[lsearch ${universal_archs} i386] != -1 || [lsearch ${universal_archs} ppc] != -1} {
243            build.args-append   address-model=32_64
244        } else {
245            build.args-append   address-model=64
246        }
247    } else {
248        build.args-append   address-model=32
249    }
250}
251
252platform powerpc {
253    build.args-append   --disable-long-double
254}
255
256platform darwin 8 powerpc {
257    if {[variant_isset universal]} {
258        build.args-append   macosx-version=10.4
259    }
260}
261
262livecheck.type  regex
263livecheck.url   ${homepage}
264livecheck.regex "Version (\\d+\\.\\d+\\.\\d+)"
Note: See TracBrowser for help on using the repository browser.