-
Notifications
You must be signed in to change notification settings - Fork 62
/
Makefile.in
396 lines (313 loc) · 14 KB
/
Makefile.in
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# Makefile.in
#
# Copyright © 2012, 2013 Brandon Invergo <[email protected]>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
# List whatever files you want to include in your source distribution here.
# You can include whole directories but note that *everything* under that
# directory will be included
DISTFILES = PKG-INFO Makefile.in configure setup.py install-sh
DESTDIR =
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_DISTNAME = ${PACKAGE_NAME}-${PACKAGE_VERSION}
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PYTHON = @PYTHON@
VIRTUALENV = @VIRTUALENV@
SHELL = @SHELL@
MKDIR_P = @MKDIR_P@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
exec_prefix = @exec_prefix@
includedir = @includedir@
infodir = @infodir@
prefix = @prefix@
srcdir = @abs_srcdir@
datadir = @datadir@
datarootdir = @datarootdir@
pkgdatadir = $(datadir)/@PACKAGE_NAME@
pkgincludedir = $(includedir)/@PACKAGE_NAME@
# -----------------------------------------------------------------------------
# Dependencies
# -----------------------------------------------------------------------------
IN_PLACE = @IN_PLACE@
BUILD_DIR ?= $(srcdir)/build
DOWNLOAD_DIR ?= $(srcdir)/download
DO_DOWNLOAD ?= curl -sSfL -o
DOCKER_ARCH = @DOCKER_ARCH@
ENABLE_OPENGRM = @ENABLE_OPENGRM@
OPENGRM_FROM = @OPENGRM_FROM@
OPENGRM_PRE_FILE = $(DOWNLOAD_DIR)/opengrm-1.3.4_$(DOCKER_ARCH).tar.gz
OPENGRM_SRC_FILE = $(DOWNLOAD_DIR)/opengrm-ngram-1.3.4.tar.gz
OPENFST_SRC_FILE = $(DOWNLOAD_DIR)/openfst-1.6.9.tar.gz
ENABLE_PHONETISAURUS = @ENABLE_PHONETISAURUS@
PHONETISAURUS_FROM = @PHONETISAURUS_FROM@
PHONETISAURUS_PRE_FILE = $(DOWNLOAD_DIR)/phonetisaurus-2019_$(DOCKER_ARCH).tar.gz
PHONETISAURUS_SRC_FILE = $(DOWNLOAD_DIR)/phonetisaurus-2019.tar.gz
ENABLE_PRECISE = @ENABLE_PRECISE@
PRECISE_ARCH = @PRECISE_ARCH@
PRECISE_FROM = @PRECISE_FROM@
PRECISE_FILE = $(DOWNLOAD_DIR)/precise-engine_0.3.0_$(DOCKER_ARCH).tar.gz
ENABLE_POCKETSPHINX = @ENABLE_POCKETSPHINX@
POCKETSPHINX_FILE = $(DOWNLOAD_DIR)/pocketsphinx-python.tar.gz
ENABLE_KALDI = @ENABLE_KALDI@
KALDI_FROM = @KALDI_FROM@
KALDI_PRE_FILE = $(DOWNLOAD_DIR)/kaldi-2021_$(DOCKER_ARCH).tar.gz
KALDI_SRC_FILE = $(DOWNLOAD_DIR)/kaldi-2021.tar.gz
ENABLE_JULIUS = @ENABLE_JULIUS@
JULIUS_FROM = @JULIUS_FROM@
JULIUS_PRE_FILE = $(DOWNLOAD_DIR)/julius-4.5_$(DOCKER_ARCH).tar.gz
JULIUS_SRC_FILE = $(DOWNLOAD_DIR)/julius-2019.tar.gz
ENABLE_DEEPSPEECH = @ENABLE_DEEPSPEECH@
DEEPSPEECH_ARCH = @DEEPSPEECH_ARCH@
DEEPSPEECH_FROM = @DEEPSPEECH_FROM@
DEEPSPEECH_FILE = $(DOWNLOAD_DIR)/native_client.$(DOCKER_ARCH).cpu.linux.0.9.3.tar.xz
ENABLE_KENLM = @ENABLE_KENLM@
KENLM_FROM = @KENLM_FROM@
KENLM_PRE_FILE = $(DOWNLOAD_DIR)/kenlm-20210107_$(DOCKER_ARCH).tar.gz
EIGEN_SRC_FILE = $(DOWNLOAD_DIR)/eigen-3.2.8.tar.bz2
KENLM_SRC_FILE = $(DOWNLOAD_DIR)/kenlm-20210107.tar.gz
# -----------------------------------------------------------------------------
VENV_DIR = $(DESTDIR)$(prefix)
VENV_PYTHON = $(VENV_DIR)/bin/python
VIRTUALENV_FLAGS ?= --clear --copies
ifeq ($(VIRTUALENV),yes)
INSTALL_PYTHON=$(VENV_PYTHON)
else # VIRTUALENV == yes
INSTALL_PYTHON=$(PYTHON)
endif # VIRTUALENV == yes
.PHONY: all install uninstall distclean clean dist check installdirs
all: download-init build-init opengrm phonetisaurus precise pocketsphinx kaldi julius deepspeech kenlm
.PHONY: install-init install-dependencies install-voice2json
install: installdirs \
install-init \
install-dependencies \
install-voice2json
install-init:
ifeq ($(VIRTUALENV),yes)
"$(PYTHON)" -m venv $(VIRTUALENV_FLAGS) "$(VENV_DIR)" || "$(PYTHON)" -m venv "$(VENV_DIR)"
"$(VENV_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) --upgrade pip
"$(VENV_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) wheel
"$(VENV_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) setuptools
endif # VIRTUALENV == yes
.PHONY: install-opengrm install-phonetisaurus install-precise install-pocketsphinx install-kaldi install-julius install-deepspeech install-kenlm
install-dependencies: install-opengrm \
install-phonetisaurus \
install-precise \
install-pocketsphinx \
install-kaldi \
install-julius \
install-deepspeech \
install-kenlm
install-voice2json:
"$(INSTALL_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) "$(srcdir)"
chmod +x "$(srcdir)/voice2json.sh"
ifneq ($(IN_PLACE),yes)
install -D "$(srcdir)/voice2json.sh" "$(DESTDIR)$(prefix)/bin/voice2json"
install -D "--target-directory=$(DESTDIR)$(prefix)/share/voice2json/etc" "$(srcdir)/etc/profile.defaults.yml"
install -D "--target-directory=$(DESTDIR)$(prefix)/share/voice2json/etc/profiles" "$(srcdir)/etc/profiles/"*
install -D "--target-directory=$(DESTDIR)$(prefix)/share/voice2json/etc/precise" "$(srcdir)/etc/precise"/*
install -D "--target-directory=$(DESTDIR)$(prefix)/share/voice2json" VERSION README.md LICENSE
if [[ -d "$(srcdir)/site" ]]; then cp -fR "$(srcdir)/site" "$(DESTDIR)$(prefix)/share/voice2json/"; fi || true
endif # IN_PLACE
# -----------------------------------------------------------------------------
.PHONY: download-init
download-init:
$(MKDIR_P) "$(DOWNLOAD_DIR)"
.PHONY: build-init
build-init:
$(MKDIR_P) "$(BUILD_DIR)"
# -----------------------------------------------------------------------------
# Opengrm: languge modeling toolkit
# http://www.opengrm.org/twiki/bin/view/GRM/NGramLibrary
# -----------------------------------------------------------------------------
.PHONY: opengrm
ifeq ($(ENABLE_OPENGRM),yes)
opengrm: $(OPENGRM_PRE_FILE)
install-opengrm: $(OPENGRM_PRE_FILE)
"$(srcdir)/scripts/install/install-opengrm.sh" "$(OPENGRM_PRE_FILE)" "$(DESTDIR)$(prefix)"
ifeq ($(OPENGRM_FROM),prebuilt)
$(OPENGRM_PRE_FILE):
$(DO_DOWNLOAD) "$(OPENGRM_PRE_FILE)" "https://github.com/synesthesiam/prebuilt-apps/releases/download/v1.0/opengrm-1.3.4_$(DOCKER_ARCH).tar.gz"
else # OPENGRM_FROM
$(OPENGRM_PRE_FILE): $(OPENFST_SRC_FILE) $(OPENGRM_SRC_FILE)
"$(srcdir)/scripts/build/build-opengrm.sh" "$(OPENGRM_SRC_FILE)" "$(OPENFST_SRC_FILE)" "$(BUILD_DIR)" "$(OPENGRM_PRE_FILE)"
endif # OPENGRM_FROM
else # ENABLE_OPENGRM
opengrm:
install-opengrm:
endif # ENABLE_OPENGRM
$(OPENFST_SRC_FILE):
$(DO_DOWNLOAD) "$(OPENFST_SRC_FILE)" 'http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.6.9.tar.gz'
$(OPENGRM_SRC_FILE):
$(DO_DOWNLOAD) "$(OPENGRM_SRC_FILE)" 'http://www.opengrm.org/twiki/pub/GRM/NGramDownload/opengrm-ngram-1.3.4.tar.gz'
# -----------------------------------------------------------------------------
# Phonetisaurus: grapheme to phoneme
# https://github.com/AdolfVonKleist/Phonetisaurus
# -----------------------------------------------------------------------------
.PHONY: phonetisaurus
ifeq ($(ENABLE_PHONETISAURUS),yes)
phonetisaurus: $(PHONETISAURUS_PRE_FILE)
install-phonetisaurus: $(PHONETISAURUS_PRE_FILE)
"$(srcdir)/scripts/install/install-phonetisaurus.sh" "$(PHONETISAURUS_PRE_FILE)" "$(DESTDIR)$(prefix)"
ifeq ($(PHONETISAURUS_FROM),prebuilt)
$(PHONETISAURUS_PRE_FILE):
$(DO_DOWNLOAD) "$(PHONETISAURUS_PRE_FILE)" "https://github.com/synesthesiam/prebuilt-apps/releases/download/v1.0/phonetisaurus-2019_$(DOCKER_ARCH).tar.gz"
else # PHONETISAURUS_FROM
$(PHONETISAURUS_PRE_FILE): $(OPENFST_SRC_FILE) $(PHONETISAURUS_SRC_FILE)
"$(srcdir)/scripts/build/build-phonetisaurus.sh" "$(PHONETISAURUS_SRC_FILE)" "$(OPENFST_SRC_FILE)" "$(BUILD_DIR)" "$(PHONETISAURUS_PRE_FILE)"
endif # PHONETISAURUS_FROM
else # ENABLE_PHONETISAURUS
phonetisaurus:
install-phonetisaurus:
endif # ENABLE_PHONETISAURUS
$(PHONETISAURUS_SRC_FILE):
$(DO_DOWNLOAD) "$(PHONETISAURUS_SRC_FILE)" 'https://github.com/synesthesiam/docker-phonetisaurus/raw/master/download/phonetisaurus-2019.tar.gz'
# -----------------------------------------------------------------------------
# Mycroft Precise: wake word detection
# https://github.com/MycroftAI/mycroft-precise
# -----------------------------------------------------------------------------
.PHONY: precise install-precise
ifeq ($(ENABLE_PRECISE),yes)
precise: $(PRECISE_FILE)
install-precise: $(PRECISE_FILE)
"$(srcdir)/scripts/install/install-precise.sh" "$(PRECISE_FILE)" "$(DESTDIR)$(prefix)"
else # ENABLE_PRECISE
precise:
install-precise:
endif # ENABLE_PRECISE
$(PRECISE_FILE):
$(DO_DOWNLOAD) "$(PRECISE_FILE)" "https://github.com/MycroftAI/mycroft-precise/releases/download/v0.3.0/precise-engine_0.3.0_$(PRECISE_ARCH).tar.gz"
# -----------------------------------------------------------------------------
# CMU Pocketsphinx: speech to text
# https://github.com/cmusphinx/pocketsphinx
# -----------------------------------------------------------------------------
.PHONY: pocketsphinx install-pocketsphinx
ifeq ($(ENABLE_POCKETSPHINX),yes)
pocketsphinx: $(POCKETSPHINX_FILE)
install-pocketsphinx: $(POCKETSPHINX_FILE)
"$(INSTALL_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) "$(POCKETSPHINX_FILE)"
else # ENABLE_POCKETSPHINX
pocketsphinx:
install-pocketsphinx:
endif # ENABLE_POCKETSPHINX
$(POCKETSPHINX_FILE):
$(DO_DOWNLOAD) "$(POCKETSPHINX_FILE)" 'https://github.com/synesthesiam/pocketsphinx-python/releases/download/v1.0/pocketsphinx-python.tar.gz'
# -----------------------------------------------------------------------------
# Kaldi: speech to text
# https://kaldi-asr.org
# -----------------------------------------------------------------------------
.PHONY: kaldi
ifeq ($(ENABLE_KALDI),yes)
kaldi: $(KALDI_PRE_FILE)
install-kaldi: $(KALDI_PRE_FILE)
"$(srcdir)/scripts/install/install-kaldi.sh" "$(KALDI_PRE_FILE)" "$(DESTDIR)$(prefix)"
ifeq ($(KALDI_FROM),prebuilt)
$(KALDI_PRE_FILE):
$(DO_DOWNLOAD) "$(KALDI_PRE_FILE)" "https://github.com/synesthesiam/prebuilt-apps/releases/download/v1.0/kaldi-2021_$(DOCKER_ARCH).tar.gz"
else # KALDI_FROM
$(KALDI_PRE_FILE): $(KALDI_SRC_FILE)
"$(srcdir)/scripts/build/build-kaldi.sh" "$(KALDI_SRC_FILE)" "$(BUILD_DIR)" "$(KALDI_PRE_FILE)"
endif # KALDI_FROM
else # ENABLE_KALDI
kaldi:
install-kaldi:
endif # ENABLE_KALDI
$(KALDI_SRC_FILE):
$(DO_DOWNLOAD) "$(KALDI_SRC_FILE)" 'https://github.com/synesthesiam/docker-kaldi/raw/master/download/kaldi-2021.tar.gz'
# -----------------------------------------------------------------------------
# Julius: speech to text
# https://github.com/julius-speech/julius
# -----------------------------------------------------------------------------
.PHONY: julius
ifeq ($(ENABLE_JULIUS),yes)
julius: $(JULIUS_PRE_FILE)
install-julius: $(JULIUS_PRE_FILE)
"$(srcdir)/scripts/install/install-julius.sh" "$(JULIUS_PRE_FILE)" "$(DESTDIR)$(prefix)"
ifeq ($(JULIUS_FROM),prebuilt)
$(JULIUS_PRE_FILE):
$(DO_DOWNLOAD) "$(JULIUS_PRE_FILE)" "https://github.com/synesthesiam/prebuilt-apps/releases/download/v1.0/julius-4.5_$(DOCKER_ARCH).tar.gz"
else # JULIUS_FROM
$(JULIUS_PRE_FILE): $(JULIUS_SRC_FILE)
"$(srcdir)/scripts/build/build-julius.sh" "$(JULIUS_SRC_FILE)" "$(BUILD_DIR)" "$(JULIUS_PRE_FILE)"
endif # JULIUS_FROM
else # ENABLE_JULIUS
julius:
install-julius:
endif # ENABLE_JULIUS
$(JULIUS_SRC_FILE):
$(DO_DOWNLOAD) "$(JULIUS_SRC_FILE)" 'https://github.com/synesthesiam/docker-julius/raw/master/download/julius-2019.tar.gz'
# -----------------------------------------------------------------------------
# Mozilla DeepSpeech: speech to text
# https://github.com/mozilla/DeepSpeech
# -----------------------------------------------------------------------------
.PHONY: deepspeech install-deepspeech
ifeq ($(ENABLE_DEEPSPEECH),yes)
deepspeech: $(DEEPSPEECH_FILE)
install-deepspeech: $(DEEPSPEECH_FILE)
"$(srcdir)/scripts/install/install-deepspeech.sh" "$(DEEPSPEECH_FILE)" "$(DESTDIR)$(prefix)"
else # ENABLE_DEEPSPEECH
deepspeech:
install-deepspeech:
endif # ENABLE_DEEPSPEECH
$(DEEPSPEECH_FILE):
$(DO_DOWNLOAD) "$(DEEPSPEECH_FILE)" "https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/native_client.$(DEEPSPEECH_ARCH).cpu.linux.tar.xz"
# -----------------------------------------------------------------------------
# KenLM: language modeling toolkit
# https://kheafield.com/code/kenlm/
# -----------------------------------------------------------------------------
.PHONY: kenlm install-kenlm
ifeq ($(ENABLE_KENLM),yes)
kenlm: $(KENLM_PRE_FILE)
ifeq ($(KENLM_FROM),prebuilt)
$(KENLM_PRE_FILE):
$(DO_DOWNLOAD) "$(KENLM_PRE_FILE)" "https://github.com/synesthesiam/prebuilt-apps/releases/download/v1.0/kenlm-20210107_$(DOCKER_ARCH).tar.gz"
else # KENLM_FROM
$(KENLM_PRE_FILE): $(EIGEN_SRC_FILE) $(KENLM_SRC_FILE)
"$(srcdir)/scripts/build/build-kenlm.sh" "$(KENLM_SRC_FILE)" "$(EIGEN_SRC_FILE)" "$(BUILD_DIR)" "$(KENLM_PRE_FILE)"
endif # KENLM_FROM
install-kenlm: $(KENLM_PRE_FILE)
"$(srcdir)/scripts/install/install-kenlm.sh" "$(KENLM_PRE_FILE)" "$(DESTDIR)$(prefix)"
else # ENABLE_KENLM
kenlm:
install-kenlm:
endif # ENABLE_KENLM
$(KENLM_SRC_FILE):
$(DO_DOWNLOAD) "$(KENLM_SRC_FILE)" 'https://github.com/synesthesiam/prebuilt-apps/releases/download/v1.0/kenlm-20210107.tar.gz'
$(EIGEN_SRC_FILE):
$(DO_DOWNLOAD) "$(EIGEN_SRC_FILE)" 'https://github.com/synesthesiam/docker-kenlm/raw/master/download/eigen-3.2.8.tar.bz2'
# -----------------------------------------------------------------------------
uninstall:
ifeq ($(VIRTUALENV),yes)
rm -rvf "$(VENV_DIR)"
endif
# Delete downloaded binaries and build artifacts
clean:
"$(PYTHON)" setup.py clean
rm -rvf "$(BUILD_DIR)"
# Clean up the output of configure
distclean:
rm -v "$(srcdir)/config.log"
rm -v "$(srcdir)/config.status"
rm -rvf "$(srcdir)/autom4te.cache"
rm -v "$(srcdir)/Makefile"
# You can either use the setup.py sdist command or you can roll your own here
dist:
"$(PYTHON)" setup.py sdist
# Use the setup.py check command
check:
"$(PYTHON)" setup.py check
"$(DEST_DIR)$(prefix)/bin/voice2json" --version
# setup.py might complain if a directory doesn't exist so just in case, make the directory
# here
installdirs:
$(MKDIR_P) "$(DESTDIR)$(prefix)"