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.
This reverts commit c778945806.
I believe this is exactly what brings the staging branch into
the right shape after the last merge from master (through staging-next);
otherwise part of staging changes would be lost
(due to being already reachable from master but reverted).
Meson allows projects to set `build_rpath` property, containing paths
that will be added during build but will be removed when installing.
When Meson removes build_rpath from `DT_RUNPATH` entry, it just writes
the shorter ␀-terminated new rpath over the old one to reduce
the risk of potentially breaking the ELF files
(when the linker does string de-duplication or something).
But this can cause much bigger problem for Nix, as it can produce
cut-in-half-by-␀ store path references.
For example, in systemd’s libudev, it was removing three `$ORIGIN`-relative paths from
$ORIGIN/../libsystemd:$ORIGIN/../basic:$ORIGIN/../shared:…␀
resulting in the following `DT_RUNPATH` entry:
…␀store/v589pqjhvxrj73g3r0xb41yr84z5pwb7-gcc-9.3.0-lib/lib␀
We previously handled this in `fix-rpath.patch` but the method we prevent
Meson from removing paths added to rpath through `NIX_LDFLAGS` was changed
during 0.55.0 update and I forgot about this second purpose of the patch.
Let’s re-add this clearing code, as it worked without issues for a long time.
The old `CC=.. CXX= .. meson ...` env var hack I removed in
3c00ca03a2 had a side effect of ensuring
that Meson always had access to a native C compiler, which unforunately
it expects in most cases. Thankfully, that will be fixed soon.
The cross file is added in the `mkDerivation`. It isn't nice putting
build tool-specific stuff here, but our current architecture gives us
little alternative.
See comment in code and the PR it references,
https://github.com/mesonbuild/meson/pull/6827, for details.
We can remove entries from the cross file because they will be gotten
from env vars now.
As documented, it should be `aarch64` for AArch64.
* https://mesonbuild.com/Reference-tables.html#cpu-families
```
$ nix eval '((import <nixpkgs> {}).pkgsCross.aarch64-multiplatform.stdenv.targetPlatform.parsed.cpu.family)'
"arm"
```
The lookup table will ensure that, at any point, meson does not pick the
wrong family.