Ticket #16378: Portfile

File Portfile, 5.4 KB (added by sal@…, 16 years ago)

updated Portfile

Line 
1# $Id: Portfile 39290 2008-08-16 04:11:19Z toby@macports.org $
2
3PortSystem 1.0
4
5name                    boost
6version                 1.36.0
7categories              devel
8maintainers             sanchom@gmail.com
9description             Collection of portable C++ source libraries
10long_description        Boost provides free portable peer-reviewed C++ \
11                        libraries. The emphasis is on portable libraries \
12                        which work well with the C++ Standard Library.
13homepage                http://www.boost.org
14master_sites            sourceforge
15distname                ${name}_[strsed ${version} {g/[.]/_/}]
16use_bzip2               yes
17checksums               sha1 b8f0f5d90b260aff995ef38fad4eee5e73d00810 \
18                        md5  328bfec66c312150e4c2a78dcecb504b
19platforms               darwin
20use_parallel_build      yes
21
22patchfiles              patch-configure
23
24depends_build           bin:bjam:boost-jam
25
26platform darwin 9 {
27        depends_build-append    port:gmake
28        build.cmd               gmake
29}
30
31platform darwin {
32        post-destroot {
33
34                # get the library version as it shows up in the library names:
35                # eg. 1_35
36                # this should be ...] 0 2] {_}] when 1_35_1 and later come out
37                set libver [join [lrange [split ${version} {.}] 0 1] {_}]
38               
39                # ensure the identification name of the dynamic libraries agree
40                # with their final destination path (not the destroot path that
41                # they've just been installed to)
42                foreach lib [glob -directory ${destroot}${prefix}/lib/ *-${libver}.dylib] {
43                        set libtail [file tail ${lib}]
44                        system "install_name_tool -id ${prefix}/lib/${libtail} ${lib}"
45                }
46                # set the install_name for every library referenced by another library
47                # to include the final destination path as well
48                foreach lib [glob -directory ${destroot}${prefix}/lib/ *-${libver}.dylib] {
49                        set libtail [file tail ${lib}]
50                        set installed_name ${prefix}/lib/${libtail}
51                        foreach lib2 [glob -directory ${destroot}${prefix}/lib/ *-${libver}.dylib] {
52                                system "install_name_tool -change ${libtail} ${installed_name} ${lib2}"
53                        }
54                }
55
56                # create relative symbolic links to the versioned libraries (.dylib only;
57                # .a were built with unversioned extensions that are duplicate files of the
58                # versioned extensions... handled next)
59                foreach lib [glob -directory ${destroot}${prefix}/lib/ *-${libver}.dylib] {
60                        set libtail [file tail ${lib}]
61                        set libroot [join [lrange [split [file rootname ${lib}] {-}] 0 end-1] {-}]
62                        set libname [file tail ${libroot}]
63                        set libext [file extension ${lib}]
64                        set liblink "${libroot}${libext}"
65                        if {![catch {set libtype [file type ${liblink}]}]} {
66                                if {${libtype} == "link"} {
67                                        file delete -force ${liblink}
68                                }
69                        }
70                        system "cd  ${destroot}${prefix}/lib;ln -s ${libtail} ${libname}${libext}"
71                }
72
73                # change the duplicated non-version-named .a libraries to
74                # symbolic links to the version-named .a libraries
75                foreach lib [glob -directory ${destroot}${prefix}/lib/ *-${libver}.a] {
76                        set libtail [file tail ${lib}]
77                        set libroot [join [lrange [split [file rootname ${lib}] {-}] 0 end-1] {-}]
78                        set libname [file tail ${libroot}]
79                        set libext [file extension ${lib}]
80                        set liblink "${libroot}${libext}"
81                        # if this file is around, it is a duplicate, delete it
82                        if {[file exists ${liblink}]} {
83                                file delete -force ${liblink}
84                        }
85                        # add a symbolic link instead
86                        system "cd  ${destroot}${prefix}/lib; ln -s ${libtail} ${libname}${libext}"
87                }
88               
89                # create a symbolic link in the include directory pointing to the current
90                # version of the boost include directory (e.g. boost-1_35/boost -> include/boost)
91                system "cd  ${destroot}${prefix}/lib; ln -fs boost-${libver}/boost ${destroot}${prefix}/include/boost"
92        }
93}
94
95destroot.args           install
96
97configure.args          --without-libraries=python --without-icu --with-bjam=${prefix}/bin/bjam \
98                        --prefix=${destroot}${prefix}
99
100variant python24 conflicts python25 {
101        set pyversion           2.4
102        depends_lib-append      lib:libpython${pyversion}:python[strsed ${pyversion} {g/[.]//}]
103
104        configure.args-delete   --without-libraries=python
105        configure.args-append   --with-python=python${pyversion}
106}
107
108variant python25 conflicts python24 {
109        set pyversion           2.5
110        depends_lib-append      lib:libpython${pyversion}:python[strsed ${pyversion} {g/[.]//}]
111
112        configure.args-delete   --without-libraries=python
113        configure.args-append   --with-python=python${pyversion}
114}
115
116variant icu {
117        depends_lib-append      port:icu
118
119        configure.args-delete   --without-icu
120        configure.args-append   --with-icu=${prefix}
121}
122
123variant graphml {
124        depends_lib-append      port:expat
125
126        configure.env-append    EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
127        build.env-append            EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
128}
129
130variant openmpi {
131        depends_lib-append      port:openmpi
132
133    post-configure {
134        set config [open user-config.jam a]
135        puts ${config} "using mpi : ${prefix}/bin/openmpicxx ;"
136        close ${config}
137    }
138}
139
140variant docs {
141    post-destroot {
142        # Install HTML documentation
143        xinstall -d ${destroot}${prefix}/share/doc/${name}
144        xinstall -W ${worksrcpath} index.htm index.html boost.css rst.css boost.png \
145            ${destroot}${prefix}/share/doc/${name}
146        file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
147        file copy ${worksrcpath}/more ${destroot}${prefix}/share/doc/${name}
148        file copy ${worksrcpath}/tools ${destroot}${prefix}/share/doc/${name}
149        file copy ${worksrcpath}/libs ${destroot}${prefix}/share/doc/${name}
150    }
151}
152
153# Should no longer conflict with icu in version 1.35.1, see:
154# http://svn.boost.org/trac/boost/ticket/1928
155variant complete conflicts icu description {Build all library types (debug, static, single-threaded)} {
156    patchfiles-append   patch-build-type-Jamroot
157}