[gnome-session] meson: Do not use a post_install workaround to install wayland-session



commit 1da09ac5bb5099e9a43cad9b8e98022f27c533c3
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Wed Feb 10 16:26:13 2021 +0100

    meson: Do not use a post_install workaround to install wayland-session

 data/meson.build      | 18 ++++++++----------
 meson_post_install.py |  9 ---------
 2 files changed, 8 insertions(+), 19 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index e02b80d3..d3d00fc1 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -47,16 +47,6 @@ foreach name: desktops
   )
 
   install_dir = join_paths(session_datadir, 'xsessions')
-  # FIXME: The same target can not be copied into two directories.
-  #        There is a workaround in meson_post_install.py until proper solution arises:
-  #        https://groups.google.com/forum/#!topic/mesonbuild/3iIoYPrN4P0
-  if name == desktop_plain
-    #install_dir: [
-    #  join_paths(session_datadir, 'xsessions'),
-    #  join_paths(session_datadir, 'wayland-sessions')
-    #]
-  endif
-
   desktop_target = i18n.merge_file(
     desktop,
     type: 'desktop',
@@ -66,6 +56,14 @@ foreach name: desktops
     install: true,
     install_dir: install_dir
   )
+
+  if name == desktop_plain
+    # We can't install the same target in two locations, however at install
+    # phase we've already generated the file (happening during configuration)
+    # so we can be confident in installing the built file directly.
+    install_data(files(meson.current_build_dir() / desktop),
+      install_dir: session_datadir / 'wayland-sessions')
+  endif
 endforeach
 
 sessions = [
diff --git a/meson_post_install.py b/meson_post_install.py
index e2e352cc..912ebfaa 100644
--- a/meson_post_install.py
+++ b/meson_post_install.py
@@ -15,12 +15,3 @@ if not os.environ.get('DESTDIR'):
   print('Compile gsettings schemas...')
   subprocess.call(['glib-compile-schemas', schemadir])
 
-# FIXME: this is due to unable to copy a generated target file:
-#        https://groups.google.com/forum/#!topic/mesonbuild/3iIoYPrN4P0
-dst_dir = os.path.join(install_root, 'wayland-sessions')
-if not os.path.exists(dst_dir):
-  os.makedirs(dst_dir)
-
-src = os.path.join(install_root, 'xsessions', 'gnome.desktop')
-dst = os.path.join(dst_dir, 'gnome.desktop')
-shutil.copyfile(src, dst)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]