linuxmint / cinnamon-settings-daemon

The settings daemon for the Cinnamon desktop
GNU General Public License v2.0
57 stars 58 forks source link

build: don't hardcode files install dir as / #378

Closed bobby285271 closed 1 year ago

bobby285271 commented 1 year ago

In NixOS packages are installed to their own separate prefix (i.e. /nix/store/3srl963wzvfm3q3mnbnvrgz34yd93y7q-cinnamon-settings-daemon-5.6.1/share/icons/hicolor instead of /usr/share/icons/hicolor), we don't have permission to write things to / in build time (we actually don't have /usr/share) :disappointed:

[0/1] Installing files.
Installing subdir /build/source/files to /
Installation failed due to insufficient permissions.
Attempting to use polkit to gain elevated privileges...
pkexec must be setuid root
FAILED: meson-internal__install
/nix/store/754p0izaawcr1v28i0k3xbbj2r3m27n2-meson-0.64.1/bin/meson install --no-rebuild
ninja: build stopped: subcommand failed.

https://github.com/NixOS/nixpkgs/blob/4106c75/pkgs/desktops/cinnamon/cinnamon-settings-daemon/use-sane-install-dir.patch

(Yeah we are also carrying the same patch for cinnamon, but it should be fine to upstream the cinnamon-settings-daemon one first since only some icons are included in files here and no else paths are hardcoded)

mtwebster commented 1 year ago

I was looking at this: https://github.com/NixOS/nixpkgs/blob/master/pkgs/desktops/cinnamon/cinnamon-common/use-sane-install-dir.patch

I can't apply it directly to Cinnamon because we don't install etc to the install prefix. Maybe an additional meson_options entry to specify a root folder or something along those lines...?

bobby285271 commented 1 year ago

It looks like only one file needs to be installed to etc right now etc/xdg/menus/cinnamon-applications.menu, for this one get_option('sysconfdir') should work for us (just browsed through some examples in GNOME).

bobby285271 commented 1 year ago

an additional meson_options entry to specify a root folder

If you mean

 install_subdir(
     'files',
-    install_dir: '/',
+    install_dir: get_option('customrootdir')
     strip_directory: true,
 )

This probably won't work for us unfortunately since we install the datadir stuff to /nix/store/xxxxx-cinnamon-common-5.6.7/share and not /nix/store/xxxxx-cinnamon-common-5.6.7/usr/share