# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem                  1.0
PortGroup                   python 1.0

name                        py-clnum
set my_name                 clnum
version                     1.6
revision                    0
checksums                   rmd160  1e86c3df9ab44c7a777c637f274a736c81e4b231 \
                            sha256  ced1834d82553a2091c879e8b1cfe9fef03a42dd825fc90c3c6afe6cd81e8266 \
                            size    40085

platforms                   darwin
maintainers                 {ryandesign @ryandesign} openmaintainer
license                     GPL-2
homepage                    http://calcrpnpy.sourceforge.net/
master_sites                sourceforge:project/calcrpnpy/clnum/clnum-${version}

description                 a Python interface to the Class Library for \
                            Numbers (CLN)

long_description            ${my_name} is ${description}.

distname                    ${my_name}-${version}

python.versions             26

if {${subport} ne ${name}} {
    depends_lib-append          port:cln

    patchfiles                  setup.py.patch

    # cln now appears to require C++11
    compiler.cxx_standard       2011
    configure.cxxflags-append   -std=c++11

    # distutils ludicrously compiles C++ software with the C compiler so
    # we have to specify that the C compiler is the C++ compiler.
    # https://bugs.python.org/issue1222585
    # The python portgroup ludicrously does not allow cflags/cxxflags to
    # be changed so we have to put them in with the compiler.
    configure.cc                {*}${configure.cxx} {*}${configure.cxxflags}

    build.env                   "CPPFLAGS=${configure.cppflags}"

    post-destroot {
        set docdir ${destroot}${prefix}/share/doc/${subport}
        xinstall -d ${docdir}
        xinstall -W ${worksrcpath} \
            COPYING \
            README \
            changelog \
            clnumManual.html \
            ${docdir}
    }
    livecheck.type              none
} else {
    livecheck.regex             /${my_name}-(\[0-9.\]+)${extract.suffix}
}
