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

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

name                gstreamer010
set my_name         gstreamer
version             0.10.36
revision            2
description         GStreamer is a library for constructing graphs of media-handling components.
long_description    The applications it supports range from simple Ogg/Vorbis playback, audio/video \
                    streaming to complex audio (mixing) and video (non-linear editing) processing.
maintainers	        nomaintainer
categories	        gnome
platforms	        darwin
license             LGPL-2+
homepage	        https://${my_name}.freedesktop.org/
distname            ${my_name}-${version}

master_sites        gnome:sources/${my_name}/[join [lrange [split ${version} .] 0 1] .]/ \
                    https://${my_name}.freedesktop.org/src/${my_name}/

use_bzip2           yes

checksums           rmd160  5dd01d8ea7afe98e96037bf73f995654f469096e \
                    sha256  e556a529e0a8cf1cd0afd0cab2af5488c9524e7c3f409de29b5d82bb41ae7a30

patchfiles          patch-gst__gstdatetime.c \
                    implicit.patch \
                    bison3.patch

depends_build       port:gzip \
                    port:m4 \
                    path:bin/perl:perl5 \
                    port:pkgconfig

depends_lib         port:bison \
                    port:flex \
                    port:gettext \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:libxml2

gobject_introspection yes

conflicts_build     check

configure.env-append    PERL_PATH=${prefix}/bin/perl
configure.cflags-append -funroll-loops -fstrict-aliasing -fno-common

configure.args-append \
                    --disable-examples \
                    --disable-silent-rules

if {![info exists universal_possible]} {
    set universal_possible [expr {${os.universal_supported} && [llength ${configure.universal_archs}] >= 2}]
}
if {${universal_possible} && [variant_isset universal]} {
    set merger_host(x86_64) x86_64-apple-${os.platform}${os.major}
    set merger_host(i386) i686-apple-${os.platform}${os.major}
    set merger_configure_args(x86_64) --build=x86_64-apple-${os.platform}${os.major}
    set merger_configure_args(i386) --build=i686-apple-${os.platform}${os.major}
} else {
    if {${build_arch} eq "i386"} {
        configure.args-append \
            --host=i686-apple-${os.platform}${os.major} \
            --build=i686-apple-${os.platform}${os.major}
    } elseif {${build_arch} eq "x86_64"} {
        configure.args-append \
            --host=${build_arch}-apple-${os.platform}${os.major} \
            --build=${build_arch}-apple-${os.platform}${os.major}
    }
}

livecheck.type      none
