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

name            libggiwmh
version         0.3.2
categories      graphics
license         MIT
maintainers     nomaintainer
description     GGI extension for windowed targets
long_description \
	LibGGIWMH is an extension for GGI targets that \
	are window system based to allow access to things \
	like setting the title bar, resizing etc.
homepage        https://www.ggi-project.org

depends_lib     port:libggi

master_sites    ${homepage}ftp/ggi/v2.2/ \
                sourceforge:ggi
distname        ${name}-${version}.src
use_bzip2       yes
checksums       rmd160  b3bddfaac1e4375ff75e0ee5e7ac6cd19a7ee49c \
                sha256  4f5d08557350b540a3a20ab09aab65e43cdda393a1ec4dec8e48eaad658b548d \
                size    316669

worksrcdir      ${name}-${version}

# Undefined symbols: "_giiEventSend"
patchfiles-append \
                patch-fix-linking.diff

post-patch {
	reinplace "s|need_relink=yes|need_relink=no|" \
		${worksrcpath}/ltmain.sh
}

configure.args-append \
                --mandir=${prefix}/share/man \
                --with-ggi=${prefix}/lib

if {(${universal_possible} && [variant_isset universal] && [string match *64* ${configure.universal_archs}]) 
    || ((!${universal_possible} || ![variant_isset universal]) && [string match *64 ${configure.build_arch}])} {
    # uses carbon window manager functions with no 64-bit version
    configure.args-append   --disable-quartz
}
