# -*- 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           perl5 1.0

perl5.branches      5.28 5.30 5.32 5.34
perl5.setup         Tk 804.036
revision            1
license             {Artistic-1 GPL} MIT
maintainers         {@chrstphrchvz gmx.us:chrischavez} openmaintainer
description         p5-tk is a Perl interface to Tk
long_description    ${description}

platforms           darwin

checksums           rmd160  299f83eb4b85aab1a512f3ee0e896478f0758016 \
                    sha256  32aa7271a6bdfedc3330119b3825daddd0aa4b5c936f84ad74eabb932a200a5e \
                    size    7024993

if {${perl5.major} != ""} {
    patchfiles-append \
                    patch-rt-129472.diff \
                    patch-fix-implicit.diff

    depends_build-append \
                    port:pkgconfig

    depends_lib-append \
                    port:p${perl5.major}-term-readkey \
                    port:fontconfig \
                    port:freetype \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:libpng \
                    port:zlib \
                    port:Xft2 \
                    port:xorg-libX11

# Must specify X11INC to find freetype.h
# (can't just use X11=${prefix})
# See https://rt.cpan.org/Ticket/Display.html?id=129923
#
# Request verbose configure and use the right compiler,
# even though they do not work correctly
    configure.args-append \
                    VERBOSE=1 \
                    CC=${configure.cc} \
                    XFT=1 \
                    X11INC=${prefix}/include \
                    X11LIB=${prefix}/lib
# Not sure what the correct CFLAGS/LDFLAGS variables are called
#   configure.args-append \
#                   "CCFLAGS=${configure.cflags} [get_canonical_archflags cc]" \
#                   "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]"
}
