summaryrefslogtreecommitdiffstats
path: root/desktop/gdm
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/gdm')
-rw-r--r--desktop/gdm/0001-Xsession-Don-t-start-ssh-agent-by-default.patch28
-rw-r--r--desktop/gdm/0002-meson-allow-building-with-elogind.patch219
-rw-r--r--desktop/gdm/0003-add-wayland-session-script.patch18
-rw-r--r--desktop/gdm/0004-fix-Xsession-language-in-gnome.patch14
-rw-r--r--desktop/gdm/README18
-rw-r--r--desktop/gdm/doinst.sh21
-rw-r--r--desktop/gdm/gdm-autologin.pam25
-rw-r--r--desktop/gdm/gdm-launch-environment.pam18
-rw-r--r--desktop/gdm/gdm-password.pam22
-rw-r--r--desktop/gdm/gdm.SlackBuild141
-rw-r--r--desktop/gdm/gdm.info10
-rw-r--r--desktop/gdm/gdm.wrap11
-rw-r--r--desktop/gdm/slack-desc19
-rw-r--r--desktop/gdm/wayland-session62
14 files changed, 626 insertions, 0 deletions
diff --git a/desktop/gdm/0001-Xsession-Don-t-start-ssh-agent-by-default.patch b/desktop/gdm/0001-Xsession-Don-t-start-ssh-agent-by-default.patch
new file mode 100644
index 0000000000..56699008c6
--- /dev/null
+++ b/desktop/gdm/0001-Xsession-Don-t-start-ssh-agent-by-default.patch
@@ -0,0 +1,28 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Sat, 20 Jun 2015 17:22:38 +0200
+Subject: [PATCH] Xsession: Don't start ssh-agent by default
+
+---
+ data/Xsession.in | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/data/Xsession.in b/data/Xsession.in
+index 2e4de4fe384f..29ebc30ea0c5 100755
+--- a/data/Xsession.in
++++ b/data/Xsession.in
+@@ -207,14 +207,6 @@ if [ "x$command" = "xdefault" ] ; then
+ fi
+ fi
+
+-# add ssh-agent if found
+-sshagent="`gdmwhich ssh-agent`"
+-if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then
+- command="$sshagent -- $command"
+-elif [ -z "$sshagent" ] ; then
+- echo "$0: ssh-agent not found!"
+-fi
+-
+ echo "$0: Setup done, will execute: $command"
+
+ eval exec $command
diff --git a/desktop/gdm/0002-meson-allow-building-with-elogind.patch b/desktop/gdm/0002-meson-allow-building-with-elogind.patch
new file mode 100644
index 0000000000..ea63f37eb9
--- /dev/null
+++ b/desktop/gdm/0002-meson-allow-building-with-elogind.patch
@@ -0,0 +1,219 @@
+From 462cc0f5346f5913cf7151044f1c232c5d21c1c3 Mon Sep 17 00:00:00 2001
+From: Dudemanguy <random342@airmail.cc>
+Date: Mon, 5 Oct 2020 18:41:55 -0500
+Subject: [PATCH] meson: allow building with elogind
+
+Currently, the GDM meson build has a hard dependency on systemd.
+However, GDM can function just fine if one is using elogind. This allows
+a user to build GDM against libelogind and also disable the systemd
+system and user units.
+---
+ common/meson.build | 2 +-
+ data/meson.build | 62 ++++++++++++++----------
+ data/pam-arch/gdm-launch-environment.pam | 1 +
+ libgdm/meson.build | 2 +-
+ meson.build | 36 +++++++++-----
+ meson_options.txt | 5 +-
+ 6 files changed, 66 insertions(+), 42 deletions(-)
+
+diff --git a/common/meson.build b/common/meson.build
+index 074dd92e..bca58f7c 100644
+--- a/common/meson.build
++++ b/common/meson.build
+@@ -11,7 +11,7 @@ libgdmcommon_src = files(
+ )
+
+ libgdmcommon_deps = [
+- libsystemd_dep,
++ logind_dep,
+ gobject_dep,
+ gio_dep,
+ gio_unix_dep,
+diff --git a/data/meson.build b/data/meson.build
+index 7c5222ea..403336c3 100644
+--- a/data/meson.build
++++ b/data/meson.build
+@@ -168,41 +168,53 @@ else
+ service_config.set('PLYMOUTH_QUIT_SERVICE', '')
+ endif
+
+-if get_option('systemdsystemunitdir') != ''
+- systemd_systemunitdir = get_option('systemdsystemunitdir')
+-else
+- systemd_systemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
++systemdsystemunitdir = get_option('systemdsystemunitdir')
++if systemdsystemunitdir != 'no'
++ assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd system unit dir or disable it')
++ if get_option('systemdsystemunitdir') != ''
++ systemd_systemunitdir = get_option('systemdsystemunitdir')
++ else
++ systemd_systemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
++ endif
+ endif
+
+-if get_option('systemduserunitdir') != ''
+- systemd_userunitdir = get_option('systemduserunitdir')
+-else
+- systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
+- define_variable: ['prefix', get_option('prefix')])
++systemduserunitdir = get_option('systemduserunitdir')
++if systemduserunitdir != 'no'
++ assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
++ if get_option('systemduserunitdir') != ''
++ systemd_userunitdir = get_option('systemduserunitdir')
++ else
++ systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
++ define_variable: ['prefix', get_option('prefix')])
++ endif
+ endif
+
+-configure_file(
+- input: 'gdm.service.in',
+- output: '@BASENAME@',
+- configuration: service_config,
+- install_dir: systemd_systemunitdir,
+- format: 'cmake'
+-)
++if systemdsystemunitdir != 'no'
++ configure_file(
++ input: 'gdm.service.in',
++ output: '@BASENAME@',
++ configuration: service_config,
++ install_dir: systemd_systemunitdir,
++ format: 'cmake'
++ )
++endif
+
+ gdm_gnome_session_wanted_targets = []
+ foreach component: gdm_gnome_user_session_wanted_components
+ gdm_gnome_session_wanted_targets += 'Wants=@0@.target'.format(component)
+ endforeach
+
+-configure_file(
+- input: 'session.conf.in',
+- output: 'session.conf',
+- configuration: {
+- 'requires_component': gdm_gnome_shell_component,
+- 'wants_required_components': '\n'.join(gdm_gnome_session_wanted_targets),
+- },
+- install_dir: systemd_userunitdir / 'gnome-session@gnome-login.target.d',
+-)
++if systemduserunitdir != 'no'
++ configure_file(
++ input: 'session.conf.in',
++ output: 'session.conf',
++ configuration: {
++ 'requires_component': gdm_gnome_shell_component,
++ 'wants_required_components': '\n'.join(gdm_gnome_session_wanted_targets),
++ },
++ install_dir: systemd_userunitdir / 'gnome-session@gnome-login.target.d',
++ )
++endif
+
+ # XSession
+ if get_option('gdm-xsession')
+diff --git a/data/pam-arch/gdm-launch-environment.pam b/data/pam-arch/gdm-launch-environment.pam
+index 20d1810a..d8910d0a 100644
+--- a/data/pam-arch/gdm-launch-environment.pam
++++ b/data/pam-arch/gdm-launch-environment.pam
+@@ -14,4 +14,5 @@ session optional pam_keyinit.so force revoke
+ session required pam_succeed_if.so audit quiet_success user in gdm:gnome-initial-setup
+ session optional pam_permit.so
+ -session optional pam_systemd.so
++-session optional pam_elogind.so
+ session required pam_env.so user_readenv=1
+diff --git a/libgdm/meson.build b/libgdm/meson.build
+index 3f8cafbb..83e95151 100644
+--- a/libgdm/meson.build
++++ b/libgdm/meson.build
+@@ -56,7 +56,7 @@ libgdm_deps = [
+ glib_dep,
+ gio_dep,
+ gio_unix_dep,
+- libsystemd_dep,
++ logind_dep,
+ libgdmcommon_dep,
+ ]
+
+diff --git a/meson.build b/meson.build
+index e6fcf4b8..a86a486b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -92,21 +92,30 @@ xdmcp_dep = cc.find_library('Xdmcp', required: get_option('xdmcp'))
+ if xdmcp_dep.found() and get_option('tcp-wrappers')
+ libwrap_dep = cc.find_library('libwrap')
+ endif
+-# systemd
+-systemd_dep = dependency('systemd')
+-libsystemd_dep = dependency('libsystemd')
+-if meson.version().version_compare('>= 0.53')
+- systemd_multiseat_x = find_program('systemd-multi-seat-x',
+- required: false,
+- dirs: [
+- systemd_dep.get_pkgconfig_variable('systemdutildir'),
+- '/lib/systemd',
+- '/usr/lib/systemd',
+- ])
++
++logind_provider = get_option('logind-provider')
++systemd_dep = dependency('systemd', required: false)
++if logind_provider == 'systemd'
++ libsystemd_dep = dependency('libsystemd')
++ logind_dep = libsystemd_dep
++ if meson.version().version_compare('>= 0.53')
++ systemd_multiseat_x = find_program('systemd-multi-seat-x',
++ required: false,
++ dirs: [
++ systemd_dep.get_pkgconfig_variable('systemdutildir'),
++ '/lib/systemd',
++ '/usr/lib/systemd',
++ ])
++ else
++ systemd_multiseat_x = find_program('systemd-multi-seat-x', required: false)
++ endif
++ systemd_x_server = systemd_multiseat_x.found()? systemd_multiseat_x.path() : '/lib/systemd/systemd-multi-seat-x'
+ else
+- systemd_multiseat_x = find_program('systemd-multi-seat-x', required: false)
++ elogind_dep = dependency('libelogind')
++ logind_dep = elogind_dep
++ systemd_x_server = 'disabled'
+ endif
+-systemd_x_server = systemd_multiseat_x.found()? systemd_multiseat_x.path() : '/lib/systemd/systemd-multi-seat-x'
++
+ # Plymouth
+ plymouth_dep = dependency('ply-boot-client', required: get_option('plymouth'))
+ # Check for Solaris auditing API (ADT)
+@@ -313,6 +322,7 @@ summary({
+ 'PAM Syslog': have_pam_syslog,
+ 'Supports PAM Extensions': pam_extensions_supported,
+ 'SeLinux': libselinux_dep.found(),
++ 'Logind Provider': get_option('logind-provider'),
+ 'Use GDM Xsession': get_option('gdm-xsession'),
+ 'Use UserDisplayServer': get_option('user-display-server'),
+ 'Use SystemdJournal': get_option('systemd-journal'),
+diff --git a/meson_options.txt b/meson_options.txt
+index 14e0b908..5135d7d6 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -12,6 +12,7 @@ option('initial-vt', type: 'integer', value: 1, description: 'Initial virtual te
+ option('ipv6', type: 'boolean', value: false, description: 'Enables compilation of IPv6 code.')
+ option('lang-file', type: 'string', value: '', description: 'File containing default language settings.')
+ option('libaudit', type: 'feature', value: 'auto', description: 'Add Linux audit support.')
++option('logind-provider', type: 'combo', choices: ['systemd', 'elogind'], value: 'systemd', description: 'Which logind library to use.')
+ option('log-dir', type: 'string', value: '/var/log/gdm', description: 'Log directory.')
+ option('pam-mod-dir', type: 'string', value: '', description: 'Directory to install PAM modules in.')
+ option('pam-prefix', type: 'string', value: '', description: 'Specify where PAM files go.')
+@@ -27,8 +28,8 @@ option('solaris', type: 'boolean', value: false, description: 'Build for Solaris
+ option('split-authentication', type: 'boolean', value: true, description: 'Enable multiple simultaneous PAM conversations during login.')
+ option('sysconfsubdir', type: 'string', value: 'gdm', description: 'Directory name used under sysconfdir.')
+ option('systemd-journal', type: 'boolean', value: true, description: 'Use journald support.')
+-option('systemdsystemunitdir', type: 'string', value: '', description: 'Directory for systemd service files.')
+-option('systemduserunitdir', type: 'string', value: '', description: 'Directory for systemd user service files.')
++option('systemdsystemunitdir', type: 'string', value: '', description: 'Directory for systemd service files, or \'no\' to disable.')
++option('systemduserunitdir', type: 'string', value: '', description: 'Directory for systemd user service files, or \'no\' to disable.')
+ option('tcp-wrappers', type: 'boolean', value: false, description: 'Use TCP wrappers.')
+ option('udev-dir', type: 'string', value: '', description: 'Directory for udev rules file.')
+ option('user', type: 'string', value: 'gdm', description: 'GDM\'s username.')
+--
+2.31.1
+
diff --git a/desktop/gdm/0003-add-wayland-session-script.patch b/desktop/gdm/0003-add-wayland-session-script.patch
new file mode 100644
index 0000000000..c2fcc20df7
--- /dev/null
+++ b/desktop/gdm/0003-add-wayland-session-script.patch
@@ -0,0 +1,18 @@
+diff -Naur gdm-42.0/daemon/gdm-wayland-session.c gdm-42.0-patched/daemon/gdm-wayland-session.c
+--- gdm-42.0/daemon/gdm-wayland-session.c 2022-08-08 23:41:59.415766201 -0500
++++ gdm-42.0-patched/daemon/gdm-wayland-session.c 2022-08-08 23:54:05.595800828 -0500
+@@ -356,9 +356,11 @@
+ g_subprocess_launcher_setenv (launcher, "DBUS_SESSION_BUS_ADDRESS", state->bus_address, TRUE);
+ }
+
+- subprocess = g_subprocess_launcher_spawnv (launcher,
+- (const char * const *) argv,
+- &error);
++ subprocess = g_subprocess_launcher_spawn (launcher,
++ &error,
++ GDMCONFDIR "/wayland-session",
++ state->session_command,
++ NULL);
+ g_strfreev (argv);
+
+ if (subprocess == NULL) {
diff --git a/desktop/gdm/0004-fix-Xsession-language-in-gnome.patch b/desktop/gdm/0004-fix-Xsession-language-in-gnome.patch
new file mode 100644
index 0000000000..895fc234b1
--- /dev/null
+++ b/desktop/gdm/0004-fix-Xsession-language-in-gnome.patch
@@ -0,0 +1,14 @@
+diff -Naur gdm-42.0/data/Xsession.in gdm-42.0-patched/data/Xsession.in
+--- gdm-42.0/data/Xsession.in 2022-03-21 13:12:40.487113700 -0500
++++ gdm-42.0-patched/data/Xsession.in 2022-08-09 21:19:33.559221580 -0500
+@@ -45,6 +45,10 @@
+ fi
+ test -f "$HOME/.xprofile" && . "$HOME/.xprofile"
+
++# Get the AccountsService value for LANG over the system dbus. This is the user setting in GNOME:
++gnome_lang_usr="$(busctl get-property org.freedesktop.Accounts /org/freedesktop/Accounts/User$(id -u) org.freedesktop.Accounts.User Language | cut -d\" -f2)"
++[ "$DESKTOP_SESSION" = "gnome-xorg" ] && [ -n "$gnome_lang_usr" ] && export LANG=$gnome_lang_usr
++
+ # Translation stuff
+ if [ -x "@libexecdir@/gdmtranslate" ] ; then
+ gdmtranslate="@libexecdir@/gdmtranslate"
diff --git a/desktop/gdm/README b/desktop/gdm/README
new file mode 100644
index 0000000000..cbfa39afba
--- /dev/null
+++ b/desktop/gdm/README
@@ -0,0 +1,18 @@
+GDM is a system service that is responsible for providing graphical
+logins and managing local and remote display.
+
+A note on PAM:
+The GDM source includes PAM configs for linux distros like redhat, lfs,
+and arch. However, none of these pre-designed configs are suitable for
+Slackware's PAM configuration. Therefore I used 'sddm' as a reference
+and wrote configs for 'gdm' that work properly. I didn't include
+'gdm-fingerprint' or 'gdm-smartcard', since I don't have the hardware
+needed to properly test functionality.
+
+Additional Notes:
+- Slackware comes with the 'gdm' group and user already configured, so
+nothing needs to be done there.
+
+- The blocaled dependency is used to provide custom keymap support for
+ 'gdm'.
+
diff --git a/desktop/gdm/doinst.sh b/desktop/gdm/doinst.sh
new file mode 100644
index 0000000000..f0d59236c1
--- /dev/null
+++ b/desktop/gdm/doinst.sh
@@ -0,0 +1,21 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ rm $NEW
+ fi
+}
+
+config etc/gdm/custom.conf.new
+
+# Set the wayland-session script and gdm wrapper executable:
+( cd etc/gdm ; chmod 0755 wayland-session )
+( cd usr/sbin ; chmod 0755 gdm )
+
+if [ -e usr/share/glib-2.0/schemas ]; then
+ if [ -x /usr/bin/glib-compile-schemas ]; then
+ /usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas >/dev/null 2>&1
+ fi
+fi
diff --git a/desktop/gdm/gdm-autologin.pam b/desktop/gdm/gdm-autologin.pam
new file mode 100644
index 0000000000..1a6eece52d
--- /dev/null
+++ b/desktop/gdm/gdm-autologin.pam
@@ -0,0 +1,25 @@
+# Begin /etc/pam.d/gdm-autologin
+
+auth requisite pam_nologin.so
+auth required pam_env.so
+auth required pam_shells.so
+
+# Uncomment this line to restrict autologin to users with a UID greater
+# than 999 (in other words, don't allow autologin for root):
+#auth required pam_succeed_if.so uid >= 1000 quiet
+
+auth optional pam_gdm.so
+auth optional pam_gnome_keyring.so
+auth required pam_permit.so
+
+account include system-auth
+
+password include system-auth
+
+session substack system-auth
+session required pam_loginuid.so
+session optional pam_keyinit.so revoke
+session optional pam_elogind.so
+session optional pam_gnome_keyring.so auto_start
+session include postlogin
+# End /etc/pam.d/gdm-autologin \ No newline at end of file
diff --git a/desktop/gdm/gdm-launch-environment.pam b/desktop/gdm/gdm-launch-environment.pam
new file mode 100644
index 0000000000..58b32c910e
--- /dev/null
+++ b/desktop/gdm/gdm-launch-environment.pam
@@ -0,0 +1,18 @@
+# Begin /etc/pam.d/gdm-launch-environment
+
+auth required pam_succeed_if.so audit quiet_success user = gdm
+auth required pam_env.so
+auth optional pam_permit.so
+
+account required pam_succeed_if.so audit quiet_success user = gdm
+account include system-auth
+
+password required pam_deny.so
+
+session required pam_succeed_if.so audit quiet_success user = gdm
+-session optional pam_systemd.so
+-session optional pam_elogind.so
+session optional pam_keyinit.so force revoke
+session optional pam_permit.so
+
+# End /etc/pam.d/gdm-launch-environment \ No newline at end of file
diff --git a/desktop/gdm/gdm-password.pam b/desktop/gdm/gdm-password.pam
new file mode 100644
index 0000000000..b88b18fae0
--- /dev/null
+++ b/desktop/gdm/gdm-password.pam
@@ -0,0 +1,22 @@
+# Begin /etc/pam.d/gdm-password
+
+auth substack system-auth
+
+# Uncomment this line to restrict login to users with a UID greater
+# than 999 (in other words, don't allow login for root):
+#auth required pam_succeed_if.so uid >= 1000 quiet
+
+auth optional pam_gnome_keyring.so
+
+account include system-auth
+
+password include system-auth
+-password optional pam_gnome_keyring.so use_authtok
+
+session optional pam_keyinit.so force revoke
+session include system-auth
+session required pam_loginuid.so
+session optional pam_elogind.so
+session optional pam_gnome_keyring.so auto_start
+session include postlogin
+# End /etc/pam.d/gdm-password \ No newline at end of file
diff --git a/desktop/gdm/gdm.SlackBuild b/desktop/gdm/gdm.SlackBuild
new file mode 100644
index 0000000000..bb955aeea1
--- /dev/null
+++ b/desktop/gdm/gdm.SlackBuild
@@ -0,0 +1,141 @@
+#!/bin/bash
+
+# Slackware build script for GDM (GNOME Display Manager)
+
+# Copyright 2022 Bob Funk Winnipeg, Canada
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=gdm
+VERSION=${VERSION:-42.0}
+BUILD=${BUILD:-3}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.?z
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# A couple patches taken from Artix Linux:
+patch -Np1 -i $CWD/0001-Xsession-Don-t-start-ssh-agent-by-default.patch
+patch -Np1 -i $CWD/0002-meson-allow-building-with-elogind.patch
+patch -Np1 -i $CWD/0003-add-wayland-session-script.patch
+patch -Np1 -i $CWD/0004-fix-Xsession-language-in-gnome.patch
+
+mkdir build
+cd build
+ CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ meson .. \
+ --buildtype=release \
+ --infodir=/usr/info \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libexecdir=/usr/libexec \
+ -Dstrip=true \
+ -Ddbus-sys="/usr/share/dbus-1/system.d" \
+ -Ddefault-pam-config=none \
+ -Dpam-mod-dir="/lib${LIBDIRSUFFIX}/security" \
+ -Dgdm-xsession=true \
+ -Drun-dir=/run/gdm \
+ -Dlogind-provider=elogind \
+ -Dsystemd-journal=false \
+ -Dsystemdsystemunitdir=no \
+ -Dsystemduserunitdir=no \
+ -Dsysconfsubdir=/etc/gdm \
+ -Dinitial-vt=7
+ "${NINJA:=ninja}"
+ DESTDIR=$PKG $NINJA install
+cd ..
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/etc/pam.d
+cat $CWD/gdm-autologin.pam > $PKG/etc/pam.d/gdm-autologin
+cat $CWD/gdm-password.pam > $PKG/etc/pam.d/gdm-password
+cat $CWD/gdm-launch-environment.pam > $PKG/etc/pam.d/gdm-launch-environment
+cat $CWD/wayland-session > $PKG/etc/gdm/wayland-session
+
+# Install GDM wrapper script:
+mv $PKG/usr/sbin/{gdm,gdm-bin}
+cat $CWD/gdm.wrap > $PKG/usr/sbin/gdm
+
+# Handle /etc/gdm/custom.conf a little nicer:
+mv $PKG/etc/gdm/{custom.conf,custom.conf.new}
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ AUTHORS COPYING HACKING MAINTAINERS NEWS README.md \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/desktop/gdm/gdm.info b/desktop/gdm/gdm.info
new file mode 100644
index 0000000000..4f16140fd2
--- /dev/null
+++ b/desktop/gdm/gdm.info
@@ -0,0 +1,10 @@
+PRGNAM="gdm"
+VERSION="42.0"
+HOMEPAGE="https://gitlab.gnome.org/GNOME/gdm"
+DOWNLOAD="https://download.gnome.org/sources/gdm/42/gdm-42.0.tar.xz"
+MD5SUM="8fb99fd6032127fe6f57462c696607e5"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="blocaled gnome-session gnome-shell"
+MAINTAINER="Bob Funk"
+EMAIL="bobfunk11@gmail.com"
diff --git a/desktop/gdm/gdm.wrap b/desktop/gdm/gdm.wrap
new file mode 100644
index 0000000000..48aca9381b
--- /dev/null
+++ b/desktop/gdm/gdm.wrap
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# GDM Wrapper Script
+#
+# Slackware starts GDM with "/usr/sbin/gdm -nodaemon", which is invalid and
+# crashes GDM and runlevel 4. Since its not being fixed, lets sanitize that
+# ourselves with a wrapper script.
+
+sanitized_opts="$(echo $@ | sed 's/-nodaemon//g')"
+exec /usr/sbin/gdm-bin "$sanitized_opts"
+
diff --git a/desktop/gdm/slack-desc b/desktop/gdm/slack-desc
new file mode 100644
index 0000000000..9b4791d09f
--- /dev/null
+++ b/desktop/gdm/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+gdm: gdm (GNOME Display Manager)
+gdm:
+gdm: The GNOME Display Manager is a system service that is responsible for
+gdm: providing graphical logins and managing local and remote displays.
+gdm:
+gdm:
+gdm:
+gdm:
+gdm:
+gdm: Homepage: https://gitlab.gnome.org/GNOME/gdm
+gdm:
diff --git a/desktop/gdm/wayland-session b/desktop/gdm/wayland-session
new file mode 100644
index 0000000000..6df4875821
--- /dev/null
+++ b/desktop/gdm/wayland-session
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# Get the AccountsService value for LANG over the system dbus. This is the user setting in GNOME:
+gnome_lang_usr="$(busctl get-property org.freedesktop.Accounts /org/freedesktop/Accounts/User$(id -u) org.freedesktop.Accounts.User Language | cut -d\" -f2)"
+
+# The rest of this code is based on KDE's wayland-session script,
+# with some modifications to suit GDM.
+# Copyright (C) 2022 Bob Funk <bobfunk11@gmail.com>
+# This code was copied from KDE's "wayland-session" script.
+# Copyright (C) 2015-2016 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
+# This file is extracted from kde-workspace (kdm/kfrontend/genkdmconf.c)
+# Copyright (C) 2001-2005 Oswald Buddenhagen <ossi@kde.org>
+
+case $SHELL in
+ */bash)
+ [ -z "$BASH" ] && exec $SHELL $0 "$@"
+ set +o posix
+ [ -f /etc/profile ] && . /etc/profile
+ if [ -f $HOME/.bash_profile ]; then
+ . $HOME/.bash_profile
+ elif [ -f $HOME/.bash_login ]; then
+ . $HOME/.bash_login
+ elif [ -f $HOME/.profile ]; then
+ . $HOME/.profile
+ fi
+ [ "$DESKTOP_SESSION" = "gnome" ] && [ -n "$gnome_lang_usr" ] && export LANG=$gnome_lang_usr
+ ;;
+ */zsh)
+ [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
+ [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
+ zhome=${ZDOTDIR:-$HOME}
+ # zshenv is always sourced automatically.
+ [ -f $zdir/zprofile ] && . $zdir/zprofile
+ [ -f $zhome/.zprofile ] && . $zhome/.zprofile
+ [ -f $zdir/zlogin ] && . $zdir/zlogin
+ [ -f $zhome/.zlogin ] && . $zhome/.zlogin
+ [ "$DESKTOP_SESSION" = "gnome" ] && [ -n "$gnome_lang_usr" ] && export LANG=$gnome_lang_usr
+ emulate -R sh
+ ;;
+ */csh|*/tcsh)
+ # [t]cshrc is always sourced automatically.
+ # Note that sourcing csh.login after .cshrc is non-standard.
+ wlsess_tmp=`mktemp /tmp/wlsess-env-XXXXXX`
+ $SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c 'export -p' >! $wlsess_tmp"
+ . $wlsess_tmp
+ rm -f $wlsess_tmp
+ ;;
+ */fish)
+ xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
+ $SHELL --login -c "/bin/sh -c 'export -p' > $xsess_tmp"
+ . $xsess_tmp
+ rm -f $xsess_tmp
+ ;;
+ *) # Plain sh, ksh, and anything we do not know.
+ [ -f /etc/profile ] && . /etc/profile
+ [ -f $HOME/.profile ] && . $HOME/.profile
+ [ "$DESKTOP_SESSION" = "gnome" ] && [ -n "$gnome_lang_usr" ] && export LANG=$gnome_lang_usr
+ ;;
+esac
+
+# We have to use eval here:
+eval exec "$@"