Ticket #43254: gnucash-python.diff

File gnucash-python.diff, 2.1 KB (added by g5pw (Aljaž Srebrnič), 8 years ago)

Portfile patch for python variant

  • Portfile

     
    3838distname          ${name}-${version}b
    3939worksrcdir        ${name}-${version}
    4040
    41 patchfiles        patch-configure.ac.diff
    42 
    4341post-patch {
    4442    # gnc-fq-dump needs to be patched to use MacPorts perl.
    4543    # (autoconf takes care of the other perl scripts.)
     
    5452            reinplace -locale C "s|<libguile/|<libguile18/|g" ${f}
    5553        }
    5654    }
     55
     56    if {[variant_isset python27]} {
     57        # Fix python exec_prefix
     58        reinplace "s|\\(PYTHON_EXEC_PREFIX=\\).*$|\\1${frameworks_dir}/Python.framework/Versions/2.7/|" \
     59            ${worksrcpath}/configure
     60    }
    5761}
    5862
    5963depends_build     port:pkgconfig \
     
    9094# aqbanking is not universal
    9195universal_variant no
    9296
    93 # reconfigure using upstream autogen.sh for intltool 0.51 compatibility
    94 
    95 post-patch {
    96     xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
    97 }
    98 
    99 configure.cmd     ./autogen.sh && ./configure
    100 
    10197configure.args    --disable-dependency-tracking \
    10298                  --disable-aqbanking \
    10399                  --disable-ofx \
     
    132128
    133129default_variants +ofx +hbci
    134130
    135 # variant python27 description {Install Python bindings for Python 2.7} {
    136 #     #patchfiles-append patch-configure-python.diff
    137 #     depends_lib-append port:python27
    138 #     configure.args-append --enable-python
    139 #     configure.python ${prefix}/bin/python2.7
    140 # }
     131variant python27 description {Install Python bindings for Python 2.7} {
     132    depends_lib-append  port:python27
     133
     134    patchfiles-append  patch-configure-python.diff
     135
     136    set python_bindir ${frameworks_dir}/Python.framework/Versions/2.7/bin/
     137
     138    configure.args-append --enable-python \
     139                          PYTHON_EXTRA_LDFLAGS=\"[exec ${python_bindir}/python2.7-config --ldflags]\" \
     140                          PYTHON_CPPFLAGS=\"[exec ${python_bindir}/python2.7-config --cflags]\"
     141
     142    configure.python    ${python_bindir}/python2.7
     143}
    141144
    142145post-activate {
    143146    system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/hicolor"