Let’s point `DESTDIR` to a path under the build directory rather than under "$out".
This will prevent `installPhase` from creating `$out` or any other output directory,
allowing us to install the outputs just by moving them out of `$DESTDIR` directly into the store with `mv`.
Of course, that will also require moving the installing of `etc` and `var` after the outputs are installed
and ensuring there is no library litter from `checkPhase`.
Since `$out` does not currently contain `var` subdirectory, we can also just move `$DESTDIR/var` directly to `$out` rather than copying it.
`$out/etc` does exist but we can just merge it with `cp --recursive` instead of `rsync` so `rsync` is not actually necessary.
The code remains written defensively against files accidentally being misplaced while shuffling them around – parent directories of targets are used as `mv` destinations so that the move fails loudly if the directory already exists, rather than being moved inside as e.g. `$out/etc/etc`.
While at it let’s also improve practices a bit:
- Add vertical space and clearer comments.
- Handle non-standard Nix store paths.
This makes gsettings-desktop-schemas, harfbuzz, json-glib, and
libsecret buildable statically, and is still the right thing to do
everywhere else even where it's not a complete fix.
- Switch to `finalAttrs` pattern.
- Move `DESTDIR` into `env`.
- Use `lib.optionals` for patches and move the comment inside, in preparation for more patches.
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
continuation of #109595
pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.
python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
In the process of making UPower.conf customizable (#73968), it came up
that UPower doesn't load its config from /etc by default.
The UPower derivation is modified to make it load its config from /etc
at runtime, but still install the default config to its nix store path
as before.
The UPower module is modified to put the config in /etc.
* correct inputs
* drop dbus-glib
Has not been needed for a very long
time.
* intltool -> gettext
* add optional libimobiledevice
* propagate glib
It's in Requires
* dev output
* drop useSystemd