# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0
PortGroup           legacysupport 1.1
PortGroup           meson 1.0

# O_CLOEXEC
legacysupport.newest_darwin_requires_legacy 10

# This port is largely useless outside of Linux, see:
# https://github.com/flatpak/libportal/issues/201
# It has been added merely to satisfy a nominal dependency.
github.setup        flatpak libportal 0.9.1
name                ${github.project}-gtk4
revision            0
categories          gnome sysutils devel
license             LGPL-3
maintainers         nomaintainer
description         GIO-styled async APIs for Flatpak
long_description    {*}${description}.
checksums           rmd160  791757da62c91f45fdd3409eb679a6937f5c2c81 \
                    sha256  ea422b789ae487e04194d387bea031fd7485bf88a18aef8c767f7d1c29496a4e \
                    size    142301
github.tarball_from archive

# A hack for https://github.com/flatpak/libportal/issues/201
patchfiles          patch-memfd_create.diff

depends_build-append \
                    path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \
                    port:gtk-doc \
                    path:bin/pkg-config:pkgconfig \
                    path:bin/vala:vala

depends_lib-append  path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/gtk4.pc:gtk4

# portal-helpers.h:40: error: redefinition of typedef ‘XdpPortal’
compiler.c_standard 2011

configure.args-append \
                    -Dbackend-gtk3=disabled \
                    -Dbackend-gtk4=enabled \
                    -Dbackend-qt5=disabled \
                    -Dbackend-qt6=disabled \
                    -Ddocs=false \
                    -Dintrospection=true \
                    -Dportal-tests=false \
                    -Dtests=false \
                    -Dvapi=true
