#-*- 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                gtkglext
version             1.2.0
revision            11
categories          devel
license             LGPL-2.1+
maintainers         nomaintainer
description         OpenGL Extension to GTK
platforms           macosx darwin
long_description    {*}${description}

homepage            https://sourceforge.net/projects/gtkglext/
master_sites        sourceforge

checksums           rmd160  7f5089d3ea64fd10b32632d9ea8f0b977e9317e7 \
                    sha256  e5073f3c6b816e7fa67d359d9745a5bb5de94a628ac85f624c992925a46844f9 \
                    size    956401

depends_build       port:pkgconfig
depends_lib         path:lib/pkgconfig/gtk+-2.0.pc:gtk2 \
                    port:libGLU \
                    port:mesa \
                    port:pangox-compat \
                    port:xorg-libXmu

patchfiles          patch-examples-pixmap-mixed.c.diff \
                    patch-examples-pixmap.c.diff \
                    patch-gtk-gtkglwidget.c.diff

# see https://trac.macports.org/ticket/56260
patchfiles-append   patch-strings.h.diff

configure.args      --x-include=${prefix}/include \
                    --x-lib=${prefix}/lib

variant quartz {
    distfiles-append       quartz.tbz
    post-extract {
        move ${workpath}/quartz ${worksrcpath}/gdk
    }

    # see https://trac.macports.org/ticket/61927
    configure.cppflags-append -UGDK_DISABLE_DEPRECATED

    configure.args-delete  --x-include=${prefix}/include \
                           --x-lib=${prefix}/lib
    configure.args-append  --without-x
    depends_lib-delete     port:mesa \
                           port:xorg-libXmu
    patchfiles-append      patch-configure.diff \
                           patch-makefile.in.diff \
                           patch-gdk-makefile.in.diff \
                           patch-gtk-makefile.in.diff \
                           patch-gdk-gdkglquery.c.diff \
                           patch-gdk-gdkglshapes.c.diff \
                           patch-gdk-gdkglglext.h.diff

    platform darwin 8 {
        depends_lib-append port:xorg-xorgproto
    }
}