5d4eeb09309eb073235fec1418bc988306c99c98.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From 5d4eeb09309eb073235fec1418bc988306c99c98 Mon Sep 17 00:00:00 2001
  2. From: Eli Schwartz <eschwartz93@gmail.com>
  3. Date: Tue, 21 Jun 2022 22:03:15 -0400
  4. Subject: [PATCH] meson: fix installation of symlinks
  5. Fixes regression in commit 5aa5fab4348de4496efe9ec0b5faa20be234d56e. The
  6. created symlinks always considered the directory to be installed to, and
  7. created absolute symlinks pointing from the source to the destination.
  8. This is wrong, because while the source needs to be installed *into* the
  9. directory to be installed to, the destination needs to not include the
  10. $DESTDIR.
  11. There are also some sub-optimal design points around scripting the
  12. install prefix. Particularly, Meson has a dedicated variable for the
  13. combination of DESTDIR + prefix, so use that instead of manually slicing
  14. up the prefix so that `os.path.join` won't drop the DESTDIR. The other
  15. solution would be to acknowledge that DESTDIR (at least on non-Windows
  16. systems) uses string concatenation, not path-joining semantics, but...
  17. Meson already supplies this pre-done, so why bother?
  18. Fixes #285
  19. ---
  20. install-scripts/desktop-file-links.py | 13 ++++---------
  21. 1 file changed, 4 insertions(+), 9 deletions(-)
  22. diff --git a/install-scripts/desktop-file-links.py b/install-scripts/desktop-file-links.py
  23. index 6120b98..fdcd47c 100755
  24. --- a/install-scripts/desktop-file-links.py
  25. +++ b/install-scripts/desktop-file-links.py
  26. @@ -4,16 +4,11 @@
  27. import subprocess
  28. # Symlinks desktop files to c-c-c's panel dir so the cinnamon-control-center binary can find the plugins.
  29. -dest = os.environ.get('DESTDIR')
  30. +destdir_prefix = os.environ.get('MESON_INSTALL_DESTDIR_PREFIX')
  31. prefix = os.environ.get('MESON_INSTALL_PREFIX')
  32. -if dest:
  33. - root = dest
  34. -else:
  35. - root = "/"
  36. -
  37. -source_location = os.path.join(root, prefix[1:], "share", "applications")
  38. -target_location = os.path.join(root, prefix[1:], "share", "cinnamon-control-center", "panels")
  39. +source_location = os.path.join(prefix, "share", "applications")
  40. +target_location = os.path.join(destdir_prefix, "share", "cinnamon-control-center", "panels")
  41. links = [
  42. "cinnamon-color-panel.desktop",
  43. @@ -32,4 +27,4 @@
  44. subprocess.call(['ln', '-s', orig_path, link_path])
  45. -exit(0)
  46. \ No newline at end of file
  47. +exit(0)