Without this change pkgsLLVM fails to build any packages
as compiler-rt fails early in cmake:
CMake Error at ...-cmake-3.24.0/share/cmake-3.24/Modules/Platform/UnixPaths.cmake:53 (file):
file STRINGS file
"...-x86_64-unknown-linux-gnu-clang-wrapper-11.1.0/nix-support/orig-libc-dev"
cannot be read.
It's a regression caused by 871cf9f7b3 "cmake: detect libc location
at runtime #181431" where we started using `orig-libc-dev` as a libc pointer.
During pkgsLLVM pootstrap first compiler has no libc support yet.
The change skips runtime detection if there are no libc signs.
This should simplify using `nix-shell -A` or `nix develop` to develop
CMake based projects. CMake features a mechanism to use a different
RPATH for all executables in the build directory and only rewrite these
RPATHs on installation. This makes it possible to run executables
already from the build directory without having to set LD_LIBRARY_PATH.
This should simplify the checkPhase for cmake based projects and
hopefully not break anything.
Fixes: #22060
This is a reversed patch of https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6426.
_CURRENT_OSX_VERSION isn't set properly, which causes this condition to fail,
which means we don't get CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG which means
we can't compile libcxx. Ugh.
Adds the SystemConfiguration framework to buildInputs unless we're
bootstrapping.
For the bootstrap version, we revert
31f631a142
instead so CMake builds without SystemConfiguration.
cmake on darwin now depends on the SystemConfiguration framework.
Support for this has not yet been added to our bootstrapping.
We need to decide how to go further. As this is blocking staging-next
it is reverted.
This reverts commit 29bbaa1489.
Also removing a comment that instructs maintainers to cross-check
the hash with one that is posted upstream, because as @lilyball
reasoned:
"I'm not really sure what the benefit of comparing the hash is; if the
download is tampered with, the hash is served from the same site and
would presumably be tampered with as well, and the download is done over
https and declares its Content-Length so there's no risk of truncation
(which would cause the file to fail to unpack anyway)"
By default, the cmake derivation contains the documentation in .rst
format. This format is not well suited for interactive use. Therefore,
we add both man and info outputs and convert the documentation to
these formats using Sphinx.
These formats are enabled by default only in cmake versions for
interactive use (ncurses, Qt), because using Sphinx in the basic
version leads to circular dependency (infinite recursion). Namely,
Sphinx has imagemagick in its checkInputs and imagemagick has several
transitive dependencies, which have cmake in nativeBuildInputs.
This `substituteInPlace` was introduced in 2016 when cmake was at v3.4:
* https://github.com/NixOS/nixpkgs/commit/5286c0aebb
In 2018 cmake v3.12.0 changed the code to make it not match anything:
* https://github.com/Kitware/CMake/commit/50b5e9ed13
```
substituteStream(): WARNING: pattern '${PYTHON_EXECUTABLE}' doesn't match anything in file 'Modules/FindCxxTest.cmake'
```
Having it around in 2021 with cmake v3.19.3 doesn't help,
and tests are disabled anyway.