milgra / sov

An overlay that shows schemas for all workspaces to make navigation in sway easier.
GNU General Public License v3.0
325 stars 14 forks source link

Add compilation flag to overwrite default `/etc` `/usr` paths #19

Closed simoneruffini closed 2 years ago

simoneruffini commented 2 years ago

For distros like NixOS that "sandbox" applications it is helpful to be able to overwrite the default path where SOV will read default cofigurations or other hardcoded files. For now the problem is resolved via a patch applied before the buildling phase of the package (see patch of @TravisDavis-ops here ) but this is not the best way of handling this in my opinion.
Instead a solution like this one is more appropriate.

I the next days I'll take a look at the repo to see if I can issue a PR but I never had experience with meson/ninja so I will not promise anything.

eli-schwartz commented 2 years ago

https://github.com/milgra/sov/blob/e57a84f367058024d36127f2e703da5e9489659d/src/sov/main.c#L36

The /usr/share should be replaced by a macro defined in meson.build as e.g.


add_project_arguments(
    '-DPACKAGE_DATADIR=' + join_paths(get_option('prefix'), get_option('datadir')),
    language: 'c',
)
milgra commented 2 years ago

Thanks, I will add it to the next version.

milgra commented 2 years ago

It's done in 0.72