[network-manager-applet] meson: make post_install work with DESTDIR



commit 8b4c3b02574da9ab97fadb21a2708fe32cb50a93
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Mon Oct 16 11:56:50 2017 +0200

    meson: make post_install work with DESTDIR

 meson_post_install.py |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/meson_post_install.py b/meson_post_install.py
index c1e6a54..f5f4255 100644
--- a/meson_post_install.py
+++ b/meson_post_install.py
@@ -10,12 +10,14 @@ 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(sys.argv[2], 'xdg', 'autostart')
-  if not os.path.exists(dst_dir):
-    os.makedirs(dst_dir)
-
-  src = os.path.join(sys.argv[1], 'applications', 'nm-applet.desktop')
-  dst = os.path.join(dst_dir, 'nm-applet.desktop')
-  shutil.copyfile(src, dst)
+# 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(sys.argv[2], 'xdg', 'autostart')
+src = os.path.join(sys.argv[1], 'applications', 'nm-applet.desktop')
+if os.environ.get('DESTDIR'):
+  dst_dir = os.environ.get('DESTDIR') + os.path.join(os.getcwd(), dst_dir)
+  src = os.environ.get('DESTDIR') + os.path.join(os.getcwd(), src)
+if not os.path.exists(dst_dir):
+  os.makedirs(dst_dir)
+dst = os.path.join(dst_dir, 'nm-applet.desktop')
+shutil.copyfile(src, dst)


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