Package: renpy / 7.3.5+dfsg-1

system-fribidi.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
From: Markus Koschany <apo@debian.org>
Date: Sat, 15 Sep 2018 21:22:44 +0200
Subject: system fribidi

Use Debian's system version of fribidi.
Forwarded: not-needed
---
 module/_renpybidi.pyx   |  2 +-
 module/gen/_renpybidi.c |  2 +-
 module/renpybidicore.c  |  2 +-
 module/setup.py         | 34 +++++++++-------------------------
 4 files changed, 12 insertions(+), 28 deletions(-)

diff --git a/module/_renpybidi.pyx b/module/_renpybidi.pyx
index f5011a2..2896b0a 100644
--- a/module/_renpybidi.pyx
+++ b/module/_renpybidi.pyx
@@ -21,7 +21,7 @@
 
 from __future__ import print_function
 
-cdef extern from "fribidi.h":
+cdef extern from "fribidi/fribidi.h":
     int FRIBIDI_TYPE_LTR
     int FRIBIDI_TYPE_ON
     int FRIBIDI_TYPE_RTL
diff --git a/module/gen/_renpybidi.c b/module/gen/_renpybidi.c
index 536d43a..86120b6 100644
--- a/module/gen/_renpybidi.c
+++ b/module/gen/_renpybidi.c
@@ -520,7 +520,7 @@ static CYTHON_INLINE float __PYX_NAN() {
 
 #define __PYX_HAVE___renpybidi
 #define __PYX_HAVE_API___renpybidi
-#include "fribidi.h"
+#include <fribidi/fribidi.h>
 #include "renpybidicore.h"
 #ifdef _OPENMP
 #include <omp.h>
diff --git a/module/renpybidicore.c b/module/renpybidicore.c
index fa9a426..c2e5601 100644
--- a/module/renpybidicore.c
+++ b/module/renpybidicore.c
@@ -1,5 +1,5 @@
 #include <Python.h>
-#include <fribidi-src/lib/fribidi.h>
+#include <fribidi/fribidi.h>
 #include <stdlib.h>
 
 #ifndef alloca
diff --git a/module/setup.py b/module/setup.py
index 37b1609..8055f7b 100644
--- a/module/setup.py
+++ b/module/setup.py
@@ -92,6 +92,7 @@ has_avresample = library("avresample", optional=True)
 has_swresample = library("swresample", optional=True)
 has_swscale = library("swscale", optional=True)
 library("freetype")
+has_fribidi = library("fribidi", optional=True)
 library("z")
 has_libglew = library("GLEW", optional=True)
 has_libglew32 = library("glew32", optional=True)
@@ -118,31 +119,11 @@ cython(
     [ "IMG_savepng.c", "core.c", "subpixel.c"],
     sdl + [ png, 'z', 'm' ])
 
-FRIBIDI_SOURCES = """
-fribidi-src/lib/fribidi.c
-fribidi-src/lib/fribidi-arabic.c
-fribidi-src/lib/fribidi-bidi.c
-fribidi-src/lib/fribidi-bidi-types.c
-fribidi-src/lib/fribidi-deprecated.c
-fribidi-src/lib/fribidi-joining.c
-fribidi-src/lib/fribidi-joining-types.c
-fribidi-src/lib/fribidi-mem.c
-fribidi-src/lib/fribidi-mirroring.c
-fribidi-src/lib/fribidi-run.c
-fribidi-src/lib/fribidi-shape.c
-renpybidicore.c
-""".split()
-cython(
-    "_renpybidi",
-    FRIBIDI_SOURCES,
-    includes=[
-        BASE + "/fribidi-src/",
-        BASE + "/fribidi-src/lib/",
-        ],
-    define_macros=[
-        ("FRIBIDI_ENTRY", ""),
-        ("HAVE_CONFIG_H", "1"),
-        ])
+if has_fribidi:
+    cython(
+        "_renpybidi",
+        [ "renpybidicore.c" ],
+        ['fribidi'], define_macros=[ ("FRIBIDI_ENTRY", ""), ("HAVE_CONFIG_H", "1")])
 
 
 cython("_renpysteam", language="c++", compile_if=steam_sdk, libs=["steam_api"])
@@ -255,3 +236,6 @@ sys.path.insert(0, '..')
 import renpy
 
 setuplib.setup("Ren'Py", renpy.version[7:])  # @UndefinedVariable
+
+if not has_fribidi:
+    print("Warning: Did not include fribidi.")