Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile.am: allow manually installing config files #1782

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

vs49688
Copy link

@vs49688 vs49688 commented Jan 2, 2024

Mostly to help with packaging in NixOS.

In NixOS, we set --prefix=/nix/store/xxxxxx/. However, we also have to use --without-configfiles, lest the Makefile attempts to install the config files and friends to /etc (which is a complete no-go).

Specifying DESTDIR=/nix/store/xxxxxx/ when using --prefix=/nix/store/xxxxxx/ causes the config files to be put in the right place, but the binaries will be at $DESTDIR/$PREFIX (in this case /nix/store/xxxxxx/nix/store/xxxxxx).

This PR adds a separate install-config-files Makefile target that installs the config files and dbus policies to DESTDIR=, regardless of whether --with{,out}-configfiles is specified. This target exists unconditionally.

To keep the existing make install behaviour, install-exec-hook is changed to depend on install-config-files only if INSTALL_CONFIG_FILES is set.

In effect, this allows us to use:

./configure --prefix=/nix/store/xxxxxx --without-config-files
make
make install

make DESTDIR=/nix/store/xxxxxx install-config-files

For context: NixOS/nixpkgs#276693

@vs49688
Copy link
Author

vs49688 commented Jan 2, 2024

Btw, my knowledge of autotools is antiquated, so I'm all-ears if there's a better way of doing this.

@mikebrady
Copy link
Owner

Thanks for this PR. Unfortunately, I'm away from my computers until the end of January, but I'll take a look at merging it then.

@mikebrady
Copy link
Owner

mikebrady commented Jan 28, 2024

Hi there. Back at the coalface now. Would you be kind enough to set this up for the development branch instead of the master branch. We can merge in into there much more easily. It's probably easier just to withdraw the PR and make up a new one but based on the development branch...

@vs49688 vs49688 marked this pull request as draft January 28, 2024 16:32
@vs49688 vs49688 changed the base branch from master to development January 28, 2024 16:32
Adds a "install-config-files" Makefile target that installs the config
files and dbus policies to DESTDIR=, regardless of whether
--with{,out}-configfiles is specified.
@vs49688 vs49688 marked this pull request as ready for review January 28, 2024 16:34
@vs49688
Copy link
Author

vs49688 commented Jan 28, 2024

Hi there. Back at the coalface now. Would you be kind enough to set this up for the development branch instead of the master branch. We can merge in into there much more easily. It's probably easier just to withdraw the PR and make up a new one but based on the development branch...

Done, rebased and retargeted to development.

@mikebrady
Copy link
Owner

Many thanks for this -- let's try it out!

@mikebrady mikebrady merged commit b80d072 into mikebrady:development Jan 29, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants