From f380d904e593812b7fa8e8723dd3438aafb2e08b Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 22 Dec 2023 00:56:19 +0900 Subject: [PATCH 1/2] python311Packages.lxml: fix build with clang --- pkgs/development/python-modules/lxml/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/lxml/default.nix b/pkgs/development/python-modules/lxml/default.nix index f6016ae3a9ed..093ec343a6db 100644 --- a/pkgs/development/python-modules/lxml/default.nix +++ b/pkgs/development/python-modules/lxml/default.nix @@ -22,6 +22,8 @@ buildPythonPackage rec { nativeBuildInputs = [ libxml2.dev libxslt.dev cython ] ++ lib.optionals stdenv.isDarwin [ xcodebuild ]; buildInputs = [ libxml2 libxslt zlib ]; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=incompatible-function-pointer-types"; + # tests are meant to be ran "in-place" in the same directory as src doCheck = false; From 71c906fbfa77b760c32b65a36a84c6c242cef002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 23 Dec 2023 22:09:12 +0100 Subject: [PATCH 2/2] python311Packages.lxml: avoid rebuild on gcc platforms It's a bit impractical that our env parameter does not have this property (with empty strings). --- pkgs/development/python-modules/lxml/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/lxml/default.nix b/pkgs/development/python-modules/lxml/default.nix index 093ec343a6db..fae582f17072 100644 --- a/pkgs/development/python-modules/lxml/default.nix +++ b/pkgs/development/python-modules/lxml/default.nix @@ -22,7 +22,9 @@ buildPythonPackage rec { nativeBuildInputs = [ libxml2.dev libxslt.dev cython ] ++ lib.optionals stdenv.isDarwin [ xcodebuild ]; buildInputs = [ libxml2 libxslt zlib ]; - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=incompatible-function-pointer-types"; + env = lib.optionalAttrs stdenv.cc.isClang { + NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types"; + }; # tests are meant to be ran "in-place" in the same directory as src doCheck = false;