We are migrating packages that meet below requirements:
1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration
The tool is here: https://github.com/Aleksanaa/by-name-migrate.
sed -i 's/ webkitgtk\b/ webkitgtk_4_0/g' pkgs/**.nix
sed -i 's/(webkitgtk\b/(webkitgtk_4_0/g' pkgs/**.nix
sed -i 's/\.webkitgtk\b/.webkitgtk_4_0/g' pkgs/**.nix
webkitgtk is currently pointing to that specific ABI version but the
alias is going to start warning
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"
```
Reproduction script:
# Bulk rewrite
./maintainers/scripts/sha-to-sri.py pkgs/by-name
# Revert some packages which will need manual intervention
for n in amdvlk azure-cli cargo-profiler corefonts flatito fluxcd gist perf_data_converter protoc-gen-js solana-cli swt verible; do
git checkout -- "pkgs/by-name/${n:0:2}/${n}"
done
Shapely 1.8 is old unmaintained. We originally had to introduce it to nixpkgs in
order to package kikit, but recently kikit upstream dropped the
requirement to use an old version of shapely
(https://github.com/yaqwsx/KiKit/issues/574#issuecomment-1879721181).
Upstream relaxed the version constraint in
3427a8d6ce,
which first landed in kikit 1.5.0, which we're already packaging, so
we're free to drop shapely 1.8!
This includes support for KiCad 8 (see complete changelog
[here](https://github.com/yaqwsx/KiKit/releases/tag/v1.5.0)), which should unblock
https://github.com/NixOS/nixpkgs/pull/291134.
With this upgrade, a test started failing:
$ nix build .#kikit
...
kikit> not ok 40 Steel stencils
kikit> # (in test file /build/source/test/system/stencil.bats, line 6)
kikit> # `kikit stencil create --jigsize 60 60 $RES/conn.kicad_pcb steelStencil' failed
kikit> # 04:32:16: Error: Directory '/homeless-shelter' couldn't be created (error 13: Permission denied)
kikit> # An error occurred: OpenSCAD is not available.
kikit> # Did you install it? Program `openscad` has to be in PATH
kikit> # No output files produced
kikit> not ok 41 Steel stencils with cutout
kikit> # (in test file /build/source/test/system/stencil.bats, line 10)
kikit> # `kikit stencil create --jigsize 60 60 --cutout J4 $RES/conn.kicad_pcb steelStencil' failed
kikit> # 04:32:17: Error: Directory '/homeless-shelter' couldn't be created (error 13: Permission denied)
kikit> # An error occurred: OpenSCAD is not available.
kikit> # Did you install it? Program `openscad` has to be in PATH
kikit> # No output files produced
kikit> not ok 42 Printed stencils
kikit> # (in test file /build/source/test/system/stencil.bats, line 14)
kikit> # `kikit stencil createprinted \' failed
kikit> # 04:32:17: Error: Directory '/homeless-shelter' couldn't be created (error 13: Permission denied)
kikit> # An error occurred: OpenSCAD is not available.
kikit> # Did you install it? Program `openscad` has to be in PATH
kikit> # No output files produced
kikit> make: *** [Makefile:40: test-system] Error 1
kikit> /nix/store/3qnm3nwjajgqa771dmi2dnwxrw0kzq5m-stdenv-linux/setup: line 131: pop_var_context: head of shell_variables not a function context
error: builder for '/nix/store/f3klmz0qvi6yr3qfy7cww434f2z4kjx5-kikit-1.5.0.drv' failed with exit code 2;
This is failing in some pretty old kikit code, so I think this is just
failing due to kikit now having more complete code coverage. While
researching this, I discovered kikit's documentation about [optional
dependencies], which I suppose we don't have good support for right now.
Rather than invent a new option for that, I've opted to preserve the
existing behavior and just do the bare minimum to keep the build
passing.
[optional dependencies]: https://github.com/yaqwsx/KiKit/blob/v1.5.0/docs/installation/intro.md#optional-dependencies