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

# https://bugzilla.gnome.org/show_bug.cgi?id=636134
PortGroup           muniversal 1.0

name                gstreamer1-gst-plugins-ugly
set my_name         gst-plugins-ugly
# please only commit stable updates (even numbered releases)
version             1.28.2
revision            0
description         A set of good-quality plug-ins for GStreamer that might pose distribution problems.
long_description    GStreamer Ugly Plug-ins is a set of plug-ins that have good quality \
                    and correct functionality, but distributing them might pose problems. \
                    The license on either the plug-ins or the supporting libraries might not be \
                    how we'd like. The code might be widely known to present patent problems.
maintainers         nomaintainer
categories          gnome
homepage            https://gstreamer.freedesktop.org/modules/${my_name}.html
master_sites        https://gstreamer.freedesktop.org/src/${my_name}/
distname            ${my_name}-${version}
license             GPL-2+ LGPL-2+
use_xz              yes

checksums           rmd160  ea7319bb84e454f5870ef4a52ea0fd867c99baa9 \
                    sha256  fe39a5ee7115e37de9eb65d899ec84c93e6e26ed3ffe25c6d5176cececbab572 \
                    size    230388

set py_ver          3.14
set py_ver_nodot    [string map {. {}} ${py_ver}]
set python.bin      ${prefix}/bin/python${py_ver}

depends_build-append \
                    path:bin/pkg-config:pkgconfig \
                    port:gettext \
                    port:python${py_ver_nodot}

depends_lib-append  port:gettext-runtime \
                    port:gstreamer1 \
                    port:gstreamer1-gst-plugins-base \
                    path:lib/pkgconfig/glib-2.0.pc:glib2

post-patch {
    reinplace "s|/usr/bin/env python3|${python.bin}|" \
        ${worksrcpath}/scripts/extract-release-date-from-doap-file.py \
        ${worksrcpath}/scripts/dist-translations.py
}

variant gpl description "Build plug-ins that have GPL-licensed dependencies" {
    depends_lib-append  port:a52dec \
                        port:libcdio \
                        port:libdvdread \
                        port:libmpeg2 \
                        port:x264
    configure.args-append \
                    -Dgpl=enabled
}

default_variants    +gpl

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "${my_name}-(\\d+\\\.\\d*\[02468\](?:\\.\\d+)*)${extract.suffix}"
