aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-06-16 22:39:19 +0200
committerRobert Tari <robert@tari.in>2021-06-16 22:39:19 +0200
commit4b6ef9d6039078d5ff24ed7e3dd642e2b6faa9fc (patch)
tree30aae3e289ef288f61843ea843b2b365733576c0
parent10381c0b9bb5784b1029a890758049986b7e87ce (diff)
parent85e6e455ad25f9154411bf1354f99d56eddcc045 (diff)
downloadlibayatana-common-4b6ef9d6039078d5ff24ed7e3dd642e2b6faa9fc.tar.gz
libayatana-common-4b6ef9d6039078d5ff24ed7e3dd642e2b6faa9fc.tar.bz2
libayatana-common-4b6ef9d6039078d5ff24ed7e3dd642e2b6faa9fc.zip
Merge branch 'sunweaver-pr/systemd-earlier-than-247'
Attributes GH PR #28: https://github.com/AyatanaIndicators/libayatana-common/pull/28
-rw-r--r--data/CMakeLists.txt20
1 files changed, 19 insertions, 1 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index 2949f15..875cb94 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -11,7 +11,25 @@ pkg_check_modules(SYSTEMD systemd)
if (${SYSTEMD_FOUND})
if (${SYSTEMD_VERSION} VERSION_LESS 247)
- set(SYSTEMD_USER_UNIT_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/systemd/user")
+
+ # This bit now becomes really hacky-whacky...
+
+ # As systemd is a build-requirement, there should be the
+ # systemd unit directory available on the build host, so
+ # let's look for that...
+
+ if (EXISTS "/usr/lib/systemd/user")
+ # Let's try /usr/lib/ ...
+ set(SYSTEMD_USER_UNIT_DIR "/usr/lib/systemd/user")
+ elseif (EXISTS "/usr/lib64/systemd/user")
+ # Let's try /usr/lib64/ ...
+ set(SYSTEMD_USER_UNIT_DIR "/usr/lib64/systemd/user")
+ else()
+ # Fallback to something that fails on Debian and Ubuntu
+ # but might work on other distributions...
+ set(SYSTEMD_USER_UNIT_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/systemd/user")
+ endif()
+
else()
pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemd_user_unit_dir)
endif()