# -*- 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           active_variants 1.1
PortGroup           app 1.0
PortGroup           github 1.0

github.setup        csete gpredict 34af48e6bfd9647559abb1df4907a65d064fc870
github.tarball_from archive
# Note version is date and approximate hour (UTC)
version             2025092000-[string range ${github.version} 0 7]
categories          science
license             GPL-2+
maintainers         {mps @Schamschula} {ra1nb0w @ra1nb0w} openmaintainer

description         GNOME-based satellite tracking program

long_description    Gpredict is a real-time satellite tracking and orbit \
                    prediction application. It can track an unlimited number \
                    of satellites and display their position and other data \
                    in lists, tables, maps, and polar plots (radar view). \
                    Gpredict can also predict the time of future passes for \
                    a satellite, and provide you with detailed information \
                    about each pass.

homepage            http://gpredict.oz9aec.net/

# stealth update
dist_subdir         ${name}/${version}_${revision}

checksums           rmd160  b51003984d84a15bf34e6f429d6d781f14c4b745 \
                    sha256  c033d2abd7b53bbf28cf5d2b9ca0fe35b0ecd71891fdf98445cd305ac4813c46 \
                    size    7711066

if {![catch {set result [active_variants gtk3 quartz x11]}]} {
    if {!${result}} {
        notes "
        If you use this app with the gtk3 X11 backend you may have issues\
        with the background turning black and dialog windows crashing.

        If you have these issues the only known work-around is to switch\
        gtk3 to using the Quartz backend via the commands:

        sudo port install glib2 +quartz -x11
        sudo port install libepoxy +quartz -x11
        sudo port install gtk3 +quartz -x11

        You should probably reinstall all gtk3 applications, including\
        gpredict afterwards.
    "
    }
}

use_autoreconf      yes
use_configure       yes

depends_build-append \
                    port:gettext \
                    port:intltool \
                    port:pkgconfig

depends_lib         port:curl \
                    port:goocanvas2 \
                    path:lib/pkgconfig/librsvg-2.0.pc:librsvg

depends_run         path:lib/libhamlib.dylib:hamlib

configure.args      --disable-silent-rules

app.create          yes
app.name            Gpredict
app.executable      gpredict
app.icon            pixmaps/icons/gpredict-icon.png
app.retina          yes
