about summary refs log tree commit diff
path: root/pkgs/by-name/cm
diff options
context:
space:
mode:
authorArnout Engelen <arnout@bzzt.net>2024-02-05 11:50:03 +0100
committerArnout Engelen <arnout@bzzt.net>2024-04-03 23:20:11 +0200
commit596ca95c5724194b37e37bfa797d2da8421a63aa (patch)
tree5bcbaa436b72bfbd1744a3cebc07efd35e2bb323 /pkgs/by-name/cm
parent7781caa09d74b971a059a0240a03c5dd68acf3e5 (diff)
cmake: enable cross compilation
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
Diffstat (limited to 'pkgs/by-name/cm')
-rw-r--r--pkgs/by-name/cm/cmake/package.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/by-name/cm/cmake/package.nix b/pkgs/by-name/cm/cmake/package.nix
index a9b29a3245d5d..ae04ac088aba2 100644
--- a/pkgs/by-name/cm/cmake/package.nix
+++ b/pkgs/by-name/cm/cmake/package.nix
@@ -110,7 +110,7 @@ stdenv.mkDerivation (finalAttrs: {
       --subst-var-by libc_dev ${lib.getDev stdenv.cc.libc} \
       --subst-var-by libc_lib ${lib.getLib stdenv.cc.libc}
     # CC_FOR_BUILD and CXX_FOR_BUILD are used to bootstrap cmake
-    configureFlags="--parallel=''${NIX_BUILD_CORES:-1} CC=$CC_FOR_BUILD CXX=$CXX_FOR_BUILD $configureFlags"
+    configureFlags="--parallel=''${NIX_BUILD_CORES:-1} CC=$CC_FOR_BUILD CXX=$CXX_FOR_BUILD $configureFlags $cmakeFlags"
   '';
 
   # The configuration script is not autoconf-based, although being similar;