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

name                gcab
version             1.4
revision            0
license             LGPL-2.1+
set branch          [join [lrange [split ${version} .] 0 1] .]
description         A tool and library mainly made to create Cabinet files
long_description    {*}${description}, using GObject/GIO API, providing GIR bindings.
maintainers         nomaintainer
categories          gnome
homepage            https://wiki.gnome.org/msitools
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  c98850b41f6baec5c3997fef342ad4a42b18b8af \
                    sha256  67a5fa9be6c923fbc9197de6332f36f69a33dadc9016a2b207859246711c048f \
                    size    78240

depends_build-append \
                    port:gettext \
                    port:gtk-doc \
                    path:bin/pkg-config:pkgconfig \
                    path:bin/vala:vala

depends_lib-append  port:gettext-runtime \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \
                    port:zlib

patchfiles          dont-use-version-script.patch

# cc1: error: unrecognized command line option "-fstack-protector-strong"
if {[string match *gcc-4.* ${configure.compiler}]} {
    patchfiles-append \
                    allow-xcode-gcc.patch
}

compiler.c_standard 1999
compiler.blacklist-append {clang < 700}

# gobject-introspection uses g-ir-scanner, which uses $CC from env
if {${universal_possible} && [variant_isset universal]} {
    foreach arch ${configure.universal_archs} {
        lappend merger_build_env(${arch})  "CC=${configure.cc} -arch ${arch}"
        lappend merger_destroot_env(${arch})  "CC=${configure.cc} -arch ${arch}"
    }
} else {
    build.env-append       "CC=${configure.cc} ${configure.cc_archflags}"
    destroot.env-append    "CC=${configure.cc} ${configure.cc_archflags}"
}

livecheck.type      gnome-with-unstable
