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

if {(${os.platform} eq "darwin" && ${os.major} > 13) \
    || ${os.platform} ne "darwin"} {
    PortGroup       qt6 1.0

    github.setup    Faster3ck converseen 0.15.2.1 v
    github.tarball_from archive
    revision        0
    checksums       rmd160  c95454e18dbef3a2fa10e7aec9196087bd11a355 \
                    sha256  ce5507d24b60bab3030158ab157f8f6ec589c8b7d358761ce8f33714506c5b56 \
                    size    979211

    depends_lib-append \
                    port:ImageMagick7 \
                    port:qt6-qttools

    compiler.cxx_standard   2017

    configure.args-append \
                    -DUSE_QT6=YES \
                    -DCMAKE_BUILD_TYPE=Release \
                    -DCMAKE_PREFIX_PATH=${prefix}/lib/ImageMagick7 \
                    -DCMAKE_INSTALL_PREFIX=${prefix}
} else {
    PortGroup       qt4 1.0

    # Version for legacy systems using Qt4.
    github.setup    Faster3ck converseen 0.9.2 v
    github.tarball_from tarball
    revision        0
    checksums       rmd160  8fb30774f2105641c864fd5d828dc51bb218eb7c \
                    sha256  4ad8a612ff8dc693159743031b6bf14af966b163a155296ce809d1dc3789faee \
                    size    292007

    # https://github.com/Faster3ck/Converseen/issues/169
    patchfiles-append \
                    patch-fix-formats.diff

    depends_lib-append  port:ImageMagick

}

categories          graphics
license             GPL-3
maintainers         {mps @Schamschula} openmaintainer
description         Converseen is an open source batch image converter and resizer.
long_description    {*}${description} Thanks to the Magick++ image libraries it supports \
                    more than 100 image formats.

app.icon            ${filespath}/Converseen.icns
