Fix systemd unit install directory#56
Merged
fufexan merged 1 commit intohyprwm:mainfrom Aug 24, 2025
peppapig450:correct-systemd-unit-install-dir
Merged
Fix systemd unit install directory#56fufexan merged 1 commit intohyprwm:mainfrom peppapig450:correct-systemd-unit-install-dir
fufexan merged 1 commit intohyprwm:mainfrom
peppapig450:correct-systemd-unit-install-dir
Conversation
Installing to ${CMAKE_INSTALL_LIBDIR}/systemd/user can end up in
/usr/lib64/systemd/user on multilib systems, which systemd does not
search. Use pkg-config's systemduserunitdir instead (with a fallback
to /usr/lib/systemd/user) so the unit is always installed in the
correct location.
fufexan
approved these changes
Aug 24, 2025
Member
fufexan
left a comment
There was a problem hiding this comment.
LGTM! I like the extra configurable variable, we should use it in other hyprapps' CMakeLists.
Contributor
Author
|
Glad you like it! I can go ahead and open PRs to add this to the other Hyprapps’ CMakeLists as well if that works. |
Member
|
Would be nice if you have the time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the installation path of the
hyprsunset.servicesystemd user unit. Previously the build used:This relies on
${CMAKE_INSTALL_LIBDIR}, which on multilib systems expands tolib64. However, systemd does not look in/usr/lib64/systemd/userfor user units. It only searches/usr/lib/systemd/user. This means the installed unit file would not be picked up by systemd on such systems.This is demonstrated when building hyprsunset on Gentoo here:
attached build.log
The Fix
Instead of guessing the correct path,This PR uses the value provided by systemd’s
pkg-configfile, with a fallback to${CMAKE_INSTALL_PREFIX}/lib/systemd/userif the variable is unavailable, which is the recommended approach upstream:If you'd like me to tweak the commit message, provide further build logs, adjust style or do anything differently just let me know!