From owner-dev-commits-ports-all@freebsd.org Fri Apr 30 15:29:40 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF43062288D; Fri, 30 Apr 2021 15:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FWxBD66z8z4rbQ; Fri, 30 Apr 2021 15:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3C002E5B6; Fri, 30 Apr 2021 15:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13UFTeMS019997; Fri, 30 Apr 2021 15:29:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13UFTeL3019996; Fri, 30 Apr 2021 15:29:40 GMT (envelope-from git) Date: Fri, 30 Apr 2021 15:29:40 GMT Message-Id: <202104301529.13UFTeL3019996@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Adriaan de Groot Subject: git: 7dbd17a38d01 - main - x11/plasma5-plasma-workspace: add helper script for Plasma Wayland MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adridg X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7dbd17a38d01f5f027e16ec8a77565d6822320db Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 15:29:41 -0000 The branch main has been updated by adridg: URL: https://cgit.FreeBSD.org/ports/commit/?id=7dbd17a38d01f5f027e16ec8a77565d6822320db commit 7dbd17a38d01f5f027e16ec8a77565d6822320db Author: Adriaan de Groot AuthorDate: 2021-04-30 15:06:08 +0000 Commit: Adriaan de Groot CommitDate: 2021-04-30 15:29:36 +0000 x11/plasma5-plasma-workspace: add helper script for Plasma Wayland There are a handful of environment variables that need to be set for a KDE Plasma Wayland session. In addition, it needs a ConsoleKit session and its own session DBus. Add a suitable shell script that can live alongside the regular executable. Note that the .desktop file for Plasma does **not** use this script -- but then again, SDDM doesn't hand off to Wayland nicely either, so you need to start Plasma Wayland from a text console anyway. That's simple enough now: `startplasma-wayland.sh` --- x11/plasma5-plasma-workspace/Makefile | 5 +- .../files/startplasma-wayland.sh | 61 ++++++++++++++++++++++ x11/plasma5-plasma-workspace/pkg-plist | 1 + 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/x11/plasma5-plasma-workspace/Makefile b/x11/plasma5-plasma-workspace/Makefile index 5e1f510cf9c3..fbaacd9b9af0 100644 --- a/x11/plasma5-plasma-workspace/Makefile +++ b/x11/plasma5-plasma-workspace/Makefile @@ -1,6 +1,6 @@ PORTNAME= plasma-workspace DISTVERSION= ${KDE_PLASMA_VERSION} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11 kde kde-plasma MAINTAINER= kde@FreeBSD.org @@ -51,4 +51,7 @@ CMAKE_OFF= BUILD_TESTING # In 5.15 a file was moved from x11/plasma5-plasma-desktop to x11/plasma5-plasma-workspace: CONFLICTS_INSTALL= plasma5-plasma-desktop-5.14.* +post-stage: + ${INSTALL_SCRIPT} ${FILESDIR}/startplasma-wayland.sh ${STAGEDIR}/${LOCALBASE}/bin/ + .include diff --git a/x11/plasma5-plasma-workspace/files/startplasma-wayland.sh b/x11/plasma5-plasma-workspace/files/startplasma-wayland.sh new file mode 100755 index 000000000000..cfd30dacc18a --- /dev/null +++ b/x11/plasma5-plasma-workspace/files/startplasma-wayland.sh @@ -0,0 +1,61 @@ +#! /bin/sh +# +# Try to run a Plasma Wayland session; to be invoked from a text console + +### TOOLKIT SETTINGS +# +# Tell toolkits to use wayland +export MOZ_ENABLE_WAYLAND=1 +export GDK_BACKEND=wayland +export QT_QPA_PLATFORM=wayland-egl +export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 + +# Possible settings for drivers +# +# Some (older) Intel HD iGPU need this: +# export LIBVA_DRIVER_NAME=i965 + +### XDG SETTINGS +# +# +if test -z "$XDG_RUNTIME_DIR"; then + export XDG_RUNTIME_DIR=/tmp/`id -u`-runtime-dir + if ! test -d "$XDG_RUNTIME_DIR"; then + mkdir "$XDG_RUNTIME_DIR" + chmod 0700 "$XDG_RUNTIME_DIR" + fi +fi +export XDG_SESSION_TYPE=wayland + +### KDE / Plasma / Qt settings +# +# +# To switch on software rendering: +# export KWIN_COMPOSE=Q +# To log debug things: +# export QT_LOGGING_RULES="kwin_core.debug=true;kwin_libinput.debug=true" +# To log to a specific file (recommended if you're using the logging rules +# and want to debug startup problems): +# LOGFILE=/tmp/plasma-wayland.log + +# TODO: check if ck-launch-session is needed +scaffolding="ck-launch-session" +if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] ; then + scaffolding="$scaffolding dbus-run-session" +fi + +startup_dir=`/usr/bin/dirname "$0"` +startup_exe=`/usr/bin/basename "$0" .sh` + +if [ -z "$LOGFILE" ] ; then + { + echo "Starting KDE Plasma Wayland from PID $$" + echo "XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR" + echo "scaffolding=$scaffolding" + echo "startup=$startup_dir/$startup_exe" + } > $LOGFILE + + exec $scaffolding $startup_dir/$startup_exe 2>&1 | tee -a $LOG +else + exec $scaffolding $startup_dir/$startup_exe +fi diff --git a/x11/plasma5-plasma-workspace/pkg-plist b/x11/plasma5-plasma-workspace/pkg-plist index 176f7123e8de..cffdc489c379 100644 --- a/x11/plasma5-plasma-workspace/pkg-plist +++ b/x11/plasma5-plasma-workspace/pkg-plist @@ -16,6 +16,7 @@ bin/plasma_waitforname bin/plasmashell bin/plasmawindowed bin/startplasma-wayland +bin/startplasma-wayland.sh bin/startplasma-x11 bin/systemmonitor bin/xembedsniproxy