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
|
From c65c84449f0ec7f5b6b6187e0f2048b8d0f68494 Mon Sep 17 00:00:00 2001
From: memchr <memchr@proton.me>
Date: Mon, 21 Oct 2024 06:42:49 +0000
Subject: [PATCH 1/3] Use system libraries
reference: https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/testing/piper-tts/use-system-libs.patch
---
CMakeLists.txt | 72 +++++++++++++++++---------------------------------
VERSION | 2 +-
2 files changed, 25 insertions(+), 49 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f96ec44..fb1f5f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ if(MSVC)
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
elseif(NOT APPLE)
# Linux flags
- string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra -Wl,-rpath,'$ORIGIN'")
+ string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra")
string(APPEND CMAKE_C_FLAGS " -Wall -Wextra")
endif()
@@ -25,7 +25,7 @@ add_executable(test_piper src/cpp/test.cpp src/cpp/piper.cpp)
# ---- fmt ---
-if(NOT DEFINED FMT_DIR)
+if(FALSE)
set(FMT_VERSION "10.0.0")
set(FMT_DIR "${CMAKE_CURRENT_BINARY_DIR}/fi")
@@ -43,7 +43,7 @@ endif()
# ---- spdlog ---
-if(NOT DEFINED SPDLOG_DIR)
+if(FALSE)
set(SPDLOG_DIR "${CMAKE_CURRENT_BINARY_DIR}/si")
set(SPDLOG_VERSION "1.12.0")
ExternalProject_Add(
@@ -58,7 +58,13 @@ endif()
# ---- piper-phonemize ---
-if(NOT DEFINED PIPER_PHONEMIZE_DIR)
+find_package(PkgConfig)
+pkg_check_modules(FMT REQUIRED fmt)
+pkg_check_modules(ONNXRUNTIME REQUIRED libonnxruntime)
+pkg_check_modules(PIPER_PHONEMIZE REQUIRED piper_phonemize)
+pkg_check_modules(SPDLOG REQUIRED spdlog)
+
+if(FALSE)
set(PIPER_PHONEMIZE_DIR "${CMAKE_CURRENT_BINARY_DIR}/pi")
ExternalProject_Add(
piper_phonemize_external
@@ -74,9 +80,8 @@ endif()
if((NOT MSVC) AND (NOT APPLE))
# Linux flags
- string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra -Wl,-rpath,'$ORIGIN'")
+ string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra")
string(APPEND CMAKE_C_FLAGS " -Wall -Wextra")
- target_link_libraries(piper -static-libgcc -static-libstdc++)
set(PIPER_EXTRA_LIBRARIES "pthread")
endif()
@@ -91,18 +96,18 @@ target_link_libraries(piper
)
target_link_directories(piper PUBLIC
- ${FMT_DIR}/lib
- ${SPDLOG_DIR}/lib
- ${PIPER_PHONEMIZE_DIR}/lib
+ ${FMT_LIBRARY_DIRS}
+ ${SPDLOG_LIBRARY_DIRS}
+ ${ONNXRUNTIME_LIBRARY_DIRS}
)
target_include_directories(piper PUBLIC
- ${FMT_DIR}/include
- ${SPDLOG_DIR}/include
- ${PIPER_PHONEMIZE_DIR}/include
+ ${FMT_INCLUDE_DIRS}
+ ${SPDLOG_INCLUDE_DIRS}
+ ${ONNXRUNTIME_INCLUDE_DIRS}
)
-target_compile_definitions(piper PUBLIC _PIPER_VERSION=${piper_version})
+target_compile_definitions(piper PUBLIC _PIPER_VERSION="${piper_version}")
# ---- Declare test ----
include(CTest)
@@ -116,16 +121,16 @@ target_compile_features(test_piper PUBLIC cxx_std_17)
target_include_directories(
test_piper PUBLIC
- ${FMT_DIR}/include
- ${SPDLOG_DIR}/include
- ${PIPER_PHONEMIZE_DIR}/include
+ ${FMT_INCLUDE_DIRS}
+ ${SPDLOG_INCLUDE_DIRS}
+ ${ONNXRUNTIME_INCLUDE_DIRS}
)
target_link_directories(
test_piper PUBLIC
- ${FMT_DIR}/lib
- ${SPDLOG_DIR}/lib
- ${PIPER_PHONEMIZE_DIR}/lib
+ ${FMT_LIBRARY_DIRS}
+ ${SPDLOG_LIBRARY_DIRS}
+ ${ONNXRUNTIME_LIBRARY_DIRS}
)
target_link_libraries(test_piper PUBLIC
@@ -141,32 +146,3 @@ target_link_libraries(test_piper PUBLIC
install(
TARGETS piper
DESTINATION ${CMAKE_INSTALL_PREFIX})
-
-# Dependencies
-install(
- DIRECTORY ${PIPER_PHONEMIZE_DIR}/bin/
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- USE_SOURCE_PERMISSIONS # keep +x
- FILES_MATCHING
- PATTERN "piper_phonemize"
- PATTERN "espeak-ng"
- PATTERN "*.dll"
-)
-
-install(
- DIRECTORY ${PIPER_PHONEMIZE_DIR}/lib/
- DESTINATION ${CMAKE_INSTALL_PREFIX}
- FILES_MATCHING
- PATTERN "*.dll"
- PATTERN "*.so*"
-)
-
-install(
- DIRECTORY ${PIPER_PHONEMIZE_DIR}/share/espeak-ng-data
- DESTINATION ${CMAKE_INSTALL_PREFIX}
-)
-
-install(
- FILES ${PIPER_PHONEMIZE_DIR}/share/libtashkeel_model.ort
- DESTINATION ${CMAKE_INSTALL_PREFIX}
-)
diff --git a/VERSION b/VERSION
index 26aaba0..867e524 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.0
+1.2.0
\ No newline at end of file
--
2.47.0
|