summaryrefslogtreecommitdiff
path: root/user/kscreenlocker
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-29 18:05:25 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-29 18:05:25 +0000
commitb9895e501cb1bdcd19ea7071b2d2f2a800756fe8 (patch)
tree0e9923b39498c676aea614ff65883ec6b4ea0aab /user/kscreenlocker
parentd6e7cc0a30f22391814c11a45e053820c611a888 (diff)
downloadpackages-b9895e501cb1bdcd19ea7071b2d2f2a800756fe8.tar.gz
packages-b9895e501cb1bdcd19ea7071b2d2f2a800756fe8.tar.bz2
packages-b9895e501cb1bdcd19ea7071b2d2f2a800756fe8.tar.xz
packages-b9895e501cb1bdcd19ea7071b2d2f2a800756fe8.zip
user/[KDE Plasma]: Bump non-WL components to 5.12.9
* Makes KScreenLocker's Wayland dep optional.
Diffstat (limited to 'user/kscreenlocker')
-rw-r--r--user/kscreenlocker/APKBUILD13
-rw-r--r--user/kscreenlocker/optional-wayland.patch448
2 files changed, 456 insertions, 5 deletions
diff --git a/user/kscreenlocker/APKBUILD b/user/kscreenlocker/APKBUILD
index e566e197e..fa03b3515 100644
--- a/user/kscreenlocker/APKBUILD
+++ b/user/kscreenlocker/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox-kde@adelielinux.org>
pkgname=kscreenlocker
-pkgver=5.12.8
+pkgver=5.12.9
pkgrel=0
pkgdesc="Secure X11 screen locker"
url="https://www.kde.org/"
@@ -14,11 +14,13 @@ makedepends="$depends_dev cmake extra-cmake-modules python3 libx11-dev
libxcb-dev libxcursor-dev libxext-dev libxi-dev linux-pam-dev
qt5-qtdeclarative-dev kcmutils-dev kcrash-dev kdeclarative-dev
kglobalaccel-dev ki18n-dev kidletime-dev knotifications-dev
- ktextwidgets-dev kwayland-dev kwindowsystem-dev kxmlgui-dev solid-dev"
+ ktextwidgets-dev kwindowsystem-dev kxmlgui-dev solid-dev"
subpackages="$pkgname-dev $pkgname-lang"
source="https://download.kde.org/stable/plasma/$pkgver/kscreenlocker-$pkgver.tar.xz
+ optional-wayland.patch
kde.pam
- kde-np.pam"
+ kde-np.pam
+ "
build() {
if [ "$CBUILD" != "$CHOST" ]; then
@@ -31,7 +33,7 @@ build() {
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_C_FLAGS="$CFLAGS" \
- ${CMAKE_CROSSOPTS}
+ ${CMAKE_CROSSOPTS} .
make
}
@@ -45,6 +47,7 @@ package() {
install -m644 "$srcdir"/kde-np.pam "$pkgdir"/etc/pam.d/kde-np
}
-sha512sums="d389991d1af70c588c6918305649c6a5616a617fb7f010d7d5b3dfb5b97ec878069deef69676dbd8ac97a4f46b97c1a78b8b32980cafb49294e83021acd4c8f7 kscreenlocker-5.12.8.tar.xz
+sha512sums="411df584f7579368beed02340de673b510acb56b5b63475c60f8acc1e1437ae19643a7cdf8fd6880aec49ddb7cff769ce588b850506c411c5d390a53fbc016c4 kscreenlocker-5.12.9.tar.xz
+dee5baa9ec7ace803e0685ca177120f449b7232ecfe04233a505d40ff7e5c421c70ef1df08b21fe4b61d2c663ae97ff81fdc4f9c77776d38b54ccab8baefaf78 optional-wayland.patch
56e87d02d75c4a8cc4ed183faed416fb4972e7f223b8759959c0f5da32e11e657907a1df279d62a44a6a174f5aca8b2ac66a5f3325c5deb92011bcf71eed74c3 kde.pam
565265485dd7466b77966d75a56766216b8bcc187c95a997e531e9481cf50ddbe576071eb0e334421202bcab19aa6de6b93e042447ca4797a24bf97e1d053ffd kde-np.pam"
diff --git a/user/kscreenlocker/optional-wayland.patch b/user/kscreenlocker/optional-wayland.patch
new file mode 100644
index 000000000..eee3cb10e
--- /dev/null
+++ b/user/kscreenlocker/optional-wayland.patch
@@ -0,0 +1,448 @@
+--- kscreenlocker-5.12.9/CMakeLists.txt.old 2019-09-10 10:30:52.000000000 +0000
++++ kscreenlocker-5.12.9/CMakeLists.txt 2019-12-29 16:39:31.945860585 +0000
+@@ -73,16 +73,16 @@
+
+ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras)
+
+-find_package(KF5Wayland CONFIG REQUIRED)
++find_package(KF5Wayland)
+ set_package_properties(KF5Wayland PROPERTIES
+- TYPE REQUIRED
+- PURPOSE "Required for building screenlocker")
++ TYPE OPTIONAL
++ PURPOSE "Required for building Wayland screenlocker")
+ find_package(WaylandScanner)
+ find_package(Wayland 1.3 COMPONENTS Client Server)
+
+ set_package_properties(Wayland PROPERTIES
+- TYPE REQUIRED
+- PURPOSE "Required for building screenlocker")
++ TYPE OPTIONAL
++ PURPOSE "Required for building Wayland screenlocker")
+
+ find_package(loginctl)
+ set_package_properties(loginctl PROPERTIES
+@@ -138,9 +138,7 @@
+ interface.cpp
+ globalaccel.cpp
+ x11locker.cpp
+- waylandlocker.cpp
+ logind.cpp
+- waylandserver.cpp
+ powermanagement.cpp
+ powermanagement_inhibition.cpp
+ )
+@@ -149,10 +147,20 @@
+ kconfig_add_kcfg_files(ksld_SRCS kcfg/kscreensaversettings.kcfgc)
+ qt5_add_dbus_interface(ksld_SRCS ${powerdevilpolicyagent_xml} powerdevilpolicyagent)
+
++if(KF5Wayland_FOUND)
++list(APPEND ksld_SRCS
++ waylandlocker.cpp
++ waylandserver.cpp
++)
+ ecm_add_wayland_server_protocol(ksld_SRCS
+ PROTOCOL protocols/ksld.xml
+ BASENAME ksld
+ )
++set(OPT_WL_LIBRARIES
++ KF5::WaylandServer
++ Wayland::Server
++)
++endif(KF5Wayland_FOUND)
+
+ add_library(KScreenLocker SHARED ${ksld_SRCS})
+
+@@ -171,8 +179,7 @@
+ ${X11_LIBRARIES}
+ XCB::XCB
+ XCB::KEYSYMS
+- KF5::WaylandServer
+- Wayland::Server
++ ${OPT_WL_LIBRARIES}
+ )
+
+ if (X11_Xinput_FOUND)
+--- kscreenlocker-5.12.9/ksldapp.cpp.old 2019-09-10 10:30:16.000000000 +0000
++++ kscreenlocker-5.12.9/ksldapp.cpp 2019-12-29 17:00:37.930322855 +0000
+@@ -38,9 +38,11 @@
+ #include <KNotification>
+ #include <KGlobalAccel>
+
++#ifdef WAYLAND_FOUND
+ //kwayland
+ #include <KWayland/Server/display.h>
+ #include <KWayland/Server/clientconnection.h>
++#endif
+
+ // Qt
+ #include <QAction>
+@@ -84,8 +86,10 @@
+ , m_lockState(Unlocked)
+ , m_lockProcess(NULL)
+ , m_lockWindow(NULL)
++#ifdef WAYLAND_FOUND
+ , m_waylandServer(new WaylandServer(this))
+ , m_waylandDisplay(nullptr)
++#endif /* WAYLAND_FOUND */
+ , m_lockedTimer(QElapsedTimer())
+ , m_idleId(0)
+ , m_lockGrace(0)
+@@ -96,8 +100,12 @@
+ , m_greeterEnv(QProcessEnvironment::systemEnvironment())
+ , m_powerManagementInhibition(new PowerManagementInhibition(this))
+ {
++#ifdef WAYLAND_FOUND
+ m_isX11 = QX11Info::isPlatformX11();
+ m_isWayland = QCoreApplication::instance()->property("platformName").toString().startsWith( QLatin1String("wayland"), Qt::CaseInsensitive);
++#else
++ m_isX11 = true;
++#endif
+ }
+
+ KSldApp::~KSldApp()
+@@ -215,9 +223,11 @@
+ auto finishedSignal = static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished);
+ connect(m_lockProcess, finishedSignal, this,
+ [this](int exitCode, QProcess::ExitStatus exitStatus) {
++#ifdef WAYLAND_FOUND
+ if (m_isWayland && m_waylandDisplay && m_greeterClientConnection) {
+ m_greeterClientConnection->destroy();
+ }
++#endif /* WAYLAND_FOUND */
+ if ((!exitCode && exitStatus == QProcess::NormalExit) || s_graceTimeKill || s_logindExit) {
+ // unlock process finished successfully - we can remove the lock grab
+ s_graceTimeKill = false;
+@@ -240,7 +250,9 @@
+ [this](QProcess::ProcessError error) {
+ if (error == QProcess::FailedToStart) {
+ doUnlock();
++#ifdef WAYLAND_FOUND
+ m_waylandServer->stop();
++#endif /* WAYLAND_FOUND */
+ qCritical() << "Greeter Process not available";
+ }
+ }
+@@ -533,7 +545,9 @@
+ m_lockedTimer.invalidate();
+ m_greeterCrashedCounter = 0;
+ endGraceTime();
++#ifdef WAYLAND_FOUND
+ m_waylandServer->stop();
++#endif /* WAYLAND_FOUND */
+ KNotification::event(QStringLiteral("unlocked"),
+ i18n("Screen unlocked"),
+ QPixmap(),
+@@ -553,6 +567,7 @@
+ {
+ QProcessEnvironment env = m_greeterEnv;
+
++#ifdef WAYLAND_FOUND
+ if (m_isWayland && m_waylandDisplay) {
+ int sx[2];
+ if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sx) < 0) {
+@@ -576,6 +591,7 @@
+ env.insert("WAYLAND_SOCKET", QByteArray::number(socket));
+ }
+ }
++#endif /* WAYLAND_FOUND */
+ QStringList args;
+ if (establishLock == EstablishLock::Immediate) {
+ args << QStringLiteral("--immediateLock");
+@@ -596,6 +612,7 @@
+ env.insert(s_qtQuickBackend, QStringLiteral("software"));
+ }
+
++#ifdef WAYLAND_FOUND
+ // start the Wayland server
+ int fd = m_waylandServer->start();
+ if (fd == -1) {
+@@ -605,10 +622,13 @@
+
+ args << QStringLiteral("--ksldfd");
+ args << QString::number(fd);
++#endif /* WAYLAND_FOUND */
+
+ m_lockProcess->setProcessEnvironment(env);
+ m_lockProcess->start(QStringLiteral(KSCREENLOCKER_GREET_BIN), args);
++#ifdef WAYLAND_FOUND
+ close(fd);
++#endif
+ }
+
+ void KSldApp::showLockWindow()
+@@ -617,9 +637,11 @@
+ if (m_isX11) {
+ m_lockWindow = new X11Locker(this);
+ }
++#ifdef WAYLAND_FOUND
+ if (m_isWayland) {
+ m_lockWindow = new WaylandLocker(m_waylandDisplay, this);
+ }
++#endif /* WAYLAND_FOUND */
+ if (!m_lockWindow) {
+ return;
+ }
+@@ -637,7 +659,9 @@
+ lockScreenShown();
+ }
+ , Qt::QueuedConnection);
++#ifdef WAYLAND_FOUND
+ connect(m_waylandServer, &WaylandServer::x11WindowAdded, m_lockWindow, &AbstractLocker::addAllowedWindow);
++#endif /* WAYLAND_FOUND */
+ }
+ m_lockWindow->showLockWindow();
+ if (m_isX11) {
+@@ -702,12 +726,14 @@
+ }
+ }
+
++#ifdef WAYLAND_FOUND
+ void KSldApp::setWaylandDisplay(KWayland::Server::Display *display)
+ {
+ if (m_waylandDisplay != display) {
+ m_waylandDisplay = display;
+ }
+ }
++#endif /* WAYLAND_FOUND */
+
+ void KSldApp::lockScreenShown()
+ {
+@@ -723,9 +749,11 @@
+ void KSldApp::setGreeterEnvironment(const QProcessEnvironment &env)
+ {
+ m_greeterEnv = env;
++#ifdef WAYLAND_FOUND
+ if (m_isWayland) {
+ m_greeterEnv.insert(QStringLiteral("QT_QPA_PLATFORM"), QStringLiteral("wayland"));
+ }
++#endif /* WAYLAND_FOUND */
+ }
+
+ bool KSldApp::event(QEvent *event)
+--- kscreenlocker-5.12.9/autotests/CMakeLists.txt.old 2019-09-10 10:30:16.000000000 +0000
++++ kscreenlocker-5.12.9/autotests/CMakeLists.txt 2019-12-29 17:16:10.540254516 +0000
+@@ -55,6 +55,7 @@
+ add_test(ksmserver-x11LockerTest x11LockerTest)
+ ecm_mark_as_test(x11LockerTest)
+
++if(KF5Wayland_FOUND)
+ #######################################
+ # NoScreensTest
+ #######################################
+@@ -67,3 +68,4 @@
+ )
+ add_test(ksld-noScreensTest noScreensTest)
+ ecm_mark_as_test(noScreensTest)
++endif()
+--- kscreenlocker-5.12.9/greeter/greeterapp.cpp.old 2019-09-10 10:30:16.000000000 +0000
++++ kscreenlocker-5.12.9/greeter/greeterapp.cpp 2019-12-29 17:14:57.458241696 +0000
+@@ -26,6 +26,7 @@
+ #include "lnf_integration.h"
+
+ #include <config-kscreenlocker.h>
++#include <config-workspace.h>
+
+ // KDE
+ #include <KAuthorized>
+@@ -40,12 +41,14 @@
+ #include <KPackage/Package>
+ #include <KPackage/PackageStructure>
+ #include <KPackage/PackageLoader>
++#ifdef WAYLAND_FOUND
+ // KWayland
+ #include <KWayland/Client/connection_thread.h>
+ #include <KWayland/Client/event_queue.h>
+ #include <KWayland/Client/plasmashell.h>
+ #include <KWayland/Client/registry.h>
+ #include <KWayland/Client/surface.h>
++#endif
+ // Qt
+ #include <QClipboard>
+ #include <QAbstractNativeEventFilter>
+@@ -63,9 +66,11 @@
+ #include <QQmlExpression>
+
+ #include <QX11Info>
++#ifdef WAYLAND_FOUND
+ // Wayland
+ #include <wayland-client.h>
+ #include <wayland-ksld-client-protocol.h>
++#endif
+ // X11
+ #include <X11/Xatom.h>
+ #include <X11/Xlib.h>
+@@ -137,6 +142,7 @@
+ }
+ qDeleteAll(m_views);
+
++#ifdef WAYLAND_FOUND
+ if (m_ksldInterface) {
+ org_kde_ksld_destroy(m_ksldInterface);
+ }
+@@ -148,6 +154,7 @@
+ m_ksldConnectionThread->quit();
+ m_ksldConnectionThread->wait();
+ }
++#endif /* WAYLAND_FOUND */
+ }
+
+ Authenticator *UnlockApp::createAuthenticator()
+@@ -165,7 +172,10 @@
+
+ void UnlockApp::initialize()
+ {
++#ifdef WAYLAND_FOUND
+ initializeWayland();
++#endif /* WAYLAND_FOUND */
++
+ // set up the request ignore timeout, so that multiple requests to sleep/suspend/shutdown
+ // are not processed in quick (and confusing) succession)
+ m_resetRequestIgnoreTimer->setSingleShot(true);
+@@ -205,6 +215,7 @@
+ if (!platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
+ return;
+ }
++#ifdef WAYLAND_FOUND
+ using namespace KWayland::Client;
+ auto *c = ConnectionThread::fromApplication(this);
+ if (!c) {
+@@ -219,6 +230,7 @@
+ return;
+ }
+ m_plasmaShell = r->createPlasmaShell(i.name, i.version, this);
++#endif /* WAYLAND_FOUND */
+ }
+
+ void UnlockApp::loadWallpaperPlugin(KQuickAddons::QuickViewSharedEngine *view)
+@@ -281,6 +293,7 @@
+ }
+ }
+
++#ifdef WAYLAND_FOUND
+ if (m_ksldInterface) {
+ view->create();
+ org_kde_ksld_x11window(m_ksldInterface, view->winId());
+@@ -294,6 +307,7 @@
+ view->setProperty("plasmaShellSurface", QVariant::fromValue(shellSurface));
+ }
+ }
++#endif /* WAYLAND_FOUND */
+
+ // engine stuff
+ QQmlContext* context = view->engine()->rootContext();
+@@ -353,10 +367,14 @@
+
+ auto screen = QGuiApplication::screens()[i];
+ view->setGeometry(screen->geometry());
++#ifdef WAYLAND_FOUND
+ KWayland::Client::PlasmaShellSurface *plasmaSurface = view->property("plasmaShellSurface").value<KWayland::Client::PlasmaShellSurface *>();
+ if (plasmaSurface) {
+ plasmaSurface->setPosition(view->geometry().topLeft());
+ }
++#else
++ void *plasmaSurface = nullptr;
++#endif /* WAYLAND_FOUND */
+ if (auto object = view->property("wallpaperGraphicsObject").value<KDeclarative::QmlObjectSharedEngine*>()) {
+ //initialize with our size to avoid as much resize events as possible
+ object->completeInitialization({
+@@ -370,9 +388,11 @@
+ view,
+ [view, plasmaSurface](const QRect &geo) {
+ view->setGeometry(geo);
++#ifdef WAYLAND_FOUND
+ if (plasmaSurface) {
+ plasmaSurface->setPosition(view->geometry().topLeft());
+ }
++#endif /* WAYLAND_FOUND */
+ }
+ );
+
+@@ -477,6 +497,7 @@
+
+ void UnlockApp::suspendToRam()
+ {
++#ifdef WAYLAND_FOUND
+ if (m_ignoreRequests) {
+ return;
+ }
+@@ -485,11 +506,12 @@
+ m_resetRequestIgnoreTimer->start();
+
+ org_kde_ksld_suspendSystem(m_ksldInterface);
+-
++#endif /* WAYLAND_FOUND */
+ }
+
+ void UnlockApp::suspendToDisk()
+ {
++#ifdef WAYLAND_FOUND
+ if (m_ignoreRequests) {
+ return;
+ }
+@@ -498,6 +520,7 @@
+ m_resetRequestIgnoreTimer->start();
+
+ org_kde_ksld_hibernateSystem(m_ksldInterface);
++#endif /* WAYLAND_FOUND */
+ }
+
+ void UnlockApp::setTesting(bool enable)
+@@ -626,7 +649,7 @@
+ m_defaultToSwitchUser = defaultToSwitchUser;
+ }
+
+-
++#ifdef WAYLAND_FOUND
+ static void osdProgress(void *data, org_kde_ksld *org_kde_ksld, const char *icon, int32_t percent, const char *text)
+ {
+ Q_UNUSED(org_kde_ksld)
+@@ -657,9 +680,11 @@
+ canSuspend,
+ canHibernate
+ };
++#endif /* WAYLAND_FOUND */
+
+ void UnlockApp::setKsldSocket(int socket)
+ {
++#ifdef WAYLAND_FOUND
+ using namespace KWayland::Client;
+ m_ksldConnection = new ConnectionThread;
+ m_ksldConnection->setSocketFd(socket);
+@@ -697,6 +722,7 @@
+ m_ksldConnection->moveToThread(m_ksldConnectionThread);
+ m_ksldConnectionThread->start();
+ m_ksldConnection->initConnection();
++#endif /* WAYLAND_FOUND */
+ }
+
+ void UnlockApp::osdProgress(const QString &icon, int percent, const QString &additionalText)
+--- kscreenlocker-5.12.9/greeter/CMakeLists.txt.old 2019-09-10 10:30:16.000000000 +0000
++++ kscreenlocker-5.12.9/greeter/CMakeLists.txt 2019-12-29 17:29:44.832222068 +0000
+@@ -24,10 +24,16 @@
+ qt5_add_resources(kscreenlocker_greet_SRCS fallbacktheme.qrc)
+ kconfig_add_kcfg_files(kscreenlocker_greet_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../kcfg/kscreensaversettings.kcfgc)
+
++if(KF5Wayland_FOUND)
+ ecm_add_wayland_client_protocol(kscreenlocker_greet_SRCS
+ PROTOCOL ../protocols/ksld.xml
+ BASENAME ksld
+ )
++set(OPT_WL_CLI_LIBRARIES
++ KF5::WaylandClient
++ Wayland::Client
++)
++endif()
+
+ add_executable(kscreenlocker_greet ${kscreenlocker_greet_SRCS})
+
+@@ -43,8 +49,7 @@
+ Qt5::Qml
+ Qt5::X11Extras
+ ${X11_LIBRARIES}
+- KF5::WaylandClient
+- Wayland::Client
++ ${OPT_WL_CLI_LIBRARIES}
+ )
+ if(HAVE_SECCOMP)
+ target_link_libraries(kscreenlocker_greet Qt5::DBus Seccomp::Seccomp)