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

name                xforms
version             1.2.4
revision            1
categories          x11
maintainers         {raphael @raphael-st} openmaintainer
description         A graphical user interface toolkit for X based on the X11 \
                    Xlib library
long_description    XForms is a graphical user interface toolkit for X based on \
                    the X11 Xlib library. It's written in C and allows to easily \
                    write GUIs for programs. For that it comes with a lot of \
                    widgets (buttons, menus, input fields, scrollbars, you name \
                    it) as well as fdesign, a tool that lets you create a GUI \
                    using a GUI. In addition, the library is extensible and new \
                    objects can easily be created and added to the library.
homepage            http://xforms-toolkit.org/
license             LGPL-2.1
platforms           darwin
master_sites        savannah
livecheck.url       https://download.savannah.gnu.org/releases-noredirect/${name}/
livecheck.regex     "${name}-((\[0-9\\.\]+)(sp\[0-9\]+)?)\\${extract.suffix}"

distfiles-append    ${name}.html${extract.suffix} \
                    ${name}.pdf
dist_subdir         ${name}/${version}_0

checksums           ${distname}${extract.suffix} \
                        rmd160  e4c159037d72e7717cd66630b3081b3c44b2559a \
                        sha256  78cc6b07071bbeaa1f906e0a22d5e9980e48f8913577bc082d661afe5cb75696 \
                    ${name}.html${extract.suffix} \
                        rmd160  c4e5f2bc124388e4125054b21d3b76a3bd41db89 \
                        sha256  f4eebb1701904e1d59113b573312d3626845b4912d3aa00deb4213d839c6c9f7 \
                    ${name}.pdf \
                        rmd160  878e359e57b57a4602b85a0893aaacb4ba294130 \
                        sha256  a0693889c9688b4ceff1e9b1ccc1118803eff75d62752ed87eeebe7c11747dd7

depends_lib         port:xorg-libsm \
                    port:xorg-libXau \
                    port:xorg-libXdmcp \
                    port:xorg-libX11 \
                    port:xpm \
                    port:gettext \
                    port:libiconv \
                    port:mesa \
                    path:include/turbojpeg.h:libjpeg-turbo

extract.only-delete ${name}.pdf

configure.args      --enable-demos

post-destroot {     set docdir ${destroot}${prefix}/share/doc/${name}
                    xinstall -d ${docdir}
                    xinstall -m 644 -W ${worksrcpath} \
                        COPYING.LIB \
                        ChangeLog \
                        Copyright \
                        README \
                        ${docdir}
                    copy ${workpath}/${name}.html ${docdir}
                    copy ${distpath}/${name}.pdf ${docdir}

                    if {![variant_exists universal] || ![variant_isset universal]} {
                        system -W ${worksrcpath}/demos "make mostlyclean"
                    }

                    xinstall -d ${destroot}${prefix}/share/${name}
                    copy ${worksrcpath}/demos \
                        ${destroot}${prefix}/share/${name}/
}
