# -*- 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           github 1.0
PortGroup           cmake 1.1
PortGroup           legacysupport 1.1

github.setup        PDB-REDO libcifpp 9.0.5 v
github.tarball_from archive
revision            0

categories          science
license             BSD
maintainers         {reneeotten @reneeotten} openmaintainer

description         Library containing code to manipulate mmCIF and PDB files
long_description    {*}${description}

checksums           rmd160  f1e085126b621b4ded6f09de07ce979ab1d5e6be \
                    sha256  1a8856045fd4e363bff1be0faac3fcb247f103a753763a92ab3deae1da9be05b \
                    size    2735738

# Needed for std::filesystem
legacysupport.newest_darwin_requires_legacy 18
legacysupport.use_mp_libcxx yes

# blacklisting to select C++20 capable compilers
compiler.blacklist-append {clang < 1300}
compiler.cxx_standard   2020

patchfiles-append   patch-fast_float-CMakeLists.txt.diff

configure.args-append \
                    -DBUILD_TESTING=OFF \
                    -DBUILD_SHARED_LIBS=ON \
                    -DCIFPP_INSTALL_UPDATE_SCRIPT=OFF \
                    -DCIFPP_DOWNLOAD_CCD=ON
# TODO: download the latest files in the "fetch" phase so that download option can be set to OFF
# install location should be: ${prefix}/share/libcifpp:
#   https://ftp.wwpdb.org/pub/pdb/data/monomers/components.cif.gz --> components.cif
#   https://mmcif.wwpdb.org/dictionaries/ascii/mmcif_pdbx_v50.dic.gz --> mmcif_pdbx.dic
#   https://github.com/ihmwg/ModelCIF/raw/master/dist/mmcif_ma.dic --> mmcif_ma.dic

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  path:share/pkgconfig/eigen3.pc:eigen3 \
                    port:fast-float \
                    port:pcre2 \
                    port:zlib
