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"
```
package-build is also in MELPA. Currently, two packages depend on
it. When building such a package, package-build is added to
EMACSLOADPATH by the setup hook. Previously, package-initialize is
called in the buildPhase of melpaBuild, which may cause package-build
from MELPA to be used instead of the pinned one depending on the
entries of EMACSLOADPATH.
This patch removes the unneeded package-initialize to make sure the
pinned package-build is used.
Accidentally, this patch reduces build time of emacsPackages from 30
minutes to 24 minutes on my machine.
Previously, trivialBuild did not know how to find its elisp
dependencies. This was[1] fixed[2] by basically rewriting part of
package-activate-all in bash.
I think it is better to call package-activate-all (or
package-initialize if Emacs is old) directly. It reduces maintenance
burden a bit. It also improves consistency since elpaBuild and
melpaBuild already do so.
This change provides almost the same functionality as before. It only
breaks elisp packages with non-standard[^3] elisp dependencies.
However, I think those non-standard ones should be fixed instead.
As an example, mu4e used to be a non-standard one and was fixed[4].
This change does not cause more build failures in emacsPackages.
[1]: https://github.com/NixOS/nixpkgs/pull/82604
[2]: bf486f784d
[^3]: Non-standard elisp packages do not meet requirements of
package.el, the builtin package manager of Emacs. Usually, they are
installed to $out/share/emacs/site-lisp/$pname-$version and/or miss a
$pname-pkg.el file.
[4]: https://github.com/NixOS/nixpkgs/pull/253438