-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcompat.harfbuzz.lua
More file actions
85 lines (83 loc) · 3.73 KB
/
Copy pathcompat.harfbuzz.lua
File metadata and controls
85 lines (83 loc) · 3.73 KB
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
-- compat.harfbuzz — HarfBuzz text shaping engine, with the FreeType font backend.
--
-- Shape A (C-source compat, C++ flavour): the user writes `#include <hb.h>`
-- and, for the FreeType bridge, `#include <hb-ft.h>`.
--
-- ONE TRANSLATION UNIT, ON PURPOSE.
-- Upstream builds with meson (or a CMake port), and reproducing either here
-- would mean tracking ~137 .cc files plus their generated config. HarfBuzz
-- ships `src/harfbuzz.cc` for exactly this case: an amalgamation that
-- #includes every implementation file. It is upstream's own supported
-- "just compile one file" path, so the source list stays one line and cannot
-- drift out of sync with a release.
--
-- The amalgamation also #includes the backends this package does not enable
-- (CoreText, DirectWrite, GDI, GLib, Graphite2, ICU). Each of those is behind
-- its own HAVE_* gate and compiles to nothing when the gate is absent, so
-- naming only HAVE_FREETYPE selects precisely the FreeType backend without
-- editing anything.
--
-- NO config.h. HarfBuzz reads one only under HAVE_CONFIG_H, which is not
-- defined here; `hb-config.hh` then supplies the defaults. That is what keeps
-- this a source-only package with no configure step.
--
-- HB_NO_MT IS DELIBERATELY NOT SET. It drops HarfBuzz's atomics and locks,
-- which is only sound when the consumer guarantees single-threaded use --
-- a promise a shared index package cannot make on its consumers' behalf.
package = {
spec = "1",
namespace = "compat",
name = "harfbuzz",
description = "HarfBuzz — OpenType text shaping engine with the FreeType backend",
licenses = {"MIT"},
repo = "https://github.com/harfbuzz/harfbuzz",
type = "package",
xpm = {
linux = {
["14.3.0"] = {
url = {
GLOBAL = "https://github.com/harfbuzz/harfbuzz/archive/refs/tags/14.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/harfbuzz/releases/download/14.3.0/harfbuzz-14.3.0.tar.gz",
},
sha256 = "566e996a1b40486954fb7110ffe6eb88a0f7958bb466cdb023b0302618acea4a",
},
},
macosx = {
["14.3.0"] = {
url = {
GLOBAL = "https://github.com/harfbuzz/harfbuzz/archive/refs/tags/14.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/harfbuzz/releases/download/14.3.0/harfbuzz-14.3.0.tar.gz",
},
sha256 = "566e996a1b40486954fb7110ffe6eb88a0f7958bb466cdb023b0302618acea4a",
},
},
windows = {
["14.3.0"] = {
url = {
GLOBAL = "https://github.com/harfbuzz/harfbuzz/archive/refs/tags/14.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/harfbuzz/releases/download/14.3.0/harfbuzz-14.3.0.tar.gz",
},
sha256 = "566e996a1b40486954fb7110ffe6eb88a0f7958bb466cdb023b0302618acea4a",
},
},
},
mcpp = {
language = "c++23",
import_std = false,
include_dirs = { "*/src" },
sources = { "*/src/harfbuzz.cc" },
-- HAVE_FREETYPE turns on hb-ft.cc inside the amalgamation, which is
-- what makes <hb-ft.h> more than a set of declarations. The public
-- header is installed either way, so without this the consumer gets a
-- link error rather than a compile error -- worth pinning down here.
cxxflags = { "-DHAVE_FREETYPE=1" },
targets = { ["harfbuzz"] = { kind = "lib" } },
deps = { ["compat.freetype"] = "2.13.3" },
linux = {
ldflags = { "-lm", "-lpthread" },
},
macosx = {
ldflags = { "-lm" },
},
},
}