Skip to content

Commit 64ebd00

Browse files
committed
Add libraqm to build
1 parent 8ea0ff6 commit 64ebd00

9 files changed

+72
-1
lines changed

extern/meson.build

+21
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,27 @@ else
3030
freetype_dep = freetype_proj.get_variable('freetype_dep')
3131
endif
3232

33+
if get_option('system-libraqm')
34+
libraqm_dep = dependency('raqm', version: '>=0.10.2')
35+
else
36+
LOCAL_LIBRAQM_VERSION = '0.10.2'
37+
38+
subproject('harfbuzz',
39+
default_options: [
40+
'freetype=enabled',
41+
'glib=disabled',
42+
'gobject=disabled',
43+
'cairo=disabled',
44+
'icu=disabled',
45+
'tests=disabled',
46+
])
47+
subproject('fribidi', default_options: ['docs=false', 'tests=false'])
48+
libraqm_proj = subproject(
49+
f'libraqm-@LOCAL_LIBRAQM_VERSION@',
50+
default_options: ['default_library=static'])
51+
libraqm_dep = libraqm_proj.get_variable('libraqm_dep')
52+
endif
53+
3354
if get_option('system-qhull')
3455
qhull_dep = dependency('qhull_r', version: '>=8.0.2', required: false)
3556
if not qhull_dep.found()

meson.options

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
# FreeType on AIX.
88
option('system-freetype', type: 'boolean', value: false,
99
description: 'Build against system version of FreeType')
10+
option('system-libraqm', type: 'boolean', value: false,
11+
description: 'Build against system version of libraqm')
1012
option('system-qhull', type: 'boolean', value: false,
1113
description: 'Build against system version of Qhull')
1214

src/ft2font.h

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ extern "C" {
2222
#include FT_TRUETYPE_TABLES_H
2323
}
2424

25+
#include <raqm.h>
26+
2527
/*
2628
By definition, FT_FIXED as 2 16bit values stored in a single long.
2729
*/

src/ft2font_wrapper.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1824,5 +1824,6 @@ PYBIND11_MODULE(ft2font, m, py::mod_gil_not_used())
18241824

18251825
m.attr("__freetype_version__") = version_string;
18261826
m.attr("__freetype_build_type__") = FREETYPE_BUILD_TYPE;
1827+
m.attr("__libraqm_version__") = raqm_version_string();
18271828
m.def("__getattr__", ft2font__getattr__);
18281829
}

src/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ extension_data = {
5353
'ft2font_wrapper.cpp',
5454
),
5555
'dependencies': [
56-
freetype_dep, pybind11_dep, agg_dep.partial_dependency(includes: true),
56+
freetype_dep, libraqm_dep, pybind11_dep, agg_dep.partial_dependency(includes: true),
5757
],
5858
'cpp_args': [
5959
'-DFREETYPE_BUILD_TYPE="@0@"'.format(

subprojects/fribidi.wrap

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[wrap-file]
2+
directory = fribidi-1.0.10
3+
source_url = https://github.com/fribidi/fribidi/releases/download/v1.0.10/fribidi-1.0.10.tar.xz
4+
source_filename = fribidi-1.0.10.tar.xz
5+
source_hash = 7f1c687c7831499bcacae5e8675945a39bacbad16ecaa945e9454a32df653c01

subprojects/harfbuzz.wrap

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[wrap-file]
2+
directory = harfbuzz-3.0.0
3+
source_url = https://github.com/harfbuzz/harfbuzz/releases/download/3.0.0/harfbuzz-3.0.0.tar.xz
4+
source_filename = harfbuzz-3.0.0.tar.xz
5+
source_hash = 036b0ee118451539783ec7864148bb4106be42a2eb964df4e83e6703ec46f3d9

subprojects/libraqm-0.10.2.wrap

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[wrap-file]
2+
source_url = https://github.com/HOST-Oman/libraqm/archive/v0.10.2/libraqm-0.10.2.tar.gz
3+
source_filename = libraqm-0.10.2.tar.gz
4+
source_hash = db68fd9f034fc40ece103e511ffdf941d69f5e935c48ded8a31590468e42ba72
5+
6+
# This patch allows using our bundled FreeType.
7+
diff_files = libraqm-0.7.2-older-freetype.patch
8+
9+
[provide]
10+
libraqm-0.10.2 = libraqm_dep
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--- a/meson.build 2025-03-26 03:32:12.444735795 -0400
2+
+++ b/meson.build 2025-03-26 03:32:16.117435140 -0400
3+
@@ -45,8 +45,7 @@
4+
if not freetype.found()
5+
freetype = dependency(
6+
'freetype2',
7+
version: '>= @0@'.format(freetype_version[0]),
8+
- method: 'pkg-config',
9+
fallback: ['freetype2', 'freetype_dep'],
10+
default_options: [
11+
'png=disabled',
12+
--- a/src/meson.build 2025-03-26 03:59:08.651929905 -0400
13+
+++ b/src/meson.build 2025-03-26 04:00:09.537615893 -0400
14+
@@ -42,6 +42,11 @@
15+
install: true,
16+
)
17+
18+
+libraqm_dep = declare_dependency(
19+
+ include_directories: include_directories('.'),
20+
+ link_with: libraqm,
21+
+)
22+
+
23+
libraqm_test = static_library(
24+
'raqm-test',
25+
'raqm.c',

0 commit comments

Comments
 (0)