Skip to content

meson: add option to skip installing to $sysconfdir#17580

Merged
keszybz merged 1 commit intosystemd:masterfrom
Mic92:no-sysconfdir
Nov 12, 2020
Merged

meson: add option to skip installing to $sysconfdir#17580
keszybz merged 1 commit intosystemd:masterfrom
Mic92:no-sysconfdir

Conversation

@Mic92
Copy link
Copy Markdown
Contributor

@Mic92 Mic92 commented Nov 12, 2020

This is useful for development where overwriting files out side
the configured prefix will affect the host as well as stateless
systems such as NixOS that don't let packages install to /etc but handle
configuration on their own.

Alternative to #17501

tested with:

$ mkdir inst build && cd build
$ meson
-Dcreate-log-dirs=false
-Dsysvrcnd-path=$(realpath ../inst)/etc/rc.d
-Dsysvinit-path=$(realpath ../inst)/etc/init.d
-Drootprefix=$(realpath ../inst)
-Dinstall-sysconfdir=false
--prefix=$(realpath ../inst) ..
$ ninja install

This is useful for development where overwriting files out side
the configured prefix will affect the host as well as stateless
systems such as NixOS that don't let packages install to /etc but handle
configuration on their own.

Alternative to systemd#17501

tested with:

$ mkdir inst build && cd build
$ meson \
  -Dcreate-log-dirs=false \
  -Dsysvrcnd-path=$(realpath ../inst)/etc/rc.d \
  -Dsysvinit-path=$(realpath ../inst)/etc/init.d \
  -Drootprefix=$(realpath ../inst) \
  -Dinstall-sysconfdir=false \
  --prefix=$(realpath ../inst) ..
$ ninja install
Copy link
Copy Markdown
Member

@keszybz keszybz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

input : file + '.in',
output : file,
configuration : substs,
install_dir : dir == 'no' ? '' : dir)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd maybe prefer to fold the condition into install_dir here, something like:

install_dir = (install_sysconfdir or dir != pkgsysconfdir) and dir != 'no' ? dir : ''
cofnigure_file(
     ...
     install_dir : install_dir)

but current version is also OK.

@keszybz keszybz merged commit d7aa78c into systemd:master Nov 12, 2020
@Mic92 Mic92 deleted the no-sysconfdir branch November 12, 2020 10:25
@Mic92 Mic92 mentioned this pull request Nov 14, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants