Add patch for python2 build with clang

This commit is contained in:
Maxim Krivchikov 2020-02-23 07:21:10 +00:00
parent 4644a4c482
commit a517238f9f
2 changed files with 19 additions and 0 deletions

View file

@ -16,6 +16,8 @@ buildPythonPackage rec {
sha256 = "64726a4a56783acdc79c6b9b3a15f16e6071077c897a0b999f3b43f744bc621c";
};
patches = stdenv.lib.optional stdenv.cc.isClang ./pyfribidi-clang.patch;
propagatedBuildInputs = [ six ];
meta = with stdenv.lib; {

View file

@ -0,0 +1,17 @@
diff --git a/pyfribidi.c b/pyfribidi.c
index 9a0120d..238134a 100644
--- a/pyfribidi.c
+++ b/pyfribidi.c
@@ -148,10 +148,11 @@ init_pyfribidi (void)
{
#if PY_MAJOR_VERSION >= 3
PyObject *module = PyModule_Create (&pyfribidi_moduledef);
+ if (module == NULL) return NULL;
#else
PyObject *module = Py_InitModule ("_pyfribidi", PyfribidiMethods);
+ if (module == NULL) return;
#endif
- if (module == NULL) return NULL;
PyModule_AddIntConstant (module, "RTL", (long) FRIBIDI_TYPE_RTL);
PyModule_AddIntConstant (module, "LTR", (long) FRIBIDI_TYPE_LTR);