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"
```
When specifying the `builder` attribute in `stdenv.mkDerivation`, this
will be effectively transformed into
builtins.derivation {
builder = stdenv.shell;
args = [ "-e" builder ];
}
This also means that `default-builder.sh` is never sourced and as a
result it's not guaranteed that `$NIX_ATTRS_SH_FILE` is set to a correct
location[1].
Also, we need to source `.attrs.sh` to source `$stdenv`. So, the
following is done now:
* If `$NIX_ATTRS_SH_FILE` points to a correct location, then use it.
Directly using `.attrs.sh` is problematic for `nix-shell(1)` usage
(see previous commit for more context), so prefer the environment
variable if possible.
* Otherwise, if `.attrs.sh` exists, then use it. See [1] for when this
can happen.
* If neither applies, it can be assumed that `__structuredAttrs` is
turned off and thus nothing needs to be done.
[1] It's possible that it doesn't exist at all - in case of Nix 2.3 or
it can point to a wrong location on older Nix versions with a bug in
`__structuredAttrs`.
There was no 3.1 for some reason. The old sed-based path patching was
broken and resulted in syntax errors since it was a bit over-eager.
Instead of fixing it, I decided to replace it with a patch file which is
easier to inspect and will fail in a more obvious way next time.
The patch is now applied unconditionally, since it actually applies to
all linux platforms. The changes are localized to linux-specific code,
so it does not hurt to apply it on non-linux platforms as well.
Hedgewars needs a small fix to work with the new version. Done in the
same commit to avoid a broken commit.
This package was written more than a decade ago; this commit updates the layout
to be more conventional without making any meaningful changes. Note that because
it now has a version attribute in the derivation this does change the hash.
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools.
This update was made based on information from https://repology.org/metapackage/lazarus/versions.
These checks were done:
- built on NixOS
- Warning: no invocation of /nix/store/4z8g46k0hjnys0cpbx5r41z55fb77495-lazarus-1.8.4/bin/lazarus-ide had a zero exit code or showed the expected version
- /nix/store/4z8g46k0hjnys0cpbx5r41z55fb77495-lazarus-1.8.4/bin/lazbuild passed the binary check.
- /nix/store/4z8g46k0hjnys0cpbx5r41z55fb77495-lazarus-1.8.4/bin/lazres passed the binary check.
- Warning: no invocation of /nix/store/4z8g46k0hjnys0cpbx5r41z55fb77495-lazarus-1.8.4/bin/lrstolfm had a zero exit code or showed the expected version
- /nix/store/4z8g46k0hjnys0cpbx5r41z55fb77495-lazarus-1.8.4/bin/updatepofiles passed the binary check.
- Warning: no invocation of /nix/store/4z8g46k0hjnys0cpbx5r41z55fb77495-lazarus-1.8.4/bin/.startlazarus-wrapped had a zero exit code or showed the expected version
- Warning: no invocation of /nix/store/4z8g46k0hjnys0cpbx5r41z55fb77495-lazarus-1.8.4/bin/startlazarus had a zero exit code or showed the expected version
- 3 of 7 passed binary check by having a zero exit code.
- 1 of 7 passed binary check by having the new version present in output.
- found 1.8.4 with grep in /nix/store/4z8g46k0hjnys0cpbx5r41z55fb77495-lazarus-1.8.4
- directory tree listing: https://gist.github.com/5e07a7e98c27e3576c3b8ca055b8df48
- du listing: https://gist.github.com/001bda09b55e3f3c8178f9ffd4b3ee95
Semi-automatic update generated by https://github.com/ryantm/nix-update tools. These checks were done:
- built on NixOS
- Warning: no binary found that responded to help or version flags. (This warning appears even if the package isn't expected to have binaries.)
- found 1.8.2 with grep in /nix/store/z3r30kr064x672zqnrs1pwzshlvgnv9n-lazarus-1.8.2
- found 1.8.2 in filename of file in /nix/store/z3r30kr064x672zqnrs1pwzshlvgnv9n-lazarus-1.8.2
- directory tree listing: https://gist.github.com/895d2d01174298ff36a30bc7387286a2