patch cmake to implement a NIXPKGS_CMAKE_PREFIX_PATH env variable which
is similar to CMAKE_PREFIX_PATH except it is not searched for programs.
This is required because cmake will search CMAKE_PREFIX_PATH for
programs before PATH which is problematic as that means buildInputs gets
searched before nativeBuildInputs which can break things when the
binaries in PATH are covered or the order re-arranged.
This commit adds the -type f filter to the find command. Previously, -type f
only applied to the first file name: *.cmake. The -o command means that -type f
has to be added back for the other file names.
When cross-compiling cmake, for example with
`nix build .#pkgsCross.mipsel-linux-gnu.cmake`, the `configure`
script will invoke the build platform cmake to build the
host platform cmake. Usually, stdenv will automatically pass
variables such as `-DCMAKE_SYSTEM_PROCESSOR` to cmake
(https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/make-derivation.nix#L416),
but since here cmake is invoked 'indirectly' we have to pass
these parameters to the `configure` script ourselves.
It appears this was (surprisingly) not necessary on versions
through 3.26.4, but the update to 3.27.7 exposed that these
flags were missing, causing link failures.
Fixes#284734
riscv64 is failing due to missing atomic ops in gcc 12.
This commit works around the problem by linking against libatomic.
It can be reverted when we switch to gcc 13 (#268097)
Indeed there is few to no reason to call this "isBootstrap" since we do not
build cmake by using a previous cmake.
Also, add a warning to the use of the old option.