Deprecate haskell.lib{,.compose}.generateOptparseApplicativeCompletion*
in favor of the newly added
haskell.packages.*.generateOptparseApplicativeCompletions (plural!)
which takes into account whether we are cross-compiling or not. If we
are, generating completions is disabled, since we can't execute software
built for a different platform.
The move is necessary, so we can receive the /same/ stdenv as the
package we are overriding in order to accurately check whether we can
execute produced binaries.
Resolves#174040.
Resolves#49648.
release-lib.nix's packagePlatforms will (understandably) take
hydraPlatforms at face value, so we need to make sure that we don't slip
anything actually unsupported in there.
This reflects the default value set in generic-builder.nix, following
the reasoning that GHC can cross-compile and we assume that packages are
generally portable.
1. Putting the string on one line (instead of using a multiline
string) means it is not ended with \n, which means if somebody wants
to append more lines, they have to start it with \n or it will get
concatenated to the `postFixup` here, so add \n.
2. Previously, ignoring `drv.postFixup` would throw away any
`postFixup`s set in `drv`, which is not something we want.
The extra empty line is a cute trick to prevent concatenating the code
with any previous `postFixup` that doesn’t end in \n.