# -*- 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           bitbucket 1.0
PortGroup           cmake 1.1
PortGroup           legacysupport 1.1

# strnlen
legacysupport.newest_darwin_requires_legacy 10

set component       workspace

name                katana-${component}
bitbucket.setup     smil3y kde-${component} e9ec88ab50b1eb449e2b2cab994395f45ed9fae0
version             4.25.0-20260320
revision            0
categories          katana kde
license             BSD LGPL-2.1
maintainers         {@barracuda156 macos-powerpc.org:barracuda}
homepage            https://bitbucket.org/smil3y/kde-${component}
description         Katana Workspace
long_description    {*}${description}. Katana is fork of KDE Software Distribution \
                    with emphasis on efficiency.

checksums           rmd160  2f5462c0d1489b1b8790c227987b7a0e012accef \
                    sha256  281fce0463283611ce3e11aec9fb8c226846060b1755285b6f1584adc75aea48 \
                    size    12724720

extract.rename      yes

post-extract {
    copy ${filespath}/Darwin ${worksrcpath}/ksysguard/ksysguardd/
}

patch.pre_args-replace  -p0 -p1

patchfiles-append   0001-ksysguard-darwin-support.patch \
                    0002-Fix-SharedMimeInfo-search.patch \
                    0003-kinfocenter-support-Apple.patch \
                    0004-kate-undefine-HAVE_FDATASYNC-on-Apple.patch \
                    0005-konsole-macos-keyboard-input-fix.patch

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:djvulibre \
                    path:lib/pkgconfig/fontconfig.pc:fontconfig \
                    path:lib/pkgconfig/freetype2.pc:freetype \
                    port:katana-libs \
                    port:katie \
                    port:libgit2 \
                    port:libgphoto2 \
                    port:libmtp \
                    port:libqalculate \
                    port:libusb \
                    port:mesa \
                    port:libGLU \
                    port:pciutils \
                    port:shared-mime-info \
                    port:xorg-libX11 \
                    port:xorg-libXau \
                    port:xorg-libxcb \
                    port:xorg-libXcursor \
                    port:xorg-libXdamage \
                    port:xorg-libXext \
                    port:xorg-libXfixes \
                    port:xorg-libxkbfile \
                    port:xorg-libXrandr \
                    port:xorg-libXres \
                    port:xorg-libXxf86vm \
                    port:xorg-xcb-proto \
                    port:xorg-xcb-util \
                    port:xorg-xcb-util-cursor \
                    port:xorg-xcb-util-keysyms \
                    port:xorg-xcb-util-renderutil \
                    port:xorg-xcb-util-xrm \
                    port:xorg-xcb-util-wm \
                    port:xrender

# Runtime deps, but apparently they are needed at configure time.
depends_lib-append  port:cppcheck \
                    port:setxkbmap \
                    port:xauth \
                    port:xkill \
                    port:xmessage

compiler.cxx_standard       2014
compiler.blacklist-append   {clang}

notes "
Katana apps use dbus session. Please run the following from the non-root user:\
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
"
