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

github.setup            nomacs nomacs 3.16.224
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from     tarball
revision                7
checksums               rmd160  3bbf6f0939f86b024e27d2afaa7bebe71fe172b7 \
                        sha256  6a1b87a2873ea67f7ec87bfa4695cc0594af047234af86f4d19a30038e373240 \
                        size    1932553

name                    nomacs
license                 GPL-3+
maintainers             nomaintainer
description             nomacs image viewer application bundle
long_description        nomacs is a free image viewer. nomacs is small, fast and able to \
                        handle the most common image formats. Additionally it is possible \
                        to synchronize multiple viewers. A synchronization of viewers running \
                        on the same computer or via LAN is possible. It allows to compare \
                        images and spot the differences (e.g. schemes of architects to show the progress).
categories              aqua graphics
homepage                https://nomacs.org

set opencv_ver 4

depends_lib-append      port:exiv2 \
                        port:libraw \
                        port:zlib \
                        port:tiff \
                        path:lib/opencv${opencv_ver}/libopencv_core.dylib:opencv${opencv_ver}
qt5.depends_component   qtsvg qttools

worksrcdir              ${worksrcdir}/ImageLounge

cmake.module_path-append \
                        ${prefix}/libexec/opencv${opencv_ver}/cmake

configure.args-append   \
                        -DCMAKE_INSTALL_PREFIX="${applications_dir}" \
                        -DQT_QMAKE_EXECUTABLE=${qt_qmake_cmd}

#give name consistent with other macOS applications
#allow high resolution
patchfiles-append       patch-name.diff \
                        patch-Info.plist.in.diff

post-destroot {
    move {*}[glob ${destroot}${applications_dir}/*.dylib ${destroot}${prefix}/lib]
    xinstall -d -m 0755 ${destroot}${applications_dir}/Nomacs.app/Contents/Resources
    xinstall -m 0644 ${worksrcpath}/macosx/nomacs.icns ${destroot}${applications_dir}/Nomacs.app/Contents/Resources
    copy ${worksrcpath}/src/themes ${destroot}${applications_dir}/Nomacs.app/Contents/Resources
}
