# -*- 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
PortGroup               active_variants 1.1
PortGroup               compilers 1.0

name                    py-qutip
version                 4.6.3
revision                0
categories-append       science
platforms               darwin
license                 BSD
maintainers             nomaintainer

description             Quantum Toolbox in Python
long_description        QuTiP is open-source software for simulating the dynamics of open quantum systems.

homepage                http://qutip.org/

checksums               rmd160  b67069bbecd4bfd99a318dda6d5decd67c8dfe36 \
                        sha256  caf7c577e01478b488384822f08cb19686a7882969a88115a15f4636585d4fa8 \
                        size    3590223

python.versions         310

# py-scipy is not universal
if {${name} ne ${subport}} {
    compilers.choose    fc f77 f90
    compilers.setup     require_fortran

    # Need to add py-cvxpy when it gets added to Macports
    # https://www.cvxpy.org
    depends_lib-append  port:py${python.version}-cython \
                        port:py${python.version}-ipython \
                        port:py${python.version}-matplotlib \
                        port:py${python.version}-numpy \
                        port:py${python.version}-scipy

#    require_active_variants py${python.version}-ipython "notebook parallel"
    require_active_variants py${python.version}-matplotlib latex

    use_parallel_build  no

    python.add_archflags    no
    universal_variant       no

    build.args

    # why only archflags?
    build.env-append CFLAGS=${configure.cc_archflags} \
                     OBJCFLAGS=${configure.objc_archflags} \
                     CXXFLAGS=${configure.cxx_archflags} \
                     FFLAGS=${configure.f77_archflags} \
                     F90FLAGS=${configure.f90_archflags} \
                     FCFLAGS=${configure.fc_archflags} \
                     "LDFLAGS=-undefined dynamic_lookup -bundle ${configure.ld_archflags}"

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       ${homepage}
    livecheck.regex     {qutip-([0-9\.]+)\.tar\.gz}
}
