Ticket #38645: Portfile.diff

File Portfile.diff, 4.6 KB (added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), 9 years ago)
  • Portfile

    old new  
    11# $Id: Portfile 106046 2013-05-14 02:02:15Z ryandesign@macports.org $
    22
    33PortSystem      1.0
    4 PortGroup       archcheck 1.0
    54PortGroup       muniversal 1.0
    65
    76name            glpk
    87epoch           1
    9 # 4.49 removes the old API; don't update until ports using glpk have been rewritten to use the new API.
    10 version         4.48
     8version         4.57
    119license         GPL-3+
    1210categories      math lang
    1311platforms       darwin
     
    2422homepage        http://www.gnu.org/software/${name}/
    2523master_sites    gnu
    2624
    27 checksums       rmd160  269cb1f2b63b5a2f0a0f42b7af3ff52e8f95edfa \
    28                 sha256  abc2c8f895b20a91cdfcfc04367a0bc8677daf8b4ec3f3e86c5b71c79ac6adb1
     25checksums       rmd160  10cbe9f5c681d5893739cde1fd9d8c16cf468c73 \
     26                sha256  7323b2a7cc1f13e45fc845f0fdca74f4daea2af716f5ad2d4d55b41e8394275c
    2927
    30 depends_lib     port:gmp port:zlib
     28depends_lib     port:gmp
    3129
    32 archcheck.files \
    33     lib/libgmp.dylib \
    34     lib/libz.dylib
     30configure.args  --with-gmp
    3531
    36 configure.args  --with-gmp --with-zlib
    37 
    38 if { [variant_isset odbc] || [variant_isset mysql] } {
     32if { [variant_isset odbc] || [variant_isset iodbc] || [variant_isset mysql5] || [variant_isset mysql56] } {
    3933    depends_lib-append port:libtool
    40 
    41     archcheck.files-append \
    42         lib/libltdl.dylib
    43 
    4434    configure.args-append --enable-dl
     35    patchfiles-append patch-configure.diff
    4536}
    4637
    4738use_parallel_build  yes
     
    4940test.run        yes
    5041test.target     check
    5142
    52 post-patch {
    53     # glpk uses nmedit to make certain symbols local.
    54     # octave 3.0.3 relies on the obsolete __glp_lib_print_hook and __glp_lib_fault_hook symbols, so they must be kept global.
    55     # See http://www.nabble.com/octave-3.0.3-build-problem-due-to-glpk-td19945239.html for a discussion.
    56     reinplace \
    57         "s|export-symbols-regex '^(glp_\\|_glp_lpx_).*'|export-symbols-regex '^(glp_\\|_glp_lpx_\\|_glp_lib_fault_hook\\|_glp_lib_print_hook).*'|g" \
    58         ${worksrcpath}/src/Makefile.in
    59 }
    60 
    6143set docdir ${prefix}/share/doc/${name}
    6244
    6345post-destroot {
    6446    xinstall -d ${destroot}${docdir}
    6547    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING ChangeLog NEWS README \
    66         doc/glpk.pdf doc/gmpl.pdf doc/glpk_faq.txt \
     48        doc/glpk.pdf doc/gmpl.pdf doc/cnfsat.pdf doc/gmpl_es.pdf doc/graphs.pdf \
    6749        ${destroot}${docdir}
    6850
    6951    set examplesdir ${prefix}/share/examples/${name}
     
    7860        ${destroot}${examplesdir}/sql
    7961}
    8062
    81 variant odbc description {enable MathProg ODBC support} {
     63variant odbc conflicts iodbc description {enable MathProg ODBC support using unixODBC} {
    8264    depends_lib-append port:unixODBC
    8365
    84     archcheck.files-append \
    85         lib/libodbc.dylib
    86 
    8766    configure.args-append --enable-odbc=unix
    8867    post-patch {
    8968        reinplace \
    90             "s|libodbc.so|${prefix}/lib/libodbc.dylib|g" \
     69            "s|__MACPORTS__ODBC__LIB__|${prefix}/lib|g" \
     70            ${worksrcpath}/configure
     71    }
     72}
     73
     74variant iodbc description {enable MathProg ODBC support using iODBC} {
     75    depends_lib-append port:libiodbc
     76
     77    configure.args-append --enable-odbc
     78    post-patch {
     79        reinplace \
     80            "s|__MACPORTS__IODBC__LIB__|${prefix}/lib|g" \
    9181            ${worksrcpath}/configure
    9282    }
    9383}
    9484
    95 variant mysql description {enable MathProg MySQL support} {
     85variant mysql requires mysql5 description {legacy variant, use +mysql5 instead} {}
     86
     87variant mysql5 conflicts mysql56 description {enable MathProg MySQL support using MySQL 5.1} {
    9688    depends_lib-append path:bin/mysql_config5:mysql5
    9789
    98     archcheck.files-append \
    99         lib/mysql5/mysql/libmysqlclient.dylib
     90    configure.args-append --enable-mysql
     91    post-patch {
     92        reinplace \
     93            "s|__MACPORTS__MYSQL__INCLUDE__|${prefix}/include/mysql5/mysql|g" \
     94            ${worksrcpath}/configure
     95        reinplace \
     96            "s|__MACPORTS__MYSQL__LIB__|${prefix}/lib/mysql5/mysql|g" \
     97            ${worksrcpath}/configure
     98    }
     99}
     100
     101variant mysql56 conflicts mysql5 description {enable MathProg MySQL support using MySQL 5.6} {
     102    depends_lib-append port:mysql56
    100103
    101104    configure.args-append --enable-mysql
    102105    post-patch {
    103106        reinplace \
    104             "s|/usr/include/mysql|${prefix}/include/mysql5/mysql|g" \
     107            "s|__MACPORTS__MYSQL__INCLUDE__|${prefix}/include/mysql56/mysql|g" \
    105108            ${worksrcpath}/configure
    106109        reinplace \
    107             "s|libmysqlclient.so|${prefix}/lib/mysql5/mysql/libmysqlclient.dylib|g" \
     110            "s|__MACPORTS__MYSQL__LIB__|${prefix}/lib/mysql56/mysql|g" \
    108111            ${worksrcpath}/configure
    109112    }
    110113}