git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #39615 from jtojnar/gdm-wayland

GDM wayland improvements

commit75cc398b975290ea8a65525965bc15120fa589ae authorJan Tojnar <jtojnar@gmail.com> dateWed 16 May 2018, 16:39 (9 years ago) parent685d60c54135fc
3 files changed+100−31
nixos/modules/services/x11/display-managers/gdm.nix+3 pkgs/desktops/gnome-3/core/gdm/default.nix+37−31 pkgs/desktops/gnome-3/core/gdm/fix-paths.patch+60
nixos/modules/services/x11/display-managers/gdm.nix+3
@@ -135,6 +135,9 @@ in
135135
136136 systemd.services.display-manager.path = [ pkgs.gnome3.gnome-session ];
137137
138+ # Allow choosing an user account
139+ services.accounts-daemon.enable = true;
140+
138141 services.dbus.packages = [ gdm ];
139142
140143 systemd.user.services.dbus.wantedBy = [ "default.target" ];
pkgs/desktops/gnome-3/core/gdm/default.nix+37−31
@@ -1,7 +1,7 @@
1−{ stdenv, fetchurl, pkgconfig, glib, itstool, libxml2, xorg, dbus
1+{ stdenv, fetchurl, substituteAll, pkgconfig, glib, itstool, libxml2, xorg, dbus
22, intltool, accountsservice, libX11, gnome3, systemd, autoreconfHook
33, gtk, libcanberra-gtk3, pam, libtool, gobjectIntrospection, plymouth
4−, librsvg, coreutils }:
4+, librsvg, coreutils, xwayland }:
55
66stdenv.mkDerivation rec {
77 name = "gdm-${version}";
@@ -12,50 +12,56 @@ stdenv.mkDerivation rec {
1212 sha256 = "1yxjjyrp0ywrc25cp81bsdhp79zn0c0jag48hlp00b5wfnkqy1kp";
1313 };
1414
15− passthru = {
16− updateScript = gnome3.updateScript { packageName = "gdm"; attrPath = "gnome3.gdm"; };
17− };
18−
1915 # Only needed to make it build
2016 preConfigure = ''
2117 substituteInPlace ./configure --replace "/usr/bin/X" "${xorg.xorgserver.out}/bin/X"
2218 '';
2319
24− postPatch = ''
25− substituteInPlace daemon/gdm-manager.c --replace "/bin/plymouth" "${plymouth}/bin/plymouth"
26− substituteInPlace data/gdm.service.in --replace "/bin/kill" "${coreutils}/bin/kill"
27− '';
28−
29− configureFlags = [ "--sysconfdir=/etc"
30− "--localstatedir=/var"
31− "--with-plymouth=yes"
32− "--with-initial-vt=7"
33− "--with-systemdsystemunitdir=$(out)/etc/systemd/system" ];
20+ configureFlags = [
21+ "--sysconfdir=/etc"
22+ "--localstatedir=/var"
23+ "--with-plymouth=yes"
24+ "--with-initial-vt=7"
25+ "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
26+ ];
3427
3528 nativeBuildInputs = [ pkgconfig libxml2 itstool intltool autoreconfHook libtool gnome3.dconf ];
36− buildInputs = [ glib accountsservice systemd
37− gobjectIntrospection libX11 gtk
38− libcanberra-gtk3 pam plymouth librsvg ];
29+ buildInputs = [
30+ glib accountsservice systemd
31+ gobjectIntrospection libX11 gtk
32+ libcanberra-gtk3 pam plymouth librsvg
33+ ];
3934
4035 enableParallelBuilding = true;
4136
4237 # Disable Access Control because our X does not support FamilyServerInterpreted yet
43− patches = [ ./sessions_dir.patch
44− ./gdm-x-session_extra_args.patch
45− ./gdm-session-worker_xserver-path.patch
46− ];
47−
48− postInstall = ''
49− # Prevent “Could not parse desktop file orca-autostart.desktop or it references a not found TryExec binary”
50− rm $out/share/gdm/greeter/autostart/orca-autostart.desktop
51− '';
38+ patches = [
39+ (substituteAll {
40+ src = ./fix-paths.patch;
41+ inherit coreutils plymouth xwayland;
42+ })
43+ ./sessions_dir.patch
44+ ./gdm-x-session_extra_args.patch
45+ ./gdm-session-worker_xserver-path.patch
46+ ];
5247
53− installFlags = [ "sysconfdir=$(out)/etc" "dbusconfdir=$(out)/etc/dbus-1/system.d" ];
48+ installFlags = [
49+ "sysconfdir=$(out)/etc"
50+ "dbusconfdir=$(out)/etc/dbus-1/system.d"
51+ ];
52+
53+ passthru = {
54+ updateScript = gnome3.updateScript {
55+ packageName = "gdm";
56+ attrPath = "gnome3.gdm";
57+ };
58+ };
5459
5560 meta = with stdenv.lib; {
56− homepage = https://wiki.gnome.org/Projects/GDM;
5761 description = "A program that manages graphical display servers and handles graphical user logins";
58− platforms = platforms.linux;
62+ homepage = https://wiki.gnome.org/Projects/GDM;
63+ license = licenses.gpl2Plus;
5964 maintainers = gnome3.maintainers;
65+ platforms = platforms.linux;
6066 };
6167}
pkgs/desktops/gnome-3/core/gdm/fix-paths.patchnew file+60
@@ -0,0 +1,60 @@
1+--- a/daemon/gdm-local-display-factory.c
2++++ b/daemon/gdm-local-display-factory.c
3+@@ -450,7 +450,7 @@
4+ #ifdef ENABLE_WAYLAND_SUPPORT
5+ gboolean wayland_enabled = FALSE;
6+ if (gdm_settings_direct_get_boolean (GDM_KEY_WAYLAND_ENABLE, &wayland_enabled)) {
7+- if (wayland_enabled && g_file_test ("/usr/bin/Xwayland", G_FILE_TEST_IS_EXECUTABLE) ) {
8++ if (wayland_enabled && g_file_test ("@xwayland@/bin/Xwayland", G_FILE_TEST_IS_EXECUTABLE) ) {
9+ session_type = "wayland";
10+ }
11+ }
12+--- a/daemon/gdm-manager.c
13++++ b/daemon/gdm-manager.c
14+@@ -147,7 +147,7 @@
15+ GError *error;
16+
17+ error = NULL;
18+- res = g_spawn_command_line_sync ("/bin/plymouth --ping",
19++ res = g_spawn_command_line_sync ("@plymouth@/bin/plymouth --ping",
20+ NULL, NULL, &status, &error);
21+ if (! res) {
22+ g_debug ("Could not ping plymouth: %s", error->message);
23+@@ -165,7 +165,7 @@
24+ GError *error;
25+
26+ error = NULL;
27+- res = g_spawn_command_line_sync ("/bin/plymouth deactivate",
28++ res = g_spawn_command_line_sync ("@plymouth@/bin/plymouth deactivate",
29+ NULL, NULL, NULL, &error);
30+ if (! res) {
31+ g_warning ("Could not deactivate plymouth: %s", error->message);
32+@@ -180,7 +180,7 @@
33+ GError *error;
34+
35+ error = NULL;
36+- res = g_spawn_command_line_async ("/bin/plymouth quit --retain-splash", &error);
37++ res = g_spawn_command_line_async ("@plymouth@/bin/plymouth quit --retain-splash", &error);
38+ if (! res) {
39+ g_warning ("Could not quit plymouth: %s", error->message);
40+ g_error_free (error);
41+@@ -196,7 +196,7 @@
42+ GError *error;
43+
44+ error = NULL;
45+- res = g_spawn_command_line_async ("/bin/plymouth quit", &error);
46++ res = g_spawn_command_line_async ("@plymouth@/bin/plymouth quit", &error);
47+ if (! res) {
48+ g_warning ("Could not quit plymouth: %s", error->message);
49+ g_error_free (error);
50+--- a/data/gdm.service.in
51++++ b/data/gdm.service.in
52+@@ -28,7 +28,7 @@
53+ StandardOutput=syslog
54+ StandardError=inherit
55+ EnvironmentFile=-@LANG_CONFIG_FILE@
56+-ExecReload=/bin/kill -SIGHUP $MAINPID
57++ExecReload=@coreutils@/bin/kill -SIGHUP $MAINPID
58+
59+ [Install]
60+ Alias=display-manager.service