Blame SOURCES/0001-meson-Fix-detection-of-Xorg-versions-that-need-liste.patch

84adb8
From b8caa1a18f284cc9b59a2e0273780a51b6fd7528 Mon Sep 17 00:00:00 2001
84adb8
From: Alan Coopersmith <alan.coopersmith@oracle.com>
84adb8
Date: Thu, 7 Oct 2021 18:22:11 -0700
84adb8
Subject: [PATCH 1/2] meson: Fix detection of Xorg versions that need -listen
84adb8
 tcp
84adb8
84adb8
Closes #704
84adb8
---
84adb8
 meson.build | 4 ++++
84adb8
 1 file changed, 4 insertions(+)
84adb8
84adb8
diff --git a/meson.build b/meson.build
84adb8
index 64b98628..52ac1941 100644
84adb8
--- a/meson.build
84adb8
+++ b/meson.build
84adb8
@@ -42,60 +42,63 @@ udev_dep = dependency('udev')
84adb8
 glib_min_version = '2.56.0'
84adb8
 
84adb8
 glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
84adb8
 gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version)
84adb8
 gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version)
84adb8
 gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version)
84adb8
 gtk_dep = dependency('gtk+-3.0', version: '>= 2.91.1')
84adb8
 libcanberra_gtk_dep = dependency('libcanberra-gtk3', version: '>= 0.4')
84adb8
 accountsservice_dep = dependency('accountsservice', version: '>= 0.6.35')
84adb8
 xcb_dep = dependency('xcb')
84adb8
 keyutils_dep = dependency('libkeyutils', required: false)
84adb8
 libselinux_dep = dependency('libselinux', required: get_option('selinux'))
84adb8
 
84adb8
 # udev
84adb8
 if udev_dir == ''
84adb8
   if udev_dep.found()
84adb8
     udev_prefix = udev_dep.get_pkgconfig_variable('udevdir')
84adb8
   else
84adb8
     udev_prefix = gdm_prefix / 'lib' / 'udev'
84adb8
   endif
84adb8
   udev_dir = udev_prefix / 'rules.d'
84adb8
 endif
84adb8
 
84adb8
 # X11
84adb8
 x_deps = declare_dependency(
84adb8
   dependencies: [
84adb8
     dependency('x11'),
84adb8
     dependency('xau'),
84adb8
   ],
84adb8
 )
84adb8
+# Xserver 1.17 & later default to -nolisten and require -listen for remote access
84adb8
+xserver_deps = dependency('xorg-server', version : '>=1.17', required : false)
84adb8
+xserver_nolisten_default = xserver_deps.found()
84adb8
 find_x_server_script = find_program('build-aux/find-x-server.sh', native: true)
84adb8
 find_x_server_out = run_command(find_x_server_script).stdout().strip()
84adb8
 if find_x_server_out != ''
84adb8
   x_bin = find_x_server_out
84adb8
   x_bin_path_split = x_bin.split('/')
84adb8
   i = 0
84adb8
   x_path = '/'
84adb8
   foreach dir : x_bin_path_split
84adb8
     if i < x_bin_path_split.length() - 1
84adb8
       x_path = x_path / dir
84adb8
     endif
84adb8
     i = i + 1
84adb8
   endforeach
84adb8
 else
84adb8
   # what to do, what to do, this is wrong, but this just sets the
84adb8
   # defaults, perhaps this user is cross compiling or some such
84adb8
   x_path = '/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin'
84adb8
   x_bin = '/usr/bin/X'
84adb8
 endif
84adb8
 xdmcp_dep = cc.find_library('Xdmcp', required: get_option('xdmcp'))
84adb8
 if xdmcp_dep.found() and get_option('tcp-wrappers')
84adb8
   libwrap_dep = cc.find_library('wrap')
84adb8
 endif
84adb8
 # systemd
84adb8
 systemd_dep = dependency('systemd')
84adb8
 libsystemd_dep = dependency('libsystemd')
84adb8
 if meson.version().version_compare('>= 0.53')
84adb8
   systemd_multiseat_x = find_program('systemd-multi-seat-x',
84adb8
     required: false,
84adb8
     dirs: [
84adb8
@@ -197,60 +200,61 @@ conf.set_quoted('SYSCONFDIR', gdm_prefix / get_option('sysconfdir'))
84adb8
 conf.set_quoted('BINDIR', gdm_prefix / get_option('bindir'))
84adb8
 conf.set_quoted('LIBDIR', gdm_prefix / get_option('libdir'))
84adb8
 conf.set_quoted('LIBEXECDIR', gdm_prefix / get_option('libexecdir'))
84adb8
 conf.set_quoted('LOGDIR', get_option('log-dir'))
84adb8
 conf.set_quoted('DMCONFDIR', dmconfdir)
84adb8
 conf.set_quoted('GDMCONFDIR', gdmconfdir)
84adb8
 conf.set_quoted('GDM_SCREENSHOT_DIR', gdm_screenshot_dir)
84adb8
 conf.set_quoted('GDM_XAUTH_DIR', gdm_xauth_dir)
84adb8
 conf.set_quoted('GDM_RAN_ONCE_MARKER_DIR', ran_once_marker_dir)
84adb8
 conf.set_quoted('GDM_RUN_DIR', gdm_run_dir)
84adb8
 conf.set_quoted('GNOMELOCALEDIR', gdm_prefix / get_option('localedir'))
84adb8
 conf.set_quoted('AT_SPI_REGISTRYD_DIR', at_spi_registryd_dir)
84adb8
 conf.set_quoted('GDM_PID_FILE', gdm_pid_file)
84adb8
 conf.set_quoted('GNOME_SETTINGS_DAEMON_DIR', gnome_settings_daemon_dir)
84adb8
 conf.set_quoted('LANG_CONFIG_FILE', lang_config_file)
84adb8
 conf.set('HAVE_ADT', have_adt)
84adb8
 conf.set('HAVE_UTMP_H', have_utmp_header)
84adb8
 conf.set('HAVE_UTMPX_H', have_utmpx_header)
84adb8
 conf.set('HAVE_POSIX_GETPWNAM_R', have_posix_getpwnam_r)
84adb8
 conf.set('UTMP', utmp_struct)
84adb8
 conf.set('HAVE_GETUTXENT', cc.has_function('getutxent'))
84adb8
 conf.set('HAVE_UPDWTMP', cc.has_function('updwtmp'))
84adb8
 conf.set('HAVE_UPDWTMPX', cc.has_function('updwtmpx'))
84adb8
 conf.set('HAVE_LOGIN', cc.has_function('login', args: '-lutil'))
84adb8
 conf.set('HAVE_LOGOUT', cc.has_function('logout', args: '-lutil'))
84adb8
 conf.set('HAVE_LOGWTMP', cc.has_function('logwtmp', args: '-lutil'))
84adb8
 conf.set('HAVE_PAM_SYSLOG', have_pam_syslog)
84adb8
 conf.set('HAVE_KEYUTILS', keyutils_dep.found())
84adb8
 conf.set('SUPPORTS_PAM_EXTENSIONS', pam_extensions_supported)
84adb8
 conf.set('HAVE_SELINUX', libselinux_dep.found())
84adb8
+conf.set('HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY', xserver_nolisten_default)
84adb8
 conf.set('ENABLE_USER_DISPLAY_SERVER', get_option('user-display-server'))
84adb8
 conf.set('ENABLE_SYSTEMD_JOURNAL', get_option('systemd-journal'))
84adb8
 conf.set('ENABLE_WAYLAND_SUPPORT', get_option('wayland-support'))
84adb8
 conf.set('ENABLE_PROFILING', get_option('profiling'))
84adb8
 conf.set('GDM_INITIAL_VT', get_option('initial-vt'))
84adb8
 conf.set_quoted('GDM_DEFAULTS_CONF', gdm_defaults_conf)
84adb8
 conf.set_quoted('GDM_CUSTOM_CONF', gdm_custom_conf)
84adb8
 conf.set_quoted('GDM_RUNTIME_CONF', gdm_runtime_conf)
84adb8
 conf.set_quoted('GDM_SESSION_DEFAULT_PATH', get_option('default-path'))
84adb8
 conf.set_quoted('GDM_USERNAME', get_option('user'))
84adb8
 conf.set_quoted('GDM_GROUPNAME', get_option('group'))
84adb8
 conf.set('HAVE_LIBXDMCP', xdmcp_dep.found())
84adb8
 conf.set_quoted('SYSTEMD_X_SERVER', systemd_x_server)
84adb8
 conf.set('WITH_PLYMOUTH', plymouth_dep.found())
84adb8
 conf.set_quoted('X_SERVER', x_bin)
84adb8
 conf.set_quoted('X_PATH', x_path)
84adb8
 conf.set('HAVE_UT_UT_HOST', utmp_has_host_field)
84adb8
 conf.set('HAVE_UT_UT_PID', utmp_has_pid_field)
84adb8
 conf.set('HAVE_UT_UT_ID', utmp_has_id_field)
84adb8
 conf.set('HAVE_UT_UT_NAME', utmp_has_name_field)
84adb8
 conf.set('HAVE_UT_UT_TYPE', utmp_has_type_field)
84adb8
 conf.set('HAVE_UT_UT_EXIT_E_TERMINATION', utmp_has_exit_e_termination_field)
84adb8
 conf.set('HAVE_UT_UT_USER', utmp_has_user_field)
84adb8
 conf.set('HAVE_UT_UT_TIME', utmp_has_time_field)
84adb8
 conf.set('HAVE_UT_UT_TV', utmp_has_tv_field)
84adb8
 conf.set('HAVE_UT_UT_SYSLEN', utmp_has_syslen_field)
84adb8
 conf.set('ENABLE_IPV6', get_option('ipv6'))
84adb8
 configure_file(output: 'config.h', configuration: conf)
84adb8
 
84adb8
 # Subdirs
84adb8
-- 
84adb8
2.34.1
84adb8