uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,114 @@
|
|||
From 29ec6fada935ef966e5859082435ed57daa9522d Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Dionne-Riel <samuel@dionne-riel.com>
|
||||
Date: Tue, 16 Mar 2021 15:03:59 -0400
|
||||
Subject: [PATCH] [NixOS] Unwrap executable name for .desktop search
|
||||
|
||||
Why is this necessary even though -a "$0" is used in the wrapper?
|
||||
Because it's completely bypassing argv0! This looks at the executable
|
||||
file in-use according to the kernel!
|
||||
|
||||
Wrappers cannot affect the `/proc/.../exe` symlink!
|
||||
|
||||
Co-authored-by: Yaroslav Bolyukin <iam@lach.pw>
|
||||
---
|
||||
src/nixos_utils.h | 41 +++++++++++++++++++++++++++++++++++++++++
|
||||
src/service_utils.h | 4 +++-
|
||||
src/waylandclient.cpp | 5 ++++-
|
||||
3 files changed, 48 insertions(+), 2 deletions(-)
|
||||
create mode 100644 src/nixos_utils.h
|
||||
|
||||
diff --git a/src/nixos_utils.h b/src/nixos_utils.h
|
||||
new file mode 100644
|
||||
index 0000000..726065d
|
||||
--- /dev/null
|
||||
+++ b/src/nixos_utils.h
|
||||
@@ -0,0 +1,41 @@
|
||||
+#ifndef NIXOS_UTILS_H
|
||||
+#define NIXOS_UTILS_H
|
||||
+
|
||||
+// kwin
|
||||
+#include <kwinglobals.h>
|
||||
+
|
||||
+namespace KWin
|
||||
+{
|
||||
+
|
||||
+static QString unwrapExecutablePath(const QString &in_executablePath)
|
||||
+{
|
||||
+ // NixOS fixes many packaging issues through "wrapper" scripts that manipulates the environment or does
|
||||
+ // miscellaneous trickeries and mischievous things to make the programs work.
|
||||
+ // In turn, programs often employs different mischievous schemes and trickeries to do *other things.
|
||||
+ // It often happens that they conflict.
|
||||
+ // Here, `kwin` tries to detect the .desktop file for a given process.
|
||||
+ // `kwin` followed the process `/proc/.../exe` up to the actual binary running.
|
||||
+ // It normally would be fine, e.g. /usr/bin/foobar is what's in the desktop file.
|
||||
+ // But it's not the truth here! It's extremely likely the resolved path is /nix/store/.../bin/.foobar-wrapped
|
||||
+ // rather than what the desktop file points to, something like /nix/store/.../bin/foobar !!
|
||||
+ // Since the wrappers for Nixpkgs *always* prepend a dot and append -wrapped, we assume here that we can keep
|
||||
+ // `/^(.*)\/\.([^/]*)-wrapped/` until the (equivalent) regex does not match.
|
||||
+ // This should canonicalize the wrapper name to the expected name to look for in the desktop file.
|
||||
+
|
||||
+ // Use a copy of the const string
|
||||
+ QString executablePath(in_executablePath);
|
||||
+
|
||||
+ // While the parts needed are present, "unwrap" one layer of wrapper names.
|
||||
+ while (executablePath.endsWith("-wrapped") && executablePath[executablePath.lastIndexOf("/")+1] == QChar('.')) {
|
||||
+ // Approximately equivalent to s/-wrapped$//
|
||||
+ executablePath.remove(executablePath.length() - 8, 8);
|
||||
+ // Approximately equivalent to s;/\.;/;
|
||||
+ executablePath.remove(executablePath.lastIndexOf("/")+1, 1);
|
||||
+ }
|
||||
+
|
||||
+ return executablePath;
|
||||
+}
|
||||
+
|
||||
+}// namespace
|
||||
+
|
||||
+#endif // NIXOS_UTILS_H
|
||||
diff --git a/src/utils/serviceutils.h b/src/utils/serviceutils.h
|
||||
index 8a70c1f..475b15d 100644
|
||||
--- a/src/utils/serviceutils.h
|
||||
+++ b/src/utils/serviceutils.h
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <QLoggingCategory>
|
||||
//KF
|
||||
#include <KApplicationTrader>
|
||||
+#include "nixos_utils.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
@@ -26,8 +27,9 @@ namespace KWin
|
||||
const static QString s_waylandInterfaceName = QStringLiteral("X-KDE-Wayland-Interfaces");
|
||||
const static QString s_dbusRestrictedInterfaceName = QStringLiteral("X-KDE-DBUS-Restricted-Interfaces");
|
||||
|
||||
-static QStringList fetchProcessServiceField(const QString &executablePath, const QString &fieldName)
|
||||
+static QStringList fetchProcessServiceField(const QString &in_executablePath, const QString &fieldName)
|
||||
{
|
||||
+ const QString executablePath = unwrapExecutablePath(in_executablePath);
|
||||
// needed to be able to use the logging category in a header static function
|
||||
static QLoggingCategory KWIN_UTILS ("KWIN_UTILS", QtWarningMsg);
|
||||
const auto servicesFound = KApplicationTrader::query([&executablePath] (const KService::Ptr &service) {
|
||||
diff --git a/src/waylandclient.cpp b/src/waylandclient.cpp
|
||||
index fd2c0c1..ae8cf96 100644
|
||||
--- a/src/waylandclient.cpp
|
||||
+++ b/src/waylandclient.cpp
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "screens.h"
|
||||
#include "wayland_server.h"
|
||||
#include "workspace.h"
|
||||
+#include "nixos_utils.h"
|
||||
|
||||
#include <KWaylandServer/display.h>
|
||||
#include <KWaylandServer/clientbuffer.h>
|
||||
@@ -173,7 +174,9 @@ void WaylandClient::updateIcon()
|
||||
|
||||
void WaylandClient::updateResourceName()
|
||||
{
|
||||
- const QFileInfo fileInfo(surface()->client()->executablePath());
|
||||
+ const QString in_path = surface()->client()->executablePath();
|
||||
+ const QString path = unwrapExecutablePath(in_path);
|
||||
+ const QFileInfo fileInfo(path);
|
||||
if (fileInfo.exists()) {
|
||||
const QByteArray executableFileName = fileInfo.fileName().toUtf8();
|
||||
setResourceClass(executableFileName, executableFileName);
|
||||
--
|
||||
2.32.0
|
||||
25
pkgs/desktops/plasma-5/kwin/0001-follow-symlinks.patch
Normal file
25
pkgs/desktops/plasma-5/kwin/0001-follow-symlinks.patch
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
From af569c9ed8079169b524b31461e2789baa09ef7a Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Tuegel <ttuegel@mailbox.org>
|
||||
Date: Mon, 27 Jan 2020 05:31:13 -0600
|
||||
Subject: [PATCH 1/3] follow symlinks
|
||||
|
||||
---
|
||||
src/plugins/kdecorations/aurorae/src/aurorae.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/plugins/kdecorations/aurorae/src/aurorae.cpp b/src/plugins/kdecorations/aurorae/src/aurorae.cpp
|
||||
index 5242cb7..2e4ddae 100644
|
||||
--- a/src/plugins/kdecorations/aurorae/src/aurorae.cpp
|
||||
+++ b/src/plugins/kdecorations/aurorae/src/aurorae.cpp
|
||||
@@ -201,7 +201,7 @@ void Helper::init()
|
||||
// so let's try to locate our plugin:
|
||||
QString pluginPath;
|
||||
for (const QString &path : m_engine->importPathList()) {
|
||||
- QDirIterator it(path, QDirIterator::Subdirectories);
|
||||
+ QDirIterator it(path, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
QFileInfo fileInfo = it.fileInfo();
|
||||
--
|
||||
2.29.2
|
||||
|
||||
25
pkgs/desktops/plasma-5/kwin/0002-xwayland.patch
Normal file
25
pkgs/desktops/plasma-5/kwin/0002-xwayland.patch
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
From 5c90dd84f541bd4789525f12f12ad24411b99018 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Tuegel <ttuegel@mailbox.org>
|
||||
Date: Mon, 27 Jan 2020 05:31:23 -0600
|
||||
Subject: [PATCH 2/3] xwayland
|
||||
|
||||
---
|
||||
src/xwl/xwayland.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/xwl/xwayland.cpp b/src/xwl/xwayland.cpp
|
||||
index 57efdde..a211a58 100644
|
||||
--- a/src/xwl/xwayland.cpp
|
||||
+++ b/src/xwl/xwayland.cpp
|
||||
@@ -124,7 +124,7 @@ void Xwayland::start()
|
||||
|
||||
m_xwaylandProcess = new Process(this);
|
||||
m_xwaylandProcess->setProcessChannelMode(QProcess::ForwardedErrorChannel);
|
||||
- m_xwaylandProcess->setProgram(QStringLiteral("Xwayland"));
|
||||
+ m_xwaylandProcess->setProgram(QLatin1String(NIXPKGS_XWAYLAND));
|
||||
QProcessEnvironment env = m_app->processStartupEnvironment();
|
||||
env.insert("WAYLAND_SOCKET", QByteArray::number(wlfd));
|
||||
env.insert("EGL_PLATFORM", QByteArrayLiteral("DRM"));
|
||||
--
|
||||
2.29.2
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
From 8d49f5ef8692c352a62f4f8b1bc68e6e210bbee6 Mon Sep 17 00:00:00 2001
|
||||
From: Yaroslav Bolyukin <iam@lach.pw>
|
||||
Date: Wed, 23 Dec 2020 18:02:14 +0300
|
||||
Subject: [PATCH 3/3] plugins/qpa: allow using nixos wrapper
|
||||
|
||||
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
|
||||
---
|
||||
src/plugins/qpa/main.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/plugins/qpa/main.cpp b/src/plugins/qpa/main.cpp
|
||||
index efd236b..a69c046 100644
|
||||
--- a/src/plugins/qpa/main.cpp
|
||||
+++ b/src/plugins/qpa/main.cpp
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
QPlatformIntegration *KWinIntegrationPlugin::create(const QString &system, const QStringList ¶mList)
|
||||
{
|
||||
Q_UNUSED(paramList)
|
||||
- if (!QCoreApplication::applicationFilePath().endsWith(QLatin1String("kwin_wayland")) && !qEnvironmentVariableIsSet("KWIN_FORCE_OWN_QPA")) {
|
||||
+ if (!QCoreApplication::applicationFilePath().endsWith(QLatin1String("kwin_wayland")) && !QCoreApplication::applicationFilePath().endsWith(QLatin1String(".kwin_wayland-wrapped")) && !qEnvironmentVariableIsSet("KWIN_FORCE_OWN_QPA")) {
|
||||
// Not KWin
|
||||
return nullptr;
|
||||
}
|
||||
--
|
||||
2.29.2
|
||||
|
||||
65
pkgs/desktops/plasma-5/kwin/default.nix
Normal file
65
pkgs/desktops/plasma-5/kwin/default.nix
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
mkDerivation, lib,
|
||||
extra-cmake-modules, kdoctools, fetchpatch,
|
||||
|
||||
libepoxy, lcms2, libICE, libSM, libcap, libdrm, libinput, libxkbcommon, mesa,
|
||||
pipewire, udev, wayland, xcb-util-cursor, xwayland,
|
||||
|
||||
qtdeclarative, qtmultimedia, qtquickcontrols2, qtscript, qtsensors,
|
||||
qtvirtualkeyboard, qtx11extras,
|
||||
|
||||
breeze-qt5, kactivities, kcompletion, kcmutils, kconfig, kconfigwidgets,
|
||||
kcoreaddons, kcrash, kdeclarative, kdecoration, kglobalaccel, ki18n,
|
||||
kiconthemes, kidletime, kinit, kio, knewstuff, knotifications, kpackage,
|
||||
krunner, kscreenlocker, kservice, kwayland, kwayland-server, kwidgetsaddons,
|
||||
kwindowsystem, kxmlgui, plasma-framework, libqaccessibilityclient,
|
||||
}:
|
||||
|
||||
# TODO (ttuegel): investigate qmlplugindump failure
|
||||
|
||||
mkDerivation {
|
||||
pname = "kwin";
|
||||
nativeBuildInputs = [ extra-cmake-modules kdoctools ];
|
||||
buildInputs = [
|
||||
libepoxy lcms2 libICE libSM libcap libdrm libinput libxkbcommon mesa pipewire
|
||||
udev wayland xcb-util-cursor xwayland
|
||||
|
||||
qtdeclarative qtmultimedia qtquickcontrols2 qtscript qtsensors
|
||||
qtvirtualkeyboard qtx11extras
|
||||
|
||||
breeze-qt5 kactivities kcmutils kcompletion kconfig kconfigwidgets
|
||||
kcoreaddons kcrash kdeclarative kdecoration kglobalaccel ki18n kiconthemes
|
||||
kidletime kinit kio knewstuff knotifications kpackage krunner kscreenlocker
|
||||
kservice kwayland kwayland-server kwidgetsaddons kwindowsystem kxmlgui
|
||||
plasma-framework libqaccessibilityclient
|
||||
|
||||
];
|
||||
outputs = [ "out" "dev" ];
|
||||
patches = [
|
||||
./0001-follow-symlinks.patch
|
||||
./0002-xwayland.patch
|
||||
./0003-plugins-qpa-allow-using-nixos-wrapper.patch
|
||||
./0001-NixOS-Unwrap-executable-name-for-.desktop-search.patch
|
||||
# Pass special environments through arguemnts to `kwin_wayland`, bypassing
|
||||
# ld.so(8) environment stripping due to `kwin_wayland`'s capabilities.
|
||||
# We need this to have `TZDIR` correctly set for `plasmashell`, or
|
||||
# everything related to timezone, like clock widgets, will be broken.
|
||||
# https://invent.kde.org/plasma/kwin/-/merge_requests/1590
|
||||
(fetchpatch {
|
||||
url = "https://invent.kde.org/plasma/kwin/-/commit/9a008b223ad696db3bf5692750f2b74e578e08b8.diff";
|
||||
sha256 = "sha256-f35G+g2MVABLDbAkCed3ZmtDWrzYn1rdD08mEx35j4k=";
|
||||
})
|
||||
];
|
||||
CXXFLAGS = [
|
||||
''-DNIXPKGS_XWAYLAND=\"${lib.getBin xwayland}/bin/Xwayland\"''
|
||||
];
|
||||
cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" ];
|
||||
postInstall = ''
|
||||
# Some package(s) refer to these service types by the wrong name.
|
||||
# I would prefer to patch those packages, but I cannot find them!
|
||||
ln -s ''${!outputBin}/share/kservicetypes5/kwineffect.desktop \
|
||||
''${!outputBin}/share/kservicetypes5/kwin-effect.desktop
|
||||
ln -s ''${!outputBin}/share/kservicetypes5/kwinscript.desktop \
|
||||
''${!outputBin}/share/kservicetypes5/kwin-script.desktop
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue