# -*- 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
# $Id$
PortSystem      1.0
PortGroup       compilers 1.0

name            eso-tkimg84
conflicts       eso-tkimg84-devel
version         1.4.13

set _name         Img
set _version      1.4
set _tcl_version  8.4.20
categories        x11
maintainers       eso.org:usd-help
description       tkimg Tool Kit
long_description \
  tkimg

platforms           darwin
homepage            http://incrtcl.sourceforge.net/
master_sites        sourceforge:project/tkimg/tkimg/${_version}/tkimg%20${version} \
                    sourceforge:tcl:tcl

dist_subdir    eso-tcltk
distname            ${_name}${_version}
distfiles           ${_name}-${version}-Source${extract.suffix}
#distfiles-append    tcl${_tcl_version}-src${extract.suffix}


checksums           itk3.4.2.tar.gz \
                    rmd160  4c7f70a9c77b2390d41071777dfb47c0599da36e \
                    sha256  8e5746de402d4ac9920f35793a1d328cf084b0c3d6af8b057e00fd37c82ad2ec \
                    tcl8.4.20-src.tar.gz \
                    rmd160  27abfdd9d8d518cfc3beff85ca782144710b13e2 \
                    sha256  fcb317b65c69f1d6962057c5622a80980bc22ffadf25c1cc50b6d02ff6c2cf40 \
                    rmd160  27abfdd9d8d518cfc3beff85ca782144710b13e2 \
                    sha256  fcb317b65c69f1d6962057c5622a80980bc22ffadf25c1cc50b6d02ff6c2cf40 \

checksums           rmd160  a43b6c9a5be2db68f6224902a48ef3d1fae37297 \
                    sha256  7a17c5d5eb7dfab995240398f6ac629a72d98ea1da09c60eabdea0ff513af8d6

checksums           Img-1.4.13-Source.tar.gz \
                    rmd160  3fc3942847eef222046652719eee4c21b11e4151 \
                    sha256  f0868c1cad9752dcf1234f81f00c417d34a11c0f0dd499ba469df29f1c40d163 \
                    size    8366556

compilers.choose    cc cxx
compilers.setup     gcc 

default_variants  +${compilers.gcc_default}
use_parallel_build      no

worksrcdir          ${_name}-${version}
prefix              /opt/local/libexec/eso/tcltk-8.4
destroot.destdir    INSTALL_ROOT=${destroot}

if { ${os.platform} eq "darwin" && ${os.major} >= 20 } {
  platform arm {
    configure.cppflags-append  -DPNG_ARM_NEON_OPT=0
  }
}

configure.args  \
    --exec_prefix=${prefix} \
    --mandir=${prefix}/share/man \
    --with-tcl=${prefix}/lib \
    --with-tclinclude=${prefix}/include \
    --with-tk=${prefix}/lib \
    --with-tkinclude=${prefix}/include \
    --x-includes=/opt/local/include \
    --x-libraries=/opt/local/lib \
    --enable-shared \
    --enable-64bit
depends_lib         port:eso-tk84
depends_build       port:eso-tcllib84

if { [gcc_variant_isset] && [compilers::get_current_gcc_version] >= 14 } {
  configure.cflags-append  \
          -Wno-incompatible-pointer-types \

}

configure.cppflags-append \
  -I${workpath}/tcl${_tcl_version}/generic -I${workpath}/tcl${_tcl_version}/unix -I${prefix}/include

destroot.env-append \
  PATH=[exec printenv PATH]:${prefix}/bin \
  TCLLIBPATH=${prefix}/lib

post-destroot {
  delete ${destroot}${prefix}/share/man/mann/Toplevel.n
}
