Initial commit

This commit is contained in:
Christian Schendel 2025-09-03 21:30:08 +02:00
commit 9c3746ec9f
Signed by: doppelhelix
GPG key ID: 5874D2437CD5BBB3
9 changed files with 726 additions and 0 deletions

42
.SRCINFO Normal file
View file

@ -0,0 +1,42 @@
pkgbase = sddm-black-screen-fix
pkgdesc = QML based X11 and Wayland display manager
pkgver = 0.21.0
pkgrel = 3
url = https://github.com/sddm/sddm
arch = x86_64
license = GPL-2.0-only
makedepends = extra-cmake-modules
makedepends = git
makedepends = python-docutils
makedepends = qt5-base
makedepends = qt5-declarative
makedepends = qt5-tools
makedepends = qt6-tools
depends = bash
depends = gcc-libs
depends = glibc
depends = libxau
depends = libxcb
depends = pam
depends = qt6-base
depends = qt6-declarative
depends = systemd-libs
depends = ttf-font
depends = xorg-server
depends = xorg-xauth
optdepends = qt5-base: for using Qt5 themes
optdepends = qt5-declarative: for using Qt5 themes
provides = display-manager
provides = sddm
conflicts = sddm
backup = usr/share/sddm/scripts/Xsetup
backup = usr/share/sddm/scripts/Xstop
backup = etc/pam.d/sddm
backup = etc/pam.d/sddm-autologin
backup = etc/pam.d/sddm-greeter
source = git+https://github.com/sddm/sddm#tag=v0.21.0
source = https://github.com/sddm/sddm/pull/2103.patch
b2sums = 956fd205369c022d18e67e8a77ca7d571b145c339be923d73bac95d9ff78f2f3c6648b5f682408fd6750411cf877c38de67cce631d310e129c0013a2cd868844
b2sums = c8a00434660e35cd009edb8b0f0198e8eb5da3bfff7f7b4c421a372a93c8a4f536e5ef0bbd3fa970870e3b5d8d569d70c15737a7875471ac9270535624b22f9d
pkgname = sddm-black-screen-fix

17
.gitignore vendored Normal file
View file

@ -0,0 +1,17 @@
# Ignore everything
*
# But not these files...
!.gitignore
!PKGBUILD
!.SRCINFO
!LICENSE
!chroot-build
!.nvchecker.toml
!/keys
!/keys/pgp
!/keys/pgp/*.asc
!/LICENSES
!/LICENSES/*.txt
!REUSE.toml
!*.patch

5
.nvchecker.toml Normal file
View file

@ -0,0 +1,5 @@
[sddm-black-screen-fix]
source = 'github'
github = 'sddm/sddm'
use_max_tag = true
prefix = 'v'

457
2103.patch Normal file
View file

@ -0,0 +1,457 @@
From 4d06b6f77024d3ecaa458f0474691bf8b5f1306e Mon Sep 17 00:00:00 2001
From: "tsrk." <tsrk@tsrk.me>
Date: Sun, 13 Jul 2025 19:42:40 +0200
Subject: [PATCH 1/9] fix(helper): do not badly exit on SIGHUP
Signed-off-by: tsrk. <tsrk@tsrk.me>
---
src/helper/HelperApp.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/helper/HelperApp.cpp b/src/helper/HelperApp.cpp
index 32da42df3..49b7e1d79 100644
--- a/src/helper/HelperApp.cpp
+++ b/src/helper/HelperApp.cpp
@@ -53,8 +53,13 @@ namespace SDDM {
, m_socket(new QLocalSocket(this)) {
qInstallMessageHandler(HelperMessageHandler);
SignalHandler *s = new SignalHandler(this);
+ s->addCustomSignal(SIGHUP);
QObject::connect(s, &SignalHandler::sigtermReceived, m_session, [] {
- QCoreApplication::instance()->exit(-1);
+ QCoreApplication::instance()->exit(Auth::HELPER_OTHER_ERROR);
+ });
+
+ QObject::connect(s, &SignalHandler::customSignalReceived, m_session, [](int) {
+ QCoreApplication::instance()->exit(Auth::HELPER_OTHER_ERROR);
});
QTimer::singleShot(0, this, SLOT(setUp()));
From 2eba0aa7e32da2becfb2e48327b7f4e94cdd0275 Mon Sep 17 00:00:00 2001
From: "tsrk." <tsrk@tsrk.me>
Date: Sun, 20 Jul 2025 17:15:54 +0200
Subject: [PATCH 2/9] fix(helper): avoid exiting 1 at all costs when session
finishes
Signed-off-by: tsrk. <tsrk@tsrk.me>
---
src/helper/HelperApp.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/helper/HelperApp.cpp b/src/helper/HelperApp.cpp
index 49b7e1d79..7e8cd6d10 100644
--- a/src/helper/HelperApp.cpp
+++ b/src/helper/HelperApp.cpp
@@ -199,7 +199,12 @@ namespace SDDM {
}
void HelperApp::sessionFinished(int status) {
- exit(status);
+ if (status != 0) {
+ qWarning("Session crashed (exit code %d).", status);
+ exit(Auth::HELPER_SESSION_ERROR);
+ }
+ else
+ exit(Auth::HELPER_SUCCESS);
}
void HelperApp::info(const QString& message, Auth::Info type) {
From ff0a330ada7062094fc2360e0432c92063f3ec2d Mon Sep 17 00:00:00 2001
From: "tsrk." <tsrk@tsrk.me>
Date: Tue, 29 Jul 2025 22:18:34 +0200
Subject: [PATCH 3/9] fix(auth): do not cast exit status if `QProcess` is not
exited normally
A QProcess::CrashExit happen in most cases when a signal killed it. And
returning from a signal-killed process on Linux makes QProcess:finished
return the signal, which is a really bad idea to cast into a random
enum.
Qt also mentions that `exitCode` is only valid for QProcess::NormalExit
invocations
Signed-off-by: tsrk. <tsrk@tsrk.me>
---
src/auth/Auth.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/auth/Auth.cpp b/src/auth/Auth.cpp
index 6c9b5c6b4..6ff38ef1f 100644
--- a/src/auth/Auth.cpp
+++ b/src/auth/Auth.cpp
@@ -230,7 +230,10 @@ namespace SDDM {
else
qWarning("Auth: sddm-helper exited with %d", exitCode);
- Q_EMIT qobject_cast<Auth*>(parent())->finished((Auth::HelperExitStatus)exitCode);
+ if (exitStatus == QProcess::NormalExit)
+ Q_EMIT qobject_cast<Auth*>(parent())->finished((Auth::HelperExitStatus)exitCode);
+ else
+ Q_EMIT qobject_cast<Auth*>(parent())->finished(Auth::HELPER_OTHER_ERROR);
}
void Auth::Private::childError(QProcess::ProcessError error) {
From 97e918b17a5ebc6cb8629cde3a6bc8b5bf44cacc Mon Sep 17 00:00:00 2001
From: "tsrk." <tsrk@tsrk.me>
Date: Wed, 30 Jul 2025 12:24:17 +0200
Subject: [PATCH 4/9] fix(helper): remove overload of `QProcess::finished` in
UserSession
This will allow HelperApp to dinstinguish between a crash (most likely
by a signal) from a normal exit.
Signed-off-by: tsrk. <tsrk@tsrk.me>
---
src/helper/HelperApp.cpp | 12 ++++++++----
src/helper/HelperApp.h | 2 +-
src/helper/UserSession.cpp | 3 +--
src/helper/UserSession.h | 4 ----
4 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/helper/HelperApp.cpp b/src/helper/HelperApp.cpp
index 7e8cd6d10..e0141bb7c 100644
--- a/src/helper/HelperApp.cpp
+++ b/src/helper/HelperApp.cpp
@@ -131,7 +131,7 @@ namespace SDDM {
}
connect(m_socket, &QLocalSocket::connected, this, &HelperApp::doAuth);
- connect(m_session, &UserSession::finished, this, &HelperApp::sessionFinished);
+ connect(m_session, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &HelperApp::sessionFinished);
m_socket->connectToServer(server, QIODevice::ReadWrite | QIODevice::Unbuffered);
}
@@ -198,9 +198,13 @@ namespace SDDM {
return;
}
- void HelperApp::sessionFinished(int status) {
- if (status != 0) {
- qWarning("Session crashed (exit code %d).", status);
+ void HelperApp::sessionFinished(int exitCode, QProcess::ExitStatus exitStatus) {
+ if (exitStatus == QProcess::CrashExit) {
+ qWarning("Session crashed (killed by signal %d).", exitCode);
+ exit(Auth::HELPER_SESSION_ERROR);
+ }
+ else if (exitCode != 0) {
+ qWarning("Session crashed (exit code %d).", exitCode);
exit(Auth::HELPER_SESSION_ERROR);
}
else
diff --git a/src/helper/HelperApp.h b/src/helper/HelperApp.h
index 64ea0e1c8..9874ab8eb 100644
--- a/src/helper/HelperApp.h
+++ b/src/helper/HelperApp.h
@@ -54,7 +54,7 @@ namespace SDDM {
void setUp();
void doAuth();
- void sessionFinished(int status);
+ void sessionFinished(int exitCode, QProcess::ExitStatus exitStatus);
private:
qint64 m_id { -1 };
diff --git a/src/helper/UserSession.cpp b/src/helper/UserSession.cpp
index 03fd396ee..5fd378a6e 100644
--- a/src/helper/UserSession.cpp
+++ b/src/helper/UserSession.cpp
@@ -47,7 +47,6 @@ namespace SDDM {
UserSession::UserSession(HelperApp *parent)
: QProcess(parent)
{
- connect(this, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &UserSession::finished);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
setChildProcessModifier(std::bind(&UserSession::childModifier, this));
#endif
@@ -157,7 +156,7 @@ namespace SDDM {
}
}
} else {
- Q_EMIT finished(Auth::HELPER_OTHER_ERROR);
+ Q_EMIT finished(Auth::HELPER_OTHER_ERROR, QProcess::NormalExit);
}
}
diff --git a/src/helper/UserSession.h b/src/helper/UserSession.h
index ecaef8679..78cd994a7 100644
--- a/src/helper/UserSession.h
+++ b/src/helper/UserSession.h
@@ -51,10 +51,6 @@ namespace SDDM {
*/
qint64 cachedProcessId();
-
- Q_SIGNALS:
- void finished(int exitCode);
-
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
protected:
void setupChildProcess() override;
From 7052ba863174faa05fed8cbbdc7c71cf202e6cfd Mon Sep 17 00:00:00 2001
From: "tsrk." <tsrk@tsrk.me>
Date: Wed, 30 Jul 2025 13:37:14 +0200
Subject: [PATCH 5/9] style(helper): rearrange if conditions to explicitly
check for normal exit
Signed-off-by: tsrk. <tsrk@tsrk.me>
---
src/helper/HelperApp.cpp | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/helper/HelperApp.cpp b/src/helper/HelperApp.cpp
index e0141bb7c..fa1167c9f 100644
--- a/src/helper/HelperApp.cpp
+++ b/src/helper/HelperApp.cpp
@@ -199,16 +199,16 @@ namespace SDDM {
}
void HelperApp::sessionFinished(int exitCode, QProcess::ExitStatus exitStatus) {
- if (exitStatus == QProcess::CrashExit) {
- qWarning("Session crashed (killed by signal %d).", exitCode);
- exit(Auth::HELPER_SESSION_ERROR);
- }
- else if (exitCode != 0) {
- qWarning("Session crashed (exit code %d).", exitCode);
- exit(Auth::HELPER_SESSION_ERROR);
+ if (exitStatus == QProcess::NormalExit) {
+ if (exitCode != 0) {
+ qWarning("Session crashed (exit code %d).", exitCode);
+ exit(Auth::HELPER_SESSION_ERROR);
+ }
+ else
+ exit(Auth::HELPER_SUCCESS);
}
- else
- exit(Auth::HELPER_SUCCESS);
+ qWarning("Session crashed (killed by signal %d).", exitCode);
+ exit(Auth::HELPER_SESSION_ERROR);
}
void HelperApp::info(const QString& message, Auth::Info type) {
From f886081f98f02ed42e517be6949e1a22971b3e1e Mon Sep 17 00:00:00 2001
From: "tsrk." <tsrk@tsrk.me>
Date: Fri, 1 Aug 2025 01:26:48 +0200
Subject: [PATCH 6/9] fix(helper): return after exits and check for session
state in destructor
This avoids calling exit an unnecessary number of times, which can
potentially falsify the real return code, and cause restrat loops
Signed-off-by: tsrk. <tsrk@tsrk.me>
---
src/helper/HelperApp.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/helper/HelperApp.cpp b/src/helper/HelperApp.cpp
index fa1167c9f..6a39ac00b 100644
--- a/src/helper/HelperApp.cpp
+++ b/src/helper/HelperApp.cpp
@@ -206,7 +206,11 @@ namespace SDDM {
}
else
exit(Auth::HELPER_SUCCESS);
+ return;
}
+
+ Q_ASSERT_X(exitCode != 0, "HelperApp::sessionFinished", "Crashing with 0 is impossible");
+
qWarning("Session crashed (killed by signal %d).", exitCode);
exit(Auth::HELPER_SESSION_ERROR);
}
@@ -298,7 +302,9 @@ namespace SDDM {
HelperApp::~HelperApp() {
Q_ASSERT(getuid() == 0);
- m_session->stop();
+ // Avoid re-emitting QProcess::finished if session is not running
+ if (m_session->state() != QProcess::NotRunning)
+ m_session->stop();
m_backend->closeSession();
// write logout to utmp/wtmp
From 72db1388b931858af3d0f066ed5c3a1948979422 Mon Sep 17 00:00:00 2001
From: "tsrk." <tsrk@tsrk.me>
Date: Fri, 1 Aug 2025 11:42:46 +0200
Subject: [PATCH 7/9] fix(helper): do not emit finish when stopping already
stopped session
Signed-off-by: tsrk. <tsrk@tsrk.me>
---
src/helper/UserSession.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/helper/UserSession.cpp b/src/helper/UserSession.cpp
index 5fd378a6e..3e0a5afb4 100644
--- a/src/helper/UserSession.cpp
+++ b/src/helper/UserSession.cpp
@@ -156,7 +156,7 @@ namespace SDDM {
}
}
} else {
- Q_EMIT finished(Auth::HELPER_OTHER_ERROR, QProcess::NormalExit);
+ qInfo() << "Attempted to stop session, but was already not running";
}
}
From 7aa2576b1a916796b1700a426bd9df1b368007b7 Mon Sep 17 00:00:00 2001
From: "tsrk." <tsrk@tsrk.me>
Date: Fri, 1 Aug 2025 11:43:58 +0200
Subject: [PATCH 8/9] style(helper): explicit usage of `QCoreApplication::exit`
Signed-off-by: tsrk. <tsrk@tsrk.me>
---
src/helper/HelperApp.cpp | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/helper/HelperApp.cpp b/src/helper/HelperApp.cpp
index 6a39ac00b..f7958e9be 100644
--- a/src/helper/HelperApp.cpp
+++ b/src/helper/HelperApp.cpp
@@ -73,7 +73,7 @@ namespace SDDM {
if ((pos = args.indexOf(QStringLiteral("--socket"))) >= 0) {
if (pos >= args.length() - 1) {
qCritical() << "This application is not supposed to be executed manually";
- exit(Auth::HELPER_OTHER_ERROR);
+ QCoreApplication::exit(Auth::HELPER_OTHER_ERROR);
return;
}
server = args[pos + 1];
@@ -82,7 +82,7 @@ namespace SDDM {
if ((pos = args.indexOf(QStringLiteral("--id"))) >= 0) {
if (pos >= args.length() - 1) {
qCritical() << "This application is not supposed to be executed manually";
- exit(Auth::HELPER_OTHER_ERROR);
+ QCoreApplication::exit(Auth::HELPER_OTHER_ERROR);
return;
}
m_id = QString(args[pos + 1]).toLongLong();
@@ -91,7 +91,7 @@ namespace SDDM {
if ((pos = args.indexOf(QStringLiteral("--start"))) >= 0) {
if (pos >= args.length() - 1) {
qCritical() << "This application is not supposed to be executed manually";
- exit(Auth::HELPER_OTHER_ERROR);
+ QCoreApplication::exit(Auth::HELPER_OTHER_ERROR);
return;
}
m_session->setPath(args[pos + 1]);
@@ -100,7 +100,7 @@ namespace SDDM {
if ((pos = args.indexOf(QStringLiteral("--user"))) >= 0) {
if (pos >= args.length() - 1) {
qCritical() << "This application is not supposed to be executed manually";
- exit(Auth::HELPER_OTHER_ERROR);
+ QCoreApplication::exit(Auth::HELPER_OTHER_ERROR);
return;
}
m_user = args[pos + 1];
@@ -109,7 +109,7 @@ namespace SDDM {
if ((pos = args.indexOf(QStringLiteral("--display-server"))) >= 0) {
if (pos >= args.length() - 1) {
qCritical() << "This application is not supposed to be executed manually";
- exit(Auth::HELPER_OTHER_ERROR);
+ QCoreApplication::exit(Auth::HELPER_OTHER_ERROR);
return;
}
m_session->setDisplayServerCommand(args[pos + 1]);
@@ -126,7 +126,7 @@ namespace SDDM {
if (server.isEmpty() || m_id <= 0) {
qCritical() << "This application is not supposed to be executed manually";
- exit(Auth::HELPER_OTHER_ERROR);
+ QCoreApplication::exit(Auth::HELPER_OTHER_ERROR);
return;
}
@@ -151,7 +151,7 @@ namespace SDDM {
const QString vt = env.value(QStringLiteral("XDG_VTNR"));
utmpLogin(vt, displayId, m_user, 0, false);
- exit(Auth::HELPER_AUTH_ERROR);
+ QCoreApplication::exit(Auth::HELPER_AUTH_ERROR);
return;
}
@@ -165,7 +165,7 @@ namespace SDDM {
const QString vt = env.value(QStringLiteral("XDG_VTNR"));
utmpLogin(vt, displayId, m_user, 0, false);
- exit(Auth::HELPER_AUTH_ERROR);
+ QCoreApplication::exit(Auth::HELPER_AUTH_ERROR);
return;
}
@@ -178,7 +178,7 @@ namespace SDDM {
if (!m_backend->openSession()) {
sessionOpened(false);
- exit(Auth::HELPER_SESSION_ERROR);
+ QCoreApplication::exit(Auth::HELPER_SESSION_ERROR);
return;
}
@@ -194,7 +194,7 @@ namespace SDDM {
}
}
else
- exit(Auth::HELPER_SUCCESS);
+ QCoreApplication::exit(Auth::HELPER_SUCCESS);
return;
}
@@ -202,17 +202,17 @@ namespace SDDM {
if (exitStatus == QProcess::NormalExit) {
if (exitCode != 0) {
qWarning("Session crashed (exit code %d).", exitCode);
- exit(Auth::HELPER_SESSION_ERROR);
+ QCoreApplication::exit(Auth::HELPER_SESSION_ERROR);
}
else
- exit(Auth::HELPER_SUCCESS);
+ QCoreApplication::exit(Auth::HELPER_SUCCESS);
return;
}
Q_ASSERT_X(exitCode != 0, "HelperApp::sessionFinished", "Crashing with 0 is impossible");
qWarning("Session crashed (killed by signal %d).", exitCode);
- exit(Auth::HELPER_SESSION_ERROR);
+ QCoreApplication::exit(Auth::HELPER_SESSION_ERROR);
}
void HelperApp::info(const QString& message, Auth::Info type) {
From 4978251750021d5686f5837dffd12a5e99b7ada6 Mon Sep 17 00:00:00 2001
From: "tsrk." <tsrk@tsrk.me>
Date: Fri, 1 Aug 2025 12:13:12 +0200
Subject: [PATCH 9/9] fix(helper): disconnect `sessionFinished` when exiting
Calling `UserSession::stop` results in a call to `QProcess::terminate`,
which sends a SIGTERM to the session. `QProcess` will catch that and
emit an excess `QProcess::finished(15, 1)` which we don't want to handle
since we are in the process of exiting.
Signed-off-by: tsrk. <tsrk@tsrk.me>
---
src/helper/HelperApp.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/helper/HelperApp.cpp b/src/helper/HelperApp.cpp
index f7958e9be..744a4ef01 100644
--- a/src/helper/HelperApp.cpp
+++ b/src/helper/HelperApp.cpp
@@ -302,7 +302,8 @@ namespace SDDM {
HelperApp::~HelperApp() {
Q_ASSERT(getuid() == 0);
- // Avoid re-emitting QProcess::finished if session is not running
+ // Avoid calls to sessionFinished when exiting
+ disconnect(m_session, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &HelperApp::sessionFinished);
if (m_session->state() != QProcess::NotRunning)
m_session->stop();
m_backend->closeSession();

12
LICENSE Normal file
View file

@ -0,0 +1,12 @@
Copyright Arch Linux Contributors
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

1
LICENSES/0BSD.txt Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

105
PKGBUILD Normal file
View file

@ -0,0 +1,105 @@
# Maintainer: Christian Schendel <doppelhelix@gmail.com>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Antonio Rojas <arojas@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
pkgname=sddm-black-screen-fix
_pkgname=sddm
pkgver=0.21.0
pkgrel=3
pkgdesc='QML based X11 and Wayland display manager'
arch=(
x86_64
)
url='https://github.com/sddm/sddm'
license=(
GPL-2.0-only
)
depends=(
bash
gcc-libs
glibc
libxau
libxcb
pam
qt6-base
qt6-declarative
systemd-libs
ttf-font
xorg-server
xorg-xauth
)
makedepends=(
extra-cmake-modules
git
python-docutils
qt5-base
qt5-declarative
qt5-tools
qt6-tools)
optdepends=(
'qt5-base: for using Qt5 themes'
'qt5-declarative: for using Qt5 themes'
)
backup=(
'usr/share/sddm/scripts/Xsetup'
'usr/share/sddm/scripts/Xstop'
'etc/pam.d/sddm'
'etc/pam.d/sddm-autologin'
'etc/pam.d/sddm-greeter'
)
provides=(
"display-manager"
"sddm"
)
conflicts=(
"sddm"
)
source=(
"git+https://github.com/$_pkgname/$_pkgname#tag=v$pkgver"
"2103.patch"
)
b2sums=('956fd205369c022d18e67e8a77ca7d571b145c339be923d73bac95d9ff78f2f3c6648b5f682408fd6750411cf877c38de67cce631d310e129c0013a2cd868844'
'c8a00434660e35cd009edb8b0f0198e8eb5da3bfff7f7b4c421a372a93c8a4f536e5ef0bbd3fa970870e3b5d8d569d70c15737a7875471ac9270535624b22f9d')
prepare() {
git -C $_pkgname cherry-pick -n 228778c2b4b7e26db1e1d69fe484ed75c5791c3a # Fix build with cmake 4
patch -d $_pkgname -Np1 -i ../2103.patch #https://github.com/sddm/sddm/pull/2103
}
build() {
local cmake_options=(
-S "$_pkgname"
-B build
-D CMAKE_INSTALL_PREFIX=/usr
-D CMAKE_INSTALL_LIBEXECDIR=/usr/lib/sddm
-D BUILD_WITH_QT6=ON
-D DBUS_CONFIG_DIR=/usr/share/dbus-1/system.d
-D DBUS_CONFIG_FILENAME=sddm_org.freedesktop.DisplayManager.conf
-D BUILD_MAN_PAGES=ON
-D UID_MAX=60513
)
cmake "${cmake_options[@]}"
cmake --build build
cmake -B build5 -S $_pkgname \
-DCMAKE_INSTALL_PREFIX=/usr
cmake --build build5/src/greeter
cmake --build build5/components
}
package() {
DESTDIR="$pkgdir" cmake --install build
DESTDIR="$pkgdir" cmake --install build5/src/greeter
DESTDIR="$pkgdir" cmake --install build5/components
install -d "$pkgdir"/usr/lib/sddm/sddm.conf.d
"$pkgdir"/usr/bin/sddm --example-config > "$pkgdir"/usr/lib/sddm/sddm.conf.d/default.conf
# Don't set PATH in sddm.conf
sed -r 's|DefaultPath=.*|DefaultPath=/usr/local/sbin:/usr/local/bin:/usr/bin|g' -i "$pkgdir"/usr/lib/sddm/sddm.conf.d/default.conf
# Unset InputMethod https://github.com/sddm/sddm/issues/952
sed -e "/^InputMethod/s/qtvirtualkeyboard//" -i "$pkgdir"/usr/lib/sddm/sddm.conf.d/default.conf
}
# vim: set ft=sh ts=4 sw=4 et:

22
REUSE.toml Normal file
View file

@ -0,0 +1,22 @@
version = 1
[[annotations]]
path = [
"PKGBUILD",
"README.md",
"keys/**",
".SRCINFO",
".nvchecker.toml",
"*.install",
"*.sysusers",
"*.tmpfiles",
"*.logrotate",
"*.pam",
"*.service",
"*.socket",
"*.timer",
"*.desktop",
"*.hook",
]
SPDX-FileCopyrightText = "Arch Linux contributors"
SPDX-License-Identifier = "0BSD"

65
chroot-build Executable file
View file

@ -0,0 +1,65 @@
#!/bin/bash
# SPDX-FileCopyrightText: Christian Schendel
# SPDX-License-Identifier: 0BSD
set -euo pipefail
use_tmpfs=true
CHROOT="/tmp/mkarchroot"
check_available_ram() {
if [ "$(awk '/^MemAvailable:/ { print $2; }' /proc/meminfo)" -lt 50000 ]; then
use_tmpfs=false
fi
}
create_chroot_directory() {
if [ $use_tmpfs ]; then
sudo mount --mkdir -t tmpfs -o defaults,size=20G tmpfs $CHROOT
else
sudo mkdir -p "$CHROOT"
fi
}
create_chroot_environment() {
if [[ ! -d "$CHROOT/root" ]]; then
mkarchroot -M ~/.config/pacman/makepkg.conf "$CHROOT/root" base-devel
fi
}
build_package(){
arch-nspawn "$CHROOT/root" pacman -Syu
if makechrootpkg -c -r "$CHROOT" -- -Asf . ; then
makepkg --printsrcinfo >.SRCINFO
else
delete_chroot_environment && echo -e "\n\e[1;31m==> BUILD FAILED: \e[1;37m$CHROOT removed\e[0m " && exit 1
fi
}
sign_package(){
PACKAGE="$(makepkg --packagelist)"
gpg --use-agent --output "$PACKAGE.sig" --detach-sign "$PACKAGE"
}
delete_chroot_environment() {
if [ "$(stat -f --format=%T "$CHROOT")" == "btrfs" ]; then
{
sudo btrfs subvolume delete "$CHROOT/root/var/lib/portables"
sudo btrfs subvolume delete "$CHROOT/root/var/lib/machines"
sudo btrfs subvolume delete "$CHROOT/root"
sudo rm -Rf $CHROOT
} >>/dev/null 2>&1
elif [ "$(stat -f --format=%T "$CHROOT")" == "tmpfs" ]; then
sudo umount -f $CHROOT
fi
sudo rm -Rf $CHROOT
}
check_available_ram
create_chroot_directory
create_chroot_environment
build_package
sign_package
delete_chroot_environment
# vim: set ts=4 sw=4 et: