From c697be8c28e9325ebfec05558bbc2f18520c8e59 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 8 Mar 2024 22:36:42 +0000 Subject: [PATCH] temporary fix for cmake cross-compilation --- overlay.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/overlay.nix b/overlay.nix index c6fff9c..d90f6ea 100644 --- a/overlay.nix +++ b/overlay.nix @@ -77,6 +77,22 @@ extraPkgs // { }; + # luarocks wants a cross-compiled cmake (which seems like a bug, + # we're never going to run luarocks on the device, but ...) + # but https://github.com/NixOS/nixpkgs/issues/284734 + # so we do surgery on the cmake derivation until that's fixed + + cmake = prev.cmake.overrideAttrs(o: + # don't override the build cmake or we'll have to rebuild + # half the known universe to no useful benefit + if final.stdenv.buildPlatform != final.stdenv.hostPlatform + then { + preConfigure = + builtins.replaceStrings + ["$configureFlags"] ["$configureFlags $cmakeFlags"] o.preConfigure; + } + else {} + ); dnsmasq = let d = prev.dnsmasq.overrideAttrs(o: {