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

gitlab.setup        gstreamer gstreamer 1.28.1
gitlab.instance     https://gitlab.freedesktop.org/gstreamer
revision            0

name                ${gitlab.project}-development
categories          multimedia
maintainers         {@Gcenx}
description         GStreamer is a streaming media framework
long_description    {*}${description}

supported_archs     arm64 x86_64
platforms           {darwin >= 17}
license             LGPL-2+

homepage            https://gstreamer.freedesktop.org
master_sites        ${homepage}/data/pkg/osx/${version}/

dist_subdir         ${gitlab.project}
distname            gstreamer-1.0-devel-${version}-universal
extract.suffix      .pkg

checksums           rmd160  e926551856b800e6cd25fd62f95274aa761a09ff \
                    sha256  df167b41559afbcd743276c6b068cba2ada8f5b69eb68095415a7a5a7515e52c \
                    size    742151934

depends_lib         port:gstreamer-runtime

extract             {}
use_configure       no
build               {}

destroot {
    set docdir ${destroot}${prefix}/share/doc/${subport}
    xinstall -d ${docdir}
    system "echo ${subport} is a stub port > ${docdir}/README"
}

activate {
    portactivate::activate_main
    elevateToRoot "installer"
    ui_msg "--->  Installing ${distname}${extract.suffix}"
    system -W ${distpath} "installer -pkg ${distname}${extract.suffix} -target /"
    system "xattr -drs com.apple.quarantine /Library/Frameworks/GStreamer.framework"
    system "codesign --force --deep --sign - /Library/Frameworks/GStreamer.framework"
}

variant universal {}
configure.universal_archs {*}${supported_archs}
default_variants +universal
variant_set universal
