x11/sddm: Update to 0.19.0

This commit is contained in:
Gleb Popov 2020-11-30 06:18:17 +00:00
parent cb6fe3f201
commit c067868add
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=556622
14 changed files with 20 additions and 212 deletions

View File

@ -1,9 +1,8 @@
# $FreeBSD$
PORTNAME= sddm
PORTVERSION= 0.18.1
PORTVERSION= 0.19.0
DISTVERSIONPREFIX= v
PORTREVISION= 4
CATEGORIES= x11
MAINTAINER= kde@FreeBSD.org
@ -46,7 +45,6 @@ post-patch:
-e 's#/usr/share/#${LOCALBASE}/share/#' \
${WRKSRC}/data/scripts/Xsession \
${WRKSRC}/src/common/Configuration.h
@${CP} ${PATCHDIR}/VirtualTerminal_FreeBSD.cpp ${WRKSRC}/src/daemon
post-install:
# Install xsession.desktop to launch .xinitrc via sddm.

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1581010748
SHA256 (sddm-sddm-v0.18.1_GH0.tar.gz) = 07296fc747010a5dd58a45f16c3224b439997afad42566e4b043c841b1b71700
SIZE (sddm-sddm-v0.18.1_GH0.tar.gz) = 3526726
TIMESTAMP = 1606404273
SHA256 (sddm-sddm-v0.19.0_GH0.tar.gz) = e76da1f13d5ad5e0179e3fec57543126044339405ef19c397e105e0807bd4e41
SIZE (sddm-sddm-v0.19.0_GH0.tar.gz) = 3532945

View File

@ -1,37 +0,0 @@
/***************************************************************************
* Copyright (c) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
***************************************************************************/
#include <QDebug>
#include <QString>
#include "VirtualTerminal.h"
namespace SDDM {
namespace VirtualTerminal {
int setUpNewVt() {
qDebug() << "New VT is unsupported on FreeBSD";
return -1;
}
void jumpToVt(int vt, bool vt_auto) {
qDebug() << "Jumping to VT" << vt << "is unsupported on FreeBSD";
}
}
}

View File

@ -1,16 +0,0 @@
1) On FreeBSD X is normally started on VT9.
2) The shutdown command uses '-p' and not '-P' on FreeBSD.
--- CMakeLists.txt.orig 2017-12-05 16:00:16 UTC
+++ CMakeLists.txt
@@ -168,8 +168,8 @@ add_feature_info("elogind" ELOGIND_FOUND "elogind supp
# Default behaviour if neither systemd nor elogind is used
if (NOT ELOGIND_FOUND AND NOT SYSTEMD_FOUND)
- set(MINIMUM_VT 7)
- set(HALT_COMMAND "/sbin/shutdown -h -P now")
+ set(MINIMUM_VT 9)
+ set(HALT_COMMAND "/sbin/shutdown -p now")
set(REBOOT_COMMAND "/sbin/shutdown -r now")
endif()

View File

@ -1,11 +0,0 @@
--- data/themes/maya/metadata.desktop.orig 2019-03-13 09:22:35 UTC
+++ data/themes/maya/metadata.desktop
@@ -7,7 +7,7 @@ License=CC-BY-SA
Type=sddm-theme
Version=0.1
Website=https://github.com/spremi
-Screenshot=preview.png
+Screenshot=screenshots/hi_IN.png
MainScript=Main.qml
ConfigFile=theme.conf
TranslationsDirectory=translations

View File

@ -1,9 +1,9 @@
--- services/sddm-autologin.pam.orig 2017-12-05 16:00:16 UTC
--- services/sddm-autologin.pam.orig 2020-11-03 09:55:31 UTC
+++ services/sddm-autologin.pam
@@ -1,13 +1,9 @@
#%PAM-1.0
-auth required pam_env.so
-auth required pam_tally.so file=/var/log/faillog onerr=succeed
-auth required pam_tally2.so file=/var/log/tallylog onerr=succeed
-auth required pam_shells.so
-auth required pam_nologin.so
auth required pam_permit.so

View File

@ -6,7 +6,7 @@ Set the default theme and cursor theme to breeze, because sddm is most likely
used together with Plasma. If they aren't available sddm falls back to a
compiled-in theme.
--- src/common/Configuration.h.orig 2019-03-13 09:22:35 UTC
--- src/common/Configuration.h.orig 2020-11-03 09:55:31 UTC
+++ src/common/Configuration.h
@@ -47,10 +47,10 @@ namespace SDDM {
// Name Entries (but it's a regular class again)
@ -18,6 +18,6 @@ compiled-in theme.
"The files should be named <username>.face.icon"));
- Entry(CursorTheme, QString, QString(), _S("Cursor theme used in the greeter"));
+ Entry(CursorTheme, QString, _S("breeze_cursors"), _S("Cursor theme used in the greeter"));
Entry(Font, QString, QString(), _S("Font used in the greeter"));
Entry(EnableAvatars, bool, true, _S("Enable display of custom user avatars"));
Entry(DisableAvatarsThreshold,int, 7, _S("Number of users to use as threshold\n"
"above which avatars are disabled\n"

View File

@ -1,11 +0,0 @@
--- src/daemon/CMakeLists.txt.orig 2019-03-13 09:22:35 UTC
+++ src/daemon/CMakeLists.txt
@@ -29,7 +29,7 @@ set(DAEMON_SOURCES
SeatManager.cpp
SignalHandler.cpp
SocketServer.cpp
- VirtualTerminal.cpp
+ VirtualTerminal_FreeBSD.cpp
)
qt5_add_dbus_adaptor(DAEMON_SOURCES "${CMAKE_SOURCE_DIR}/data/interfaces/org.freedesktop.DisplayManager.xml" "DisplayManager.h" SDDM::DisplayManager)

View File

@ -7,9 +7,9 @@ file defines DesktopNames. Our xinitrc.desktop does not set it because that
may confuse the desktop session started from ~/.xinitrc. These environment
variables are used for OnlyShowIn and NotShowIn in .desktop files.
--- src/daemon/Display.cpp.orig 2019-03-13 09:22:35 UTC
--- src/daemon/Display.cpp.orig 2020-11-03 09:55:31 UTC
+++ src/daemon/Display.cpp
@@ -321,11 +321,13 @@ namespace SDDM {
@@ -320,10 +320,12 @@ namespace SDDM {
env.insert(QStringLiteral("XDG_SEAT_PATH"), daemonApp->displayManager()->seatPath(seat()->name()));
env.insert(QStringLiteral("XDG_SESSION_PATH"), daemonApp->displayManager()->sessionPath(QStringLiteral("Session%1").arg(daemonApp->newSessionId())));
env.insert(QStringLiteral("DESKTOP_SESSION"), session.desktopSession());
@ -18,8 +18,7 @@ variables are used for OnlyShowIn and NotShowIn in .desktop files.
env.insert(QStringLiteral("XDG_SESSION_CLASS"), QStringLiteral("user"));
env.insert(QStringLiteral("XDG_SESSION_TYPE"), session.xdgSessionType());
env.insert(QStringLiteral("XDG_SEAT"), seat()->name());
+ if (!session.desktopNames().isEmpty())
env.insert(QStringLiteral("XDG_SESSION_DESKTOP"), session.desktopNames());
if (seat()->name() == QLatin1String("seat0")) {
env.insert(QStringLiteral("XDG_VTNR"), QString::number(vt));
m_auth->insertEnvironment(env);

View File

@ -1,12 +0,0 @@
Call 'setpwent' to rewind to the beginning of the passwd database.
--- src/greeter/UserModel.cpp.orig 2017-12-05 16:00:16 UTC
+++ src/greeter/UserModel.cpp
@@ -55,6 +55,7 @@ namespace SDDM {
const QString defaultFace = QStringLiteral("file://%1/.face.icon").arg(facesDir);
struct passwd *current_pw;
+ setpwent();
while ((current_pw = getpwent()) != nullptr) {
// skip entries with uids smaller than minimum uid

View File

@ -1,48 +0,0 @@
--- src/helper/Backend.cpp.orig 2019-03-13 09:22:35 UTC
+++ src/helper/Backend.cpp
@@ -29,6 +29,10 @@
#include <QtCore/QProcessEnvironment>
#include <pwd.h>
+#if defined(Q_OS_FREEBSD)
+#include <sys/types.h>
+#include <login_cap.h>
+#endif /* defined(Q_OS_FREEBSD) */
namespace SDDM {
Backend::Backend(HelperApp* parent)
@@ -70,6 +74,34 @@ namespace SDDM {
.arg(mainConfig.X11.UserAuthFile.get());
env.insert(QStringLiteral("XAUTHORITY"), value);
}
+#if defined(Q_OS_FREEBSD)
+ /* get additional environment variables via setclassenvironment();
+ this needs to be done here instead of in UserSession::setupChildProcess
+ as the environment for execve() is prepared here;
+ save and restore SDDM's environment because setclassenvironment() mangles it */
+ login_cap_t *lc;
+
+ auto savedEnv = QProcessEnvironment::systemEnvironment();
+
+ if ((lc = login_getpwclass(pw)) != NULL) {
+ setclassenvironment(lc, pw, 1); /* path variables */
+ setclassenvironment(lc, pw, 0); /* non-path variables */
+ login_close(lc);
+ }
+ if ((lc = login_getuserclass(pw)) != NULL) {
+ setclassenvironment(lc, pw, 1); /* path variables */
+ setclassenvironment(lc, pw, 0); /* non-path variables */
+ login_close(lc);
+ }
+ /* copy all environment variables that are now set */
+ QString savedLang = env.value(QStringLiteral("LANG"));
+ env.insert(QProcessEnvironment::systemEnvironment());
+ if (qobject_cast<HelperApp*>(parent())->user() == QStringLiteral("sddm"))
+ env.insert(QStringLiteral("LANG"), savedLang);
+ /* restore original environment */
+ QProcessEnvironment::systemEnvironment().clear();
+ QProcessEnvironment::systemEnvironment().insert(savedEnv);
+#endif /* defined(Q_OS_FREEBSD) */
// TODO: I'm fairly sure this shouldn't be done for PAM sessions, investigate!
m_app->session()->setProcessEnvironment(env);
}

View File

@ -1,12 +0,0 @@
--- src/helper/CMakeLists.txt.orig 2019-03-13 09:22:35 UTC
+++ src/helper/CMakeLists.txt
@@ -37,6 +37,9 @@ if(PAM_FOUND)
else()
target_link_libraries(sddm-helper crypt)
endif()
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
+ target_link_libraries(sddm-helper util)
+endif()
if(JOURNALD_FOUND)
target_link_libraries(sddm-helper ${JOURNALD_LIBRARIES})

View File

@ -1,46 +0,0 @@
--- src/helper/HelperApp.cpp.orig 2019-03-13 09:22:35 UTC
+++ src/helper/HelperApp.cpp
@@ -35,7 +35,9 @@
#include <sys/socket.h>
#include <sys/time.h>
+#if defined(Q_OS_LINUX)
#include <utmp.h>
+#endif
#include <utmpx.h>
#include <QByteArray>
@@ -302,12 +304,20 @@ namespace SDDM {
// append to failed login database btmp
if (!authSuccessful) {
+#if defined(Q_OS_FREEBSD)
+ pututxline(&entry);
+#else
updwtmpx("/var/log/btmp", &entry);
+#endif
}
// append to wtmp
else {
+#if defined(Q_OS_FREEBSD)
+ pututxline(&entry);
+#else
updwtmpx("/var/log/wtmp", &entry);
+#endif
}
}
@@ -343,8 +353,12 @@ namespace SDDM {
qWarning() << "Failed to write utmpx: " << strerror(errno);
endutxent();
+#if defined(Q_OS_FREEBSD)
+ pututxline(&entry);
+#else
// append to wtmp
updwtmpx("/var/log/wtmp", &entry);
+#endif
}
}

View File

@ -4,10 +4,6 @@ etc/dbus-1/system.d/org.freedesktop.DisplayManager.conf
etc/pam.d/sddm
etc/pam.d/sddm-autologin
etc/pam.d/sddm-greeter
man/man1/sddm.1.gz
man/man1/sddm-greeter.1.gz
man/man5/sddm.conf.5.gz
man/man5/sddm-state.conf.5.gz
%%QT_QMLDIR%%/SddmComponents/Background.qml
%%QT_QMLDIR%%/SddmComponents/Button.qml
%%QT_QMLDIR%%/SddmComponents/Clock.qml
@ -22,6 +18,10 @@ man/man5/sddm-state.conf.5.gz
%%QT_QMLDIR%%/SddmComponents/qmldir
%%QT_QMLDIR%%/SddmComponents/warning.png
libexec/sddm-helper
man/man1/sddm-greeter.1.gz
man/man1/sddm.1.gz
man/man5/sddm-state.conf.5.gz
man/man5/sddm.conf.5.gz
%%DATADIR%%/faces/.face.icon
%%DATADIR%%/faces/root.face.icon
%%DATADIR%%/flags/ae.png
@ -156,10 +156,13 @@ libexec/sddm-helper
%%DATADIR%%/translations/de.qm
%%DATADIR%%/translations/es.qm
%%DATADIR%%/translations/et.qm
%%DATADIR%%/translations/eu.qm
%%DATADIR%%/translations/fi.qm
%%DATADIR%%/translations/fr.qm
%%DATADIR%%/translations/he.qm
%%DATADIR%%/translations/hi_IN.qm
%%DATADIR%%/translations/hu.qm
%%DATADIR%%/translations/ie.qm
%%DATADIR%%/translations/is.qm
%%DATADIR%%/translations/it.qm
%%DATADIR%%/translations/ja.qm
@ -170,6 +173,7 @@ libexec/sddm-helper
%%DATADIR%%/translations/nb.qm
%%DATADIR%%/translations/nl.qm
%%DATADIR%%/translations/nn.qm
%%DATADIR%%/translations/oc.qm
%%DATADIR%%/translations/pl.qm
%%DATADIR%%/translations/pt_BR.qm
%%DATADIR%%/translations/pt_PT.qm