Merge pull request #80838 from maxxk/pyfribidi-fix

pythonPackages.pyfribidi: fix build
This commit is contained in:
Daniel Schaefer 2020-02-23 16:22:22 +01:00 committed by GitHub
commit 4441a6a8a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View file

@ -1,14 +1,14 @@
{ stdenv
, buildPythonPackage
, fetchPypi
, isPy3k
, isPyPy
, six
}:
buildPythonPackage rec {
version = "0.12.0";
pname = "pyfribidi";
disabled = isPy3k || isPyPy;
disabled = isPyPy;
src = fetchPypi {
inherit pname version;
@ -16,6 +16,10 @@ buildPythonPackage rec {
sha256 = "64726a4a56783acdc79c6b9b3a15f16e6071077c897a0b999f3b43f744bc621c";
};
patches = stdenv.lib.optional stdenv.cc.isClang ./pyfribidi-clang.patch;
propagatedBuildInputs = [ six ];
meta = with stdenv.lib; {
description = "A simple wrapper around fribidi";
homepage = https://github.com/pediapress/pyfribidi;

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);