gentoo-overlay/net-im/kadu/kadu-5.0_alpha1_p20260812.ebuild
2026-10-13 20:05:13 +02:00

106 lines
3.6 KiB
Bash

# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake xdg
# Snapshot of the fork's master, where the Qt6 port was merged. Upstream
# (vogel/kadu) stopped in 2017 and is still Qt5-only.
KADU_COMMIT="f8e7c932806455dd3d28e3a238317231a4719c9f"
DESCRIPTION="Instant messenger for Gadu-Gadu and XMPP, ported to Qt6"
HOMEPAGE="https://github.com/legal-hkr/kadu https://github.com/vogel/kadu"
SRC_URI="https://github.com/legal-hkr/kadu/archive/${KADU_COMMIT}.tar.gz
-> ${P}.tar.gz"
S="${WORKDIR}/${PN}-${KADU_COMMIT}"
LICENSE="GPL-2+"
SLOT="0"
# Deliberately unkeyworded: this is an arbitrary commit off a development
# branch, not a release. Requires "**" in package.accept_keywords.
KEYWORDS=""
IUSE="+gadu +kde +otr +spell +xmpp"
# QtWebKit does not exist in Qt6, so the chat view runs on QtWebEngine. X11 is
# gone as well: window activation and background blur come from KWindowSystem,
# idle time from KIdleTime, and screenshots from the desktop portal.
#
# injeqt is asked for by version rather than by name alone: the Qt6 build took
# soname 2 and version 2.0, and the Qt5 injeqt in ::gentoo is 1.2, which would
# otherwise satisfy the dependency and then fail to link.
RDEPEND="
app-arch/libarchive
>=dev-libs/injeqt-2.0
dev-qt/qt5compat:6
dev-qt/qtbase:6[dbus,gui,network,widgets,xml]
dev-qt/qtdeclarative:6[widgets]
dev-qt/qtscxml:6
dev-qt/qtwayland:6
dev-qt/qtwebengine:6[widgets]
sys-libs/zlib
gadu? ( >=net-libs/libgadu-1.12.1[ssl] )
kde? (
kde-frameworks/kconfig:6
kde-frameworks/kidletime:6
kde-frameworks/kwindowsystem:6
)
otr? ( net-libs/libotr )
spell? ( app-text/enchant:2 )
xmpp? ( net-libs/qxmpp )
"
DEPEND="${RDEPEND}"
BDEPEND="dev-qt/qttools:6[linguist]"
# The plugins that build against Qt6. Kept as one list rather than left to the
# defaults, because the defaults still name plugins this branch removed.
KADU_PLUGINS="
antistring auto_hide autoaway autoresponder autostatus cenzor chat_notify
config_wizard docking docking_notify emoticons exec_notify filedesc
firewall freedesktop_notify history idle imagelink last_seen mediaplayer
mprisplayer_mediaplayer screenshot simpleview single_window sound speech
sql_history tabs word_fix ext_sound
"
src_configure() {
local plugins="${KADU_PLUGINS}"
use gadu && plugins+=" gadu_protocol"
use xmpp && plugins+=" jabber_protocol"
use otr && plugins+=" encryption_otr"
use spell && plugins+=" spellchecker"
# The build wants them comma-separated on one line.
plugins=$(echo ${plugins} | tr ' ' ',')
local mycmakeargs=(
# Without this the plugins directory is not entered at all and
# COMPILE_PLUGINS has nothing to choose from -- the port keeps them
# off by default because they were brought up one at a time.
-DKADU_PORT_BUILD_PLUGINS=ON
-DCOMPILE_PLUGINS="${plugins}"
-DENABLE_DEVELOPER_BUILD=OFF
-DINSTALL_SDK=OFF
)
cmake_src_configure
}
pkg_postinst() {
xdg_pkg_postinst
elog "This is a Qt6 port of Kadu, taken from a development branch."
elog
elog "X11 is gone: the program runs as a Wayland client. Window position is"
elog "no longer restored, since a Wayland client cannot place its own"
elog "window; size and maximised state still are. A window rule keyed on"
elog "the kadu desktop entry does the rest."
elog
if ! use kde; then
elog "Built without the kde flag, so windows cannot raise themselves,"
elog "there is no background blur, and the idle time is unknown, which"
elog "means the away status is never set automatically."
elog
fi
elog "Screenshots go through the desktop portal, so a portal implementation"
elog "for the running compositor has to be installed for them to work."
}