Ticket #17405: Portfile.patch

File Portfile.patch, 7.5 KB (added by adfernandes (Andrew Fernandes), 15 years ago)

1.37.0 Revision 3

  • Portfile

    old new  
    33PortSystem 1.0
    44
    55name                    boost
    6 version                 1.35.0
    7 revision                2
     6version                 1.37.0
     7revision                3
    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 8d9f990bfb7e83769fa5f1d6f065bc92
    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_37
     46                # this should be ...] 0 2] {_}] when 1_37_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] || [variant_isset python26] ) } {
     68            if { [variant_isset python24] } { set pyversion 2.4 }
     69            if { [variant_isset python25] } { set pyversion 2.5 }
     70            if { [variant_isset python26] } { set pyversion 2.6 }
     71            set spkg "${prefix}/Library/Frameworks/Python.framework/Versions/${pyversion}/lib/python${pyversion}/site-packages/boost/"
     72            xinstall -m 755 -d "${destroot}${spkg}"
     73            system "touch \"${destroot}${spkg}/__init__.py\""
     74            system "chmod 0644 \"${destroot}${spkg}/__init__.py\""
     75            system "chown -R root:admin \"${destroot}${spkg}/__init__.py\""
     76            foreach mpiso [exec find "${worksrcpath}/bin.v2/libs/mpi" -iname "mpi.so"] {
     77                xinstall -m 755 "${mpiso}" "${destroot}${spkg}"
     78                system "install_name_tool -id ${spkg}mpi.so ${destroot}${spkg}mpi.so"
     79                foreach blib [regexp -all -inline -- {libboost_\S+\.dylib} [exec otool -L "${destroot}${spkg}mpi.so"] ] {
     80                    system "install_name_tool -change ${blib} ${prefix}/lib/${blib} ${destroot}${spkg}mpi.so"
     81                }
     82            }
     83        }
     84                       
     85    }
     86   
     87        post-destroot {
     88           
    3689                # 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
     90                # eg. 1_37
     91                # this should be ...] 0 2] {_}] when 1_37_1 and later come out
    3992                set libver [join [lrange [split ${version} {.}] 0 1] {_}]
    4093               
    4194                # ensure the identification name of the dynamic libraries agree
     
    89142                }
    90143               
    91144                # 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)
     145                # version of the boost include directory (e.g. boost-1_37/boost -> include/boost)
    93146                system "cd  ${destroot}${prefix}/lib; ln -fs boost-${libver}/boost ${destroot}${prefix}/include/boost"
     147               
    94148        }
    95 }
    96149
    97 destroot.args           PREFIX=${destroot}${prefix} EPREFIX=${destroot}${prefix} \
    98                         LIBDIR=${destroot}${prefix}/lib INCLUDEDIR=${destroot}${prefix}/include \
    99                         install
     150}
    100151
    101152configure.args          --without-libraries=python --without-icu --with-bjam=${prefix}/bin/bjam
    102153
    103 variant python24 conflicts python25 {
     154variant gcc42 description conflicts gcc43 {Build with gcc42} {
     155    configure.compiler macports-gcc-4.2
     156    depends_lib-append port:gcc42
     157    post-configure {
     158        # This gives us many "unrecognized option '-no-cpp-precomp'" warnings; they appear harmless
     159        system "perl -ne 's@using darwin ;@using darwin : : ${prefix}/bin/g++-mp-4.2 ;@; print;' < user-config.jam > tmp.jam"
     160        system "mv tmp.jam user-config.jam"
     161    }
     162}
     163
     164variant gcc43 description conflicts gcc42 {Build with gcc43} {
     165    configure.compiler macports-gcc-4.3
     166    depends_lib-append port:gcc43
     167    post-configure {
     168        # This gives us many "unrecognized option '-no-cpp-precomp'" warnings; they appear harmless
     169        system "perl -ne 's@using darwin ;@using darwin : : ${prefix}/bin/g++-mp-4.3 ;@; print;' < user-config.jam > tmp.jam"
     170        system "mv tmp.jam user-config.jam"
     171    }
     172}
     173       
     174variant python24 conflicts python25 python26 {
    104175        set pyversion           2.4
    105176        depends_lib-append      lib:libpython${pyversion}:python[strsed ${pyversion} {g/[.]//}]
    106 
    107177        configure.args-delete   --without-libraries=python
    108178        configure.args-append   --with-python=python${pyversion}
    109179}
    110180
    111 variant python25 conflicts python24 {
     181variant python25 conflicts python24 python26 {
    112182        set pyversion           2.5
    113183        depends_lib-append      lib:libpython${pyversion}:python[strsed ${pyversion} {g/[.]//}]
     184        configure.args-delete   --without-libraries=python
     185        configure.args-append   --with-python=python${pyversion}
     186}
    114187
     188variant python26 conflicts python24 python25 {
     189        set pyversion           2.6
     190        depends_lib-append      lib:libpython${pyversion}:python[strsed ${pyversion} {g/[.]//}]
    115191        configure.args-delete   --without-libraries=python
    116192        configure.args-append   --with-python=python${pyversion}
    117193}
    118194
    119195variant icu {
    120196        depends_lib-append      port:icu
    121 
    122197        configure.args-delete   --without-icu
    123198        configure.args-append   --with-icu=${prefix}
    124199}
    125200
    126201variant graphml {
    127202        depends_lib-append      port:expat
    128 
    129203        configure.env-append    EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
    130204        build.env-append            EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
    131205}
    132206
    133207variant openmpi {
    134208        depends_lib-append      port:openmpi
    135 
    136209    post-configure {
    137210        set config [open user-config.jam a]
    138211        puts ${config} "using mpi : ${prefix}/bin/openmpicxx ;"
     
    153226    }
    154227}
    155228
    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)} {
     229variant complete description {Build all library types (debug, static, single-threaded)} {
    159230    patchfiles-append   patch-build-type-Jamroot
    160231}