about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLinus Heckemann2024-05-08 07:48:58 +0200
committerGitHub2024-05-08 07:48:58 +0200
commit3645b258dd7314a6bebc2bfa95e9f9d4fa772240 (patch)
treea5a6130d8ee82807d94c27f2ac6c6150c091d995
parente5332191028d534302bdad7c138f81005cdb1bff (diff)
parent2f6997fa92bc4ae6f8eaf2ea4329479e709324ce (diff)
Merge pull request #309959 from avnik/avnik/m2crypto-cross-fix
python-m2crypto: fix cross-compilation
-rw-r--r--pkgs/development/python-modules/m2crypto/default.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/pkgs/development/python-modules/m2crypto/default.nix b/pkgs/development/python-modules/m2crypto/default.nix
index ae2e7b87ded1..00d23b854030 100644
--- a/pkgs/development/python-modules/m2crypto/default.nix
+++ b/pkgs/development/python-modules/m2crypto/default.nix
@@ -32,10 +32,14 @@ buildPythonPackage rec {
     parameterized
   ];
 
-  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin (toString [
-    "-Wno-error=implicit-function-declaration"
-    "-Wno-error=incompatible-pointer-types"
-  ]);
+  env = {
+    NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin (toString [
+      "-Wno-error=implicit-function-declaration"
+      "-Wno-error=incompatible-pointer-types"
+    ]);
+  } // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
+    CPP = "${stdenv.cc.targetPrefix}cpp";
+  };
 
   nativeCheckInputs = [
     pytestCheckHook