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:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,81 @@
{ mkDerivation, lib, fetchFromGitHub, fetchpatch
, cmake, extra-cmake-modules, pkg-config, libxcb, libpthreadstubs
, libXdmcp, libXau, qtbase, qtdeclarative, qtquickcontrols2, qttools, pam, systemd
}:
let
version = "0.19.0";
in mkDerivation {
pname = "sddm";
inherit version;
src = fetchFromGitHub {
owner = "sddm";
repo = "sddm";
rev = "v${version}";
sha256 = "1s6icb5r1n6grfs137gdzfrcvwsb3hvlhib2zh6931x8pkl1qvxa";
};
patches = [
./sddm-ignore-config-mtime.patch
./sddm-default-session.patch
# Load `/etc/profile` for `environment.variables` with zsh default shell.
# See: https://github.com/sddm/sddm/pull/1382
(fetchpatch {
url = "https://github.com/sddm/sddm/commit/e1dedeeab6de565e043f26ac16033e613c222ef9.patch";
sha256 = "sha256-OPyrUI3bbH+PGDBfoL4Ohb4wIvmy9TeYZhE0JxR/D58=";
})
# Fix build with Qt 5.15.3
# See: https://github.com/sddm/sddm/pull/1325
(fetchpatch {
url = "https://github.com/sddm/sddm/commit/e93bf95c54ad8c2a1604f8d7be05339164b19308.patch";
sha256 = "sha256:1rh6sdvzivjcl5b05fczarvxhgpjhi7019hvf2gadnwgwdg104r4";
})
];
postPatch =
# Fix missing include for gettimeofday()
''
sed -e '1i#include <sys/time.h>' -i src/helper/HelperApp.cpp
'';
nativeBuildInputs = [ cmake extra-cmake-modules pkg-config qttools ];
buildInputs = [
libxcb libpthreadstubs libXdmcp libXau pam qtbase qtdeclarative qtquickcontrols2 systemd
];
cmakeFlags = [
"-DCONFIG_FILE=/etc/sddm.conf"
# Set UID_MIN and UID_MAX so that the build script won't try
# to read them from /etc/login.defs (fails in chroot).
# The values come from NixOS; they may not be appropriate
# for running SDDM outside NixOS, but that configuration is
# not supported anyway.
"-DUID_MIN=1000"
"-DUID_MAX=29999"
"-DQT_IMPORTS_DIR=${placeholder "out"}/${qtbase.qtQmlPrefix}"
"-DCMAKE_INSTALL_SYSCONFDIR=${placeholder "out"}/etc"
"-DSYSTEMD_SYSTEM_UNIT_DIR=${placeholder "out"}/lib/systemd/system"
"-DDBUS_CONFIG_DIR=${placeholder "out"}/share/dbus-1/system.d"
];
postInstall = ''
# remove empty scripts
rm "$out/share/sddm/scripts/Xsetup" "$out/share/sddm/scripts/Xstop"
for f in $out/share/sddm/themes/**/theme.conf ; do
substituteInPlace $f \
--replace 'background=' "background=$(dirname $f)/"
done
'';
meta = with lib; {
description = "QML based X11 display manager";
homepage = "https://github.com/sddm/sddm";
maintainers = with maintainers; [ abbradar ttuegel ];
platforms = platforms.linux;
license = licenses.gpl2Plus;
};
}

View file

@ -0,0 +1,71 @@
diff --git a/src/common/Configuration.h b/src/common/Configuration.h
index cf44a62..7bb9c03 100644
--- a/src/common/Configuration.h
+++ b/src/common/Configuration.h
@@ -44,6 +44,7 @@ namespace SDDM {
"NOTE: Currently ignored if autologin is enabled."));
Entry(InputMethod, QString, QStringLiteral("qtvirtualkeyboard"), _S("Input method module"));
Entry(Namespaces, QStringList, QStringList(), _S("Comma-separated list of Linux namespaces for user session to enter"));
+ Entry(DefaultSession, QString, QString(), _S("System-wide default session"));
// Name Entries (but it's a regular class again)
Section(Theme,
Entry(ThemeDir, QString, _S(DATA_INSTALL_DIR "/themes"), _S("Theme directory path"));
diff --git a/src/greeter/SessionModel.cpp b/src/greeter/SessionModel.cpp
index 1953c76..54fe2f2 100644
--- a/src/greeter/SessionModel.cpp
+++ b/src/greeter/SessionModel.cpp
@@ -43,6 +43,7 @@ namespace SDDM {
beginResetModel();
populate(Session::WaylandSession, mainConfig.Wayland.SessionDir.get());
populate(Session::X11Session, mainConfig.X11.SessionDir.get());
+ selectDefaultSession();
endResetModel();
// refresh everytime a file is changed, added or removed
@@ -52,6 +53,7 @@ namespace SDDM {
d->sessions.clear();
populate(Session::WaylandSession, mainConfig.Wayland.SessionDir.get());
populate(Session::X11Session, mainConfig.X11.SessionDir.get());
+ selectDefaultSession();
endResetModel();
});
watcher->addPath(mainConfig.Wayland.SessionDir.get());
@@ -149,11 +151,25 @@ namespace SDDM {
else
delete si;
}
+ }
+
+ void SessionModel::selectDefaultSession() {
+ d->lastIndex = 0;
+
// find out index of the last session
for (int i = 0; i < d->sessions.size(); ++i) {
if (d->sessions.at(i)->fileName() == stateConfig.Last.Session.get()) {
d->lastIndex = i;
- break;
+ return;
+ }
+ }
+
+ // Otherwise, fallback to system-wide default session.
+ auto defaultSession = mainConfig.DefaultSession.get();
+ for (int i = 0; i < d->sessions.size(); ++i) {
+ if (QFileInfo(d->sessions.at(i)->fileName()).fileName() == defaultSession) {
+ d->lastIndex = i;
+ return;
}
}
}
diff --git a/src/greeter/SessionModel.h b/src/greeter/SessionModel.h
index 2e2efa9..a93315c 100644
--- a/src/greeter/SessionModel.h
+++ b/src/greeter/SessionModel.h
@@ -58,6 +58,7 @@ namespace SDDM {
SessionModelPrivate *d { nullptr };
void populate(Session::Type type, const QString &path);
+ void selectDefaultSession();
};
}

View file

@ -0,0 +1,45 @@
diff --git a/src/common/ConfigReader.cpp b/src/common/ConfigReader.cpp
index 041e5ed..efb1324 100644
--- a/src/common/ConfigReader.cpp
+++ b/src/common/ConfigReader.cpp
@@ -148,17 +148,14 @@ namespace SDDM {
// * m_path (classic fallback /etc/sddm.conf)
QStringList files;
- QDateTime latestModificationTime = QFileInfo(m_path).lastModified();
if (!m_sysConfigDir.isEmpty()) {
//include the configDir in modification time so we also reload on any files added/removed
QDir dir(m_sysConfigDir);
if (dir.exists()) {
- latestModificationTime = std::max(latestModificationTime, QFileInfo(m_sysConfigDir).lastModified());
const auto dirFiles = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot, QDir::LocaleAware);
for (const QFileInfo &file : dirFiles) {
files << (file.absoluteFilePath());
- latestModificationTime = std::max(latestModificationTime, file.lastModified());
}
}
}
@@ -166,22 +163,15 @@ namespace SDDM {
//include the configDir in modification time so we also reload on any files added/removed
QDir dir(m_configDir);
if (dir.exists()) {
- latestModificationTime = std::max(latestModificationTime, QFileInfo(m_configDir).lastModified());
const auto dirFiles = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot, QDir::LocaleAware);
for (const QFileInfo &file : dirFiles) {
files << (file.absoluteFilePath());
- latestModificationTime = std::max(latestModificationTime, file.lastModified());
}
}
}
files << m_path;
- if (latestModificationTime <= m_fileModificationTime) {
- return;
- }
- m_fileModificationTime = latestModificationTime;
-
for (const QString &filepath : qAsConst(files)) {
loadInternal(filepath);
}