gnome3.gdm: 3.34.1 -> 3.38
* build with meson * remove libxml2 and libtool * sync patches * unset enableParallelBuilding with meson it's the default
This commit is contained in:
parent
b2ff709179
commit
bcf3872cba
@ -1,7 +1,35 @@
|
|||||||
{ stdenv, fetchurl, substituteAll, pkgconfig, glib, itstool, libxml2, xorg
|
{ stdenv
|
||||||
, accountsservice, libX11, gnome3, systemd, autoreconfHook, dconf
|
, fetchurl
|
||||||
, gtk3, libcanberra-gtk3, pam, libtool, gobject-introspection, plymouth
|
, fetchpatch
|
||||||
, librsvg, coreutils, xwayland, nixos-icons, fetchpatch }:
|
, substituteAll
|
||||||
|
, meson
|
||||||
|
, ninja
|
||||||
|
, python3
|
||||||
|
, rsync
|
||||||
|
, pkg-config
|
||||||
|
, glib
|
||||||
|
, itstool
|
||||||
|
, libxml2
|
||||||
|
, xorg
|
||||||
|
, accountsservice
|
||||||
|
, libX11
|
||||||
|
, gnome3
|
||||||
|
, systemd
|
||||||
|
, dconf
|
||||||
|
, gtk3
|
||||||
|
, libcanberra-gtk3
|
||||||
|
, pam
|
||||||
|
, libselinux
|
||||||
|
, keyutils
|
||||||
|
, audit
|
||||||
|
, gobject-introspection
|
||||||
|
, plymouth
|
||||||
|
, librsvg
|
||||||
|
, coreutils
|
||||||
|
, xwayland
|
||||||
|
, dbus
|
||||||
|
, nixos-icons
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -19,44 +47,64 @@ in
|
|||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "gdm";
|
pname = "gdm";
|
||||||
version = "3.34.1";
|
version = "3.38.0";
|
||||||
|
|
||||||
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://gnome/sources/gdm/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
url = "mirror://gnome/sources/gdm/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
||||||
sha256 = "1lyqvcwxhwxklbxn4xjswjzr6fhjix6h28mi9ypn34wdm9bzcpg8";
|
sha256 = "1fimhklb204rflz8k345756jikgbw8113hms3zlcwk6975f43m26";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Only needed to make it build
|
mesonFlags = [
|
||||||
preConfigure = ''
|
"-Dgdm-xsession=true"
|
||||||
substituteInPlace ./configure --replace "/usr/bin/X" "${xorg.xorgserver.out}/bin/X"
|
# TODO: Setup a default-path? https://gitlab.gnome.org/GNOME/gdm/-/blob/6fc40ac6aa37c8ad87c32f0b1a5d813d34bf7770/meson_options.txt#L6
|
||||||
'';
|
"-Dinitial-vt=${passthru.initialVT}"
|
||||||
|
"-Dudev-dir=${placeholder "out"}/lib/udev/rules.d"
|
||||||
initialVT = "7";
|
"-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
|
||||||
|
"-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user"
|
||||||
configureFlags = [
|
|
||||||
"--sysconfdir=/etc"
|
"--sysconfdir=/etc"
|
||||||
"--localstatedir=/var"
|
"--localstatedir=/var"
|
||||||
"--with-plymouth=yes"
|
|
||||||
"--enable-gdm-xsession"
|
|
||||||
"--with-initial-vt=${initialVT}"
|
|
||||||
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
|
|
||||||
"--with-udevdir=$(out)/lib/udev"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig libxml2 itstool autoreconfHook libtool dconf ];
|
nativeBuildInputs = [
|
||||||
|
dconf
|
||||||
|
glib # for glib-compile-schemas
|
||||||
|
itstool
|
||||||
|
meson
|
||||||
|
ninja
|
||||||
|
pkg-config
|
||||||
|
python3
|
||||||
|
rsync
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
glib accountsservice systemd
|
accountsservice
|
||||||
gobject-introspection libX11 gtk3
|
audit
|
||||||
libcanberra-gtk3 pam plymouth librsvg
|
glib
|
||||||
|
gobject-introspection
|
||||||
|
gtk3
|
||||||
|
keyutils
|
||||||
|
libX11
|
||||||
|
libcanberra-gtk3
|
||||||
|
libselinux
|
||||||
|
pam
|
||||||
|
plymouth
|
||||||
|
systemd
|
||||||
|
xorg.libXdmcp
|
||||||
];
|
];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
|
# https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/112
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://gitlab.gnome.org/GNOME/gdm/-/commit/1d28d4b3568381b8590d2235737b924aefd1746c.patch";
|
||||||
|
sha256 = "ZUXKZS4T0o0hzrApxaqcR0txCRv5zBgqeQ9K9fLNX1o=";
|
||||||
|
})
|
||||||
|
|
||||||
# Change hardcoded paths to nix store paths.
|
# Change hardcoded paths to nix store paths.
|
||||||
(substituteAll {
|
(substituteAll {
|
||||||
src = ./fix-paths.patch;
|
src = ./fix-paths.patch;
|
||||||
inherit coreutils plymouth xwayland;
|
inherit coreutils plymouth xwayland dbus;
|
||||||
})
|
})
|
||||||
|
|
||||||
# The following patches implement certain environment variables in GDM which are set by
|
# The following patches implement certain environment variables in GDM which are set by
|
||||||
@ -74,23 +122,61 @@ stdenv.mkDerivation rec {
|
|||||||
# Set up the environment properly when launching sessions
|
# Set up the environment properly when launching sessions
|
||||||
# https://github.com/NixOS/nixpkgs/issues/48255
|
# https://github.com/NixOS/nixpkgs/issues/48255
|
||||||
./reset-environment.patch
|
./reset-environment.patch
|
||||||
|
|
||||||
|
# Fix runtime patch location.
|
||||||
|
# https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/114
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://gitlab.gnome.org/GNOME/gdm/-/commit/9d841d681f3d1c58e3df51a98421257f774cd185.patch";
|
||||||
|
sha256 = "0lf5kpz9ghylqlbybc0mpfsvr4i29z1ag8wf6j1918hjrfcipnxj";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
installFlags = [
|
postPatch = ''
|
||||||
"sysconfdir=$(out)/etc"
|
patchShebangs build-aux/meson_post_install.py
|
||||||
"dbusconfdir=$(out)/etc/dbus-1/system.d"
|
|
||||||
];
|
# Upstream checks some common paths to find an `X` binary. We already know it.
|
||||||
|
echo #!/bin/sh > build-aux/find-x-server.sh
|
||||||
|
echo "echo ${stdenv.lib.getBin xorg.xorgserver}/bin/X" >> build-aux/find-x-server.sh
|
||||||
|
patchShebangs build-aux/find-x-server.sh
|
||||||
|
'';
|
||||||
|
|
||||||
preInstall = ''
|
preInstall = ''
|
||||||
schema_dir=${glib.makeSchemaPath "$out" "${pname}-${version}"}
|
install -D ${override} ${DESTDIR}/$out/share/glib-2.0/schemas/org.gnome.login-screen.gschema.override
|
||||||
install -D ${override} $schema_dir/org.gnome.login-screen.gschema.override
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
# Move stuff from DESTDIR to proper location.
|
||||||
|
# We use rsync to merge the directories.
|
||||||
|
rsync --archive "${DESTDIR}/etc" "$out"
|
||||||
|
rm --recursive "${DESTDIR}/etc"
|
||||||
|
for o in $outputs; do
|
||||||
|
rsync --archive "${DESTDIR}/''${!o}" "$(dirname "''${!o}")"
|
||||||
|
rm --recursive "${DESTDIR}/''${!o}"
|
||||||
|
done
|
||||||
|
# Ensure the DESTDIR is removed.
|
||||||
|
rmdir "${DESTDIR}/nix/store" "${DESTDIR}/nix" "${DESTDIR}"
|
||||||
|
|
||||||
|
# We are setting DESTDIR so the post-install script does not compile the schemas.
|
||||||
|
glib-compile-schemas "$out/share/glib-2.0/schemas"
|
||||||
|
'';
|
||||||
|
|
||||||
|
# HACK: We want to install configuration files to $out/etc
|
||||||
|
# but GDM should read them from /etc on a NixOS system.
|
||||||
|
# With autotools, it was possible to override Make variables
|
||||||
|
# at install time but Meson does not support this
|
||||||
|
# so we need to convince it to install all files to a temporary
|
||||||
|
# location using DESTDIR and then move it to proper one in postInstall.
|
||||||
|
DESTDIR = "${placeholder "out"}/dest";
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
updateScript = gnome3.updateScript {
|
updateScript = gnome3.updateScript {
|
||||||
packageName = "gdm";
|
packageName = "gdm";
|
||||||
attrPath = "gnome3.gdm";
|
attrPath = "gnome3.gdm";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Used in GDM NixOS module
|
||||||
|
# Don't remove.
|
||||||
|
initialVT = "7";
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -13,48 +13,70 @@
|
|||||||
+++ b/daemon/gdm-manager.c
|
+++ b/daemon/gdm-manager.c
|
||||||
@@ -145,7 +145,7 @@
|
@@ -145,7 +145,7 @@
|
||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
- res = g_spawn_command_line_sync ("/bin/plymouth --ping",
|
- res = g_spawn_command_line_sync ("plymouth --ping",
|
||||||
+ res = g_spawn_command_line_sync ("@plymouth@/bin/plymouth --ping",
|
+ res = g_spawn_command_line_sync ("@plymouth@/bin/plymouth --ping",
|
||||||
NULL, NULL, &status, &error);
|
NULL, NULL, &status, &error);
|
||||||
if (! res) {
|
if (! res) {
|
||||||
g_debug ("Could not ping plymouth: %s", error->message);
|
g_debug ("Could not ping plymouth: %s", error->message);
|
||||||
@@ -163,7 +163,7 @@
|
@@ -163,7 +163,7 @@
|
||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
- res = g_spawn_command_line_sync ("/bin/plymouth deactivate",
|
- res = g_spawn_command_line_sync ("plymouth deactivate",
|
||||||
+ res = g_spawn_command_line_sync ("@plymouth@/bin/plymouth deactivate",
|
+ res = g_spawn_command_line_sync ("@plymouth@/bin/plymouth deactivate",
|
||||||
NULL, NULL, NULL, &error);
|
NULL, NULL, NULL, &error);
|
||||||
if (! res) {
|
if (! res) {
|
||||||
g_warning ("Could not deactivate plymouth: %s", error->message);
|
g_warning ("Could not deactivate plymouth: %s", error->message);
|
||||||
@@ -178,7 +178,7 @@
|
@@ -178,7 +178,7 @@
|
||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
- res = g_spawn_command_line_async ("/bin/plymouth quit --retain-splash", &error);
|
- res = g_spawn_command_line_async ("plymouth quit --retain-splash", &error);
|
||||||
+ res = g_spawn_command_line_async ("@plymouth@/bin/plymouth quit --retain-splash", &error);
|
+ res = g_spawn_command_line_async ("@plymouth@/bin/plymouth quit --retain-splash", &error);
|
||||||
if (! res) {
|
if (! res) {
|
||||||
g_warning ("Could not quit plymouth: %s", error->message);
|
g_warning ("Could not quit plymouth: %s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
@@ -194,7 +194,7 @@
|
@@ -194,7 +194,7 @@
|
||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
- res = g_spawn_command_line_async ("/bin/plymouth quit", &error);
|
- res = g_spawn_command_line_async ("plymouth quit", &error);
|
||||||
+ res = g_spawn_command_line_async ("@plymouth@/bin/plymouth quit", &error);
|
+ res = g_spawn_command_line_async ("@plymouth@/bin/plymouth quit", &error);
|
||||||
if (! res) {
|
if (! res) {
|
||||||
g_warning ("Could not quit plymouth: %s", error->message);
|
g_warning ("Could not quit plymouth: %s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
--- a/data/gdm.service.in
|
--- a/data/gdm.service.in
|
||||||
+++ b/data/gdm.service.in
|
+++ b/data/gdm.service.in
|
||||||
@@ -28,7 +28,7 @@ BusName=org.gnome.DisplayManager
|
@@ -26,7 +26,7 @@ Restart=always
|
||||||
StandardOutput=syslog
|
IgnoreSIGPIPE=no
|
||||||
StandardError=inherit
|
BusName=org.gnome.DisplayManager
|
||||||
EnvironmentFile=-@LANG_CONFIG_FILE@
|
EnvironmentFile=-${LANG_CONFIG_FILE}
|
||||||
-ExecReload=/bin/kill -SIGHUP $MAINPID
|
-ExecReload=/bin/kill -SIGHUP $MAINPID
|
||||||
+ExecReload=@coreutils@/bin/kill -SIGHUP $MAINPID
|
+ExecReload=@coreutils@/bin/kill -SIGHUP $MAINPID
|
||||||
KeyringMode=shared
|
KeyringMode=shared
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
--- a/daemon/gdm-session.c
|
||||||
|
+++ b/daemon/gdm-session.c
|
||||||
|
@@ -2916,16 +2916,16 @@ gdm_session_start_session (GdmSession *self,
|
||||||
|
*/
|
||||||
|
if (run_launcher) {
|
||||||
|
if (is_x11) {
|
||||||
|
- program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s\"dbus-run-session -- %s\"",
|
||||||
|
+ program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s\"@dbus@/bin/dbus-run-session --dbus-daemon=@dbus@/bin/dbus-daemon -- %s\"",
|
||||||
|
register_session ? "--register-session " : "",
|
||||||
|
self->selected_program);
|
||||||
|
} else {
|
||||||
|
- program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"dbus-run-session -- %s\"",
|
||||||
|
+ program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"@dbus@/bin/dbus-run-session --dbus-daemon=@dbus@/bin/dbus-daemon -- %s\"",
|
||||||
|
register_session ? "--register-session " : "",
|
||||||
|
self->selected_program);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
- program = g_strdup_printf ("dbus-run-session -- %s",
|
||||||
|
+ program = g_strdup_printf ("@dbus@/bin/dbus-run-session --dbus-daemon=@dbus@/bin/dbus-daemon -- %s",
|
||||||
|
self->selected_program);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user