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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# =============================================================================
# Cross.toml — configuration for `cargo cross`
# https://github.com/cross-rs/cross
#
# Usage (with the `espeak` feature):
#
# cargo install cross --git https://github.com/cross-rs/cross
#
# cross build --target aarch64-unknown-linux-gnu --features espeak
# cross build --target armv7-unknown-linux-gnueabihf --features espeak
# cross build --target x86_64-unknown-linux-musl --features espeak
# cross build --target riscv64gc-unknown-linux-gnu --features espeak
#
# Without `--features espeak` no native library is needed and every target
# works out of the box with no pre-build steps.
#
# The `pre-build` commands run as root inside the cross Docker container
# (Ubuntu-based) immediately before `cargo build`. They install
# libespeak-ng-dev for the target architecture via Debian multiarch.
#
# Musl targets use Alpine-based images where `apk` is available; the
# `espeak-ng-static` package from Alpine provides libespeak-ng.a for musl.
# =============================================================================
# ── Global settings ─────────────────────────────────────────────────────────
[]
# Pass build-time env vars into the container.
# ESPEAK_SYSROOT is intentionally excluded — inside the cross container the
# multiarch paths are always at the standard Debian locations.
= [
"ESPEAK_LIB_DIR",
"ESPEAK_TAG",
"ANDROID_NDK_HOME",
"ORT_LIB_LOCATION",
"ORT_PREFER_DYNAMIC_LINK",
]
# ── Linux GNU targets (Debian/Ubuntu multiarch) ──────────────────────────────
[]
= [
"dpkg --add-architecture arm64",
"apt-get update -qq",
"apt-get install -y --no-install-recommends libespeak-ng-dev:arm64",
]
[]
= [
"dpkg --add-architecture armhf",
"apt-get update -qq",
"apt-get install -y --no-install-recommends libespeak-ng-dev:armhf",
]
[]
= [
"dpkg --add-architecture armhf",
"apt-get update -qq",
"apt-get install -y --no-install-recommends libespeak-ng-dev:armhf",
]
[]
= [
"dpkg --add-architecture armel",
"apt-get update -qq",
"apt-get install -y --no-install-recommends libespeak-ng-dev:armel",
]
[]
= [
"dpkg --add-architecture i386",
"apt-get update -qq",
"apt-get install -y --no-install-recommends libespeak-ng-dev:i386",
]
[]
= [
"apt-get update -qq",
"apt-get install -y --no-install-recommends libespeak-ng-dev",
]
[]
= [
"dpkg --add-architecture riscv64",
"apt-get update -qq",
"apt-get install -y --no-install-recommends libespeak-ng-dev:riscv64",
]
[]
= [
"dpkg --add-architecture ppc64el",
"apt-get update -qq",
"apt-get install -y --no-install-recommends libespeak-ng-dev:ppc64el",
]
[]
= [
"dpkg --add-architecture s390x",
"apt-get update -qq",
"apt-get install -y --no-install-recommends libespeak-ng-dev:s390x",
]
# ── Linux musl targets (Alpine-based cross images) ───────────────────────────
#
# cross uses alpine-based images for musl targets where `apk` is the package
# manager. `espeak-ng-static` provides libespeak-ng.a built for musl libc.
[]
= [
"apk add --no-cache espeak-ng-dev espeak-ng-static",
]
[]
= [
"apk add --no-cache espeak-ng-dev espeak-ng-static",
]
[]
= [
"apk add --no-cache espeak-ng-dev espeak-ng-static",
]
[]
= [
"apk add --no-cache espeak-ng-dev espeak-ng-static",
]
[]
= [
"apk add --no-cache espeak-ng-dev espeak-ng-static",
]
# ── Android targets ───────────────────────────────────────────────────────────
#
# espeak-ng must be cross-compiled for Android separately using the NDK.
# The cross Docker image does not have espeak-ng for Android.
#
# Recommended workflow:
# 1. Build espeak-ng for Android with the dedicated script:
# ESPEAK_LIB_DIR=$PWD/espeak-static/android/lib \
# ESPEAK_TARGET=aarch64-linux-android \
# ANDROID_NDK_HOME=/path/to/ndk \
# bash scripts/build-espeak-static.sh
#
# 2. Pass the path to cross:
# ESPEAK_LIB_DIR=$PWD/espeak-static/android/lib \
# cross build --target aarch64-linux-android --features espeak
#
# Or use the full Android build script which handles everything:
# bash android/build_rust_android.sh
[]
# No pre-build — ESPEAK_LIB_DIR must be set by the caller (see above).
[]
# No pre-build — ESPEAK_LIB_DIR must be set by the caller.
[]
# No pre-build — ESPEAK_LIB_DIR must be set by the caller.
[]
# No pre-build — ESPEAK_LIB_DIR must be set by the caller.
# ── Windows (MinGW) targets ───────────────────────────────────────────────────
#
# cross uses a Wine-based image for Windows GNU targets.
# espeak-ng for MinGW is not available in the standard cross images.
# Use ESPEAK_LIB_DIR pointing at a pre-built MinGW libespeak-ng.a, or
# build it on a Windows host with scripts\build-espeak-static.ps1.
[]
# No pre-build — ESPEAK_LIB_DIR must be set by the caller.
[]
# No pre-build — ESPEAK_LIB_DIR must be set by the caller.