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

name                gnome-internet-radio-locator
version             12.7.0
revision            0
set branch          [join [lrange [split $version .] 0 1] .]

categories          gnome
platforms           darwin
license             GPL-3+
maintainers         {gnome.org:ole @oleaamot} \
                    openmaintainer
description         GNOME Internet Radio Locator
long_description    Locate Internet Radio Stations
homepage            https://www.gnomeradio.org/~ole/gnome-internet-radio-locator
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  7787f04533e0151fe943a346a9981d7b9ddedc84 \
                    sha256  4db981efcf6607c906388c92c70a54d31afdd3bbcd86cfb9ba89f208af50d6b9 \
                    size    668196

depends_build       port:autoconf \
                    port:automake \
                    port:geocode-glib \
                    port:gnome-common \
                    port:gstreamer1-gst-plugins-bad \
                    port:gstreamer1-gst-plugins-good \
                    port:gstreamer1-gst-plugins-ugly \
                    port:gtk-doc \
                    port:intltool \
                    port:itstool \
                    path:bin/pkg-config:pkgconfig \
                    port:yelp-tools

depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/pango.pc:pango \
                    port:desktop-file-utils \
                    port:geocode-glib \
                    port:gstreamer1 \
                    port:gstreamer1-gst-plugins-base \
                    path:lib/pkgconfig/gtk4.pc:gtk4 \
                    port:libchamplain \
                    port:libxml2 \
                    port:zlib

depends_run         port:adwaita-icon-theme \
                    port:gstreamer1-gst-plugins-bad \
                    port:gstreamer1-gst-plugins-good \
                    port:gstreamer1-gst-plugins-ugly

# reconfigure using autogen.sh from upstream git for intltool 0.51 compatibility

post-patch {
    xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
}

configure.cmd       ./autogen.sh

# building with optimization greater than -O0 causes crash on selecting station
# https://trac.macports.org/ticket/52993
configure.optflags  -O0
configure.args      --disable-silent-rules

post-activate {
   system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/hicolor"
   system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
}

variant debug description {Build with debug symbols and enable debug messages} {
    patchfiles-append   patch-enable-debug.diff
    configure.optflags  -O0 -g
}

livecheck.type      gnome-with-unstable
