In preparation for the deprecation of `stdenv.isX`.
These shorthands are not conducive to cross-compilation because they
hide the platforms.
Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way
One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059
There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.
```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
Mesa is a package like any other. There's no reason for it to be a
special case with its platforms listed in lib, because if other
packages want to refer to mesa's platforms, they can access the
platforms from the package meta like they would for any other package.
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
stdenv.targetPlatform really shouldn't be used by software that
doesn't generate or manipulate binaries. I reviewed all uses of
targetPlatform outside of pkgs/development/compilers and pkgs/stdenv
and replaced those which weren't involved in something which fits
these criteria.
On `nixpkgs` SDL2 explicitly bulds RUNPATHs from it's subset of build
inputs. As a result RUNPATH contains more than needed. This change
repomed from RUNPATH packages that don't contain libraries but contain
developer-only files:
- wayland-protocols: xml files to describe protocols
- xorgproto: header files for X11
The change moves them to buildInputs / propagatedBuildInputs.
Before the change closure size is:
$ nix path-info -rsSh $(nix-build -A SDL2) | nl
221 /nix/store/...-SDL2-2.26.4 2.5M 546.5M
After the change:
$ nix path-info -rsSh $(nix-build -A SDL2) | nl
219 /nix/store/...-SDL2-2.26.4 2.5M 544.4M
SDL2 supports both fcitx 4 and fcitx 5 though the dbus interface,
and the dependency on fcitx headers has been removed in favor of
hardcoding the constants.
Reference: https://github.com/libsdl-org/SDL/issues/3653