Ticket #16378: Portfile.diff

File Portfile.diff, 6.8 KB (added by adfernandes (Andrew Fernandes), 16 years ago)

version bump to 1.36.0, added gcc43 and gcc42 variants, uses internal install

  • Portfile

    old new  
    33PortSystem 1.0
    44
    55name                    boost
    6 version                 1.35.0
    7 revision                2
     6version                 1.36.0
     7revision                0
    88categories              devel
    99maintainers             sanchom@gmail.com
    1010description             Collection of portable C++ source libraries
     
    1515master_sites            sourceforge
    1616distname                ${name}_[strsed ${version} {g/[.]/_/}]
    1717use_bzip2               yes
    18 checksums               md5 dce952a7214e72d6597516bcac84048b
     18checksums               md5 328bfec66c312150e4c2a78dcecb504b
    1919platforms               darwin
    2020use_parallel_build      yes
    2121
    22 patchfiles              patch-tools-build-v2-tools-darwin.jam \
    23                         patch-boost-serialization-utility.hpp \
    24                         patch-configure
     22patchfiles              patch-configure
    2523
    2624depends_build           bin:bjam:boost-jam
    2725
     
    3129}
    3230
    3331platform darwin {
    34         post-destroot {
    3532
     33    destroot {
     34       
     35        # Rather than using
     36        #
     37        #   destroot.args       PREFIX=${destroot}${prefix} EPREFIX=${destroot}${prefix} \
     38        #                           LIBDIR=${destroot}${prefix}/lib INCLUDEDIR=${destroot}${prefix}/include \
     39        #                           install
     40        #
     41        # we use the following install script because boost's installer doesn't know how to handle mpi+python.
     42        # See http://lists.boost.org/boost-build/2007/04/16338.php and http://lists.boost.org/boost-build/2007/04/16342.php
     43       
     44        # get the library version as it shows up in the library names:
     45                # eg. 1_36
     46                # this should be ...] 0 2] {_}] when 1_36_1 and later come out
     47                set libver [join [lrange [split ${version} {.}] 0 1] {_}]
     48               
     49        # install the boost headers
     50        xinstall -m 755 -d "${destroot}${prefix}/include/boost-${libver}"
     51        system "cp -r ${worksrcpath}/boost ${destroot}${prefix}/include/boost-${libver}"
     52        system "find ${destroot}${prefix}/include/boost-${libver} -type f -exec chmod 644 {} \\;"
     53        system "find ${destroot}${prefix}/include/boost-${libver} -type d -exec chmod 755 {} \\;"
     54        system "chown -R root:admin ${destroot}${prefix}/include/boost-${libver}"
     55       
     56        # install the shared libraries
     57        foreach dylib [exec find "${worksrcpath}/bin.v2" -iname "*.dylib"] {
     58            xinstall -m 755 "${dylib}" "${destroot}${prefix}/lib"
     59        }
     60
     61        # install the static libraries
     62        foreach slib [exec find "${worksrcpath}/bin.v2" -iname "*.a"] {
     63            xinstall -m 644 "${slib}" "${destroot}${prefix}/lib"
     64        }
     65       
     66        # python's mpi extension has an '.so' extension, and needs its installed-names changed
     67        if { [variant_isset openmpi] && ( [variant_isset python24] || [variant_isset python25] ) } {
     68            if { [variant_isset python24] } { set pyversion 2.4 }
     69            if { [variant_isset python25] } { set pyversion 2.5 }
     70            set spkg "${prefix}/lib/python${pyversion}/site-packages/"
     71            xinstall -m 755 -d "${destroot}${spkg}"
     72            foreach mpiso [exec find "${worksrcpath}/bin.v2/libs/mpi" -iname "mpi.so"] {
     73                xinstall -m 755 "${mpiso}" "${destroot}${spkg}"
     74                system "install_name_tool -id ${spkg}mpi.so ${destroot}${spkg}mpi.so"
     75                foreach blib [regexp -all -inline -- {libboost_\S+\.dylib} [exec otool -L "${destroot}${spkg}mpi.so"] ] {
     76                    system "install_name_tool -change ${blib} ${prefix}/lib/${blib} ${destroot}${spkg}mpi.so"
     77                }
     78            }
     79        }
     80                       
     81    }
     82   
     83        post-destroot {
     84           
    3685                # get the library version as it shows up in the library names:
    37                 # eg. 1_35
    38                 # this should be ...] 0 2] {_}] when 1_35_1 and later come out
     86                # eg. 1_36
     87                # this should be ...] 0 2] {_}] when 1_36_1 and later come out
    3988                set libver [join [lrange [split ${version} {.}] 0 1] {_}]
    4089               
    4190                # ensure the identification name of the dynamic libraries agree
     
    89138                }
    90139               
    91140                # create a symbolic link in the include directory pointing to the current
    92                 # version of the boost include directory (e.g. boost-1_35/boost -> include/boost)
     141                # version of the boost include directory (e.g. boost-1_36/boost -> include/boost)
    93142                system "cd  ${destroot}${prefix}/lib; ln -fs boost-${libver}/boost ${destroot}${prefix}/include/boost"
     143               
    94144        }
    95 }
    96145
    97 destroot.args           PREFIX=${destroot}${prefix} EPREFIX=${destroot}${prefix} \
    98                         LIBDIR=${destroot}${prefix}/lib INCLUDEDIR=${destroot}${prefix}/include \
    99                         install
     146}
    100147
    101148configure.args          --without-libraries=python --without-icu --with-bjam=${prefix}/bin/bjam
    102149
     150variant gcc42 description conflicts gcc43 {Build with gcc42} {
     151    configure.compiler macports-gcc-4.2
     152    depends_lib-append port:gcc42
     153    post-configure {
     154        # This gives us many "unrecognized option '-no-cpp-precomp'" warnings; they appear harmless
     155        system "perl -ne 's@using darwin ;@using darwin : : ${prefix}/bin/g++-mp-4.2 ;@; print;' < user-config.jam > tmp.jam"
     156        system "mv tmp.jam user-config.jam"
     157    }
     158}
     159
     160variant gcc43 description conflicts gcc42 {Build with gcc43} {
     161    configure.compiler macports-gcc-4.3
     162    depends_lib-append port:gcc43
     163    post-configure {
     164        # This gives us many "unrecognized option '-no-cpp-precomp'" warnings; they appear harmless
     165        system "perl -ne 's@using darwin ;@using darwin : : ${prefix}/bin/g++-mp-4.3 ;@; print;' < user-config.jam > tmp.jam"
     166        system "mv tmp.jam user-config.jam"
     167    }
     168}
     169       
    103170variant python24 conflicts python25 {
    104171        set pyversion           2.4
    105172        depends_lib-append      lib:libpython${pyversion}:python[strsed ${pyversion} {g/[.]//}]
    106 
    107173        configure.args-delete   --without-libraries=python
    108174        configure.args-append   --with-python=python${pyversion}
    109175}
     
    111177variant python25 conflicts python24 {
    112178        set pyversion           2.5
    113179        depends_lib-append      lib:libpython${pyversion}:python[strsed ${pyversion} {g/[.]//}]
    114 
    115180        configure.args-delete   --without-libraries=python
    116181        configure.args-append   --with-python=python${pyversion}
    117182}
    118183
    119184variant icu {
    120185        depends_lib-append      port:icu
    121 
    122186        configure.args-delete   --without-icu
    123187        configure.args-append   --with-icu=${prefix}
    124188}
    125189
    126190variant graphml {
    127191        depends_lib-append      port:expat
    128 
    129192        configure.env-append    EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
    130193        build.env-append            EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
    131194}
    132195
    133196variant openmpi {
    134197        depends_lib-append      port:openmpi
    135 
    136198    post-configure {
    137199        set config [open user-config.jam a]
    138200        puts ${config} "using mpi : ${prefix}/bin/openmpicxx ;"
     
    153215    }
    154216}
    155217
    156 # Should no longer conflict with icu in version 1.35.1, see:
    157 # http://svn.boost.org/trac/boost/ticket/1928
    158 variant complete conflicts icu description {Build all library types (debug, static, single-threaded)} {
     218variant complete description {Build all library types (debug, static, single-threaded)} {
    159219    patchfiles-append   patch-build-type-Jamroot
    160220}