diff --git a/pkgs/development/python-modules/tpm2-pytss/cross.patch b/pkgs/development/python-modules/tpm2-pytss/cross.patch index 8fa2956c11d0..444323e28197 100644 --- a/pkgs/development/python-modules/tpm2-pytss/cross.patch +++ b/pkgs/development/python-modules/tpm2-pytss/cross.patch @@ -2,21 +2,19 @@ diff --git a/setup.py b/setup.py index 1b5f513..d660b9a 100644 --- a/setup.py +++ b/setup.py -@@ -184,7 +184,8 @@ class type_generator(build_ext): - f"unable to find tss2_tpm2_types.h in {pk['include_dirs']}" +@@ -199,6 +199,7 @@ + pdata = preprocess_file( + header_path, + cpp_args=["-std=c99", "-D__extension__=", "-D__attribute__(x)="], ++ cpp_path="@crossPrefix@-cpp", ) - pdata = preprocess_file( -- header_path, cpp_args=["-D__extension__=", "-D__attribute__(x)="] -+ header_path, cpp_args=["-D__extension__=", "-D__attribute__(x)="], -+ cpp_path="@crossPrefix@-cpp", - ) parser = c_parser.CParser() ast = parser.parse(pdata, "tss2_tpm2_types.h") -@@ -210,6 +211,7 @@ class type_generator(build_ext): - "-D__float128=long double", - "-D_FORTIFY_SOURCE=0", - ], -+ cpp_path="@crossPrefix@-cpp", - ) +@@ -238,6 +239,7 @@ + "-D__float128=long double", + "-D_FORTIFY_SOURCE=0", + ], ++ cpp_path="@crossPrefix@-cpp", + ) parser = c_parser.CParser() past = parser.parse(pdata, "tss2_policy.h") diff --git a/pkgs/development/python-modules/tpm2-pytss/default.nix b/pkgs/development/python-modules/tpm2-pytss/default.nix index 235b4688470d..dbefc00be8c3 100644 --- a/pkgs/development/python-modules/tpm2-pytss/default.nix +++ b/pkgs/development/python-modules/tpm2-pytss/default.nix @@ -70,6 +70,7 @@ buildPythonPackage rec { # when cross-compiling is turned on. # This patch changes the call to pycparser.preprocess_file to provide the name # of the cross-compiling cpp + # NOTE: This patch could be dropped after next release. 3.0.0-rc0 already have proper `$CC -E` invocation (replaceVars ./cross.patch { crossPrefix = stdenv.hostPlatform.config; })