nixpkgs/pkgs/os-specific/linux/upower
Jan Tojnar 8ef5fcf4f5 upower: Simplify DESTDIR hack
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.
2023-11-19 18:45:00 +01:00
..
default.nix upower: Simplify DESTDIR hack 2023-11-19 18:45:00 +01:00
i686-test-remove-battery-check.patch
installed-tests-path.patch upower: Add installed tests 2023-07-13 19:12:22 +02:00