From 63029ee3b91f91d06f1ee36fe0198a135dc6fd34 Mon Sep 17 00:00:00 2001 From: liulihong Date: Tue, 14 Nov 2023 11:11:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4espeak=E5=BA=93=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E8=84=9A=E6=9C=AC=E7=AD=89=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liulihong --- thirdparty/espeak/HPKBUILD | 87 +++++++++++++++++++++++++++++ thirdparty/espeak/SHA512SUM | 1 + thirdparty/espeak/espeak_ohos.patch | 22 ++++++++ 3 files changed, 110 insertions(+) create mode 100644 thirdparty/espeak/HPKBUILD create mode 100644 thirdparty/espeak/SHA512SUM create mode 100644 thirdparty/espeak/espeak_ohos.patch diff --git a/thirdparty/espeak/HPKBUILD b/thirdparty/espeak/HPKBUILD new file mode 100644 index 00000000..0ca5ce81 --- /dev/null +++ b/thirdparty/espeak/HPKBUILD @@ -0,0 +1,87 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Contributor: huangminzhong +# Maintainer: huangminzhong + + +pkgname=espeak +pkgver=1.48.04-source +pkgrel=0 +pkgdesc="eSpeak是一个小型的、开放源码的语音合成系统,支持多种语言。" +url="https://sourceforge.net/projects/espeak" +archs=("armeabi-v7a" "arm64-v8a") +license=("GNU GENERAL PUBLIC LICENSE") +depends=("portaudio") +makedepends=() +source="https://sourceforge.net/projects/$pkgname/files/$pkgname/espeak-1.48/$pkgname-$pkgver.zip" + +autounpack=true +downloadpackage=true +buildtools="make" +builddir=$pkgname-$pkgver +packagename=$builddir.zip + +source envset.sh + +prefix= +datadir= +destdir= +patchflag=true + +prepare() { + if [ $patchflag == true ] + then + cd $builddir + patch -p1 < ../espeak_ohos.patch + cp src/portaudio19.h src/portaudio.h + cd $OLDPWD + patchflag=false + fi + + cp -rfa $builddir $builddir-$ARCH-build + + if [ $ARCH == "armeabi-v7a" ] + then + setarm32ENV + fi + if [ $ARCH == "arm64-v8a" ] + then + setarm64ENV + fi + + prefix=$LYCIUM_ROOT/usr/$pkgname/$ARCH + datadir=$prefix/share/espeak-data +} +build() { + cd $builddir-$ARCH-build/src + ${MAKE} VERBOSE=1 DATADIR=$datadir PREFIX=$prefix LDFLAGS="-L$LYCIUM_ROOT/usr/portaudio/$ARCH/lib" >> $buildlog 2>&1 + ret=$? + cd $OLDPWD + return $ret +} + +package() { + cd $builddir-$ARCH-build/src + ${MAKE} PREFIX=$prefix DATADIR=$datadir install >> $buildlog 2>&1 + cd $OLDPWD +} + +check() { + echo "The test must be on an OpenHarmony device!" +} + +# 清理环境 +cleanbuild() { + rm -rf ${PWD}/$builddir ${PWD}/$builddir-armeabi-v7a-build ${PWD}/$builddir-arm64-v8a-build #${PWD}/$packagename +} diff --git a/thirdparty/espeak/SHA512SUM b/thirdparty/espeak/SHA512SUM new file mode 100644 index 00000000..bc4515b5 --- /dev/null +++ b/thirdparty/espeak/SHA512SUM @@ -0,0 +1 @@ +f0759e6ace2604c8cbb19e8c3fd4b106edf4dcece247a6677f6b734af7746c35a367126edfbe585396c98f6c54f07e25d64bfab35e258e64f09bd2c0833247fa espeak-1.48.04-source.zip \ No newline at end of file diff --git a/thirdparty/espeak/espeak_ohos.patch b/thirdparty/espeak/espeak_ohos.patch new file mode 100644 index 00000000..e4a0e3f4 --- /dev/null +++ b/thirdparty/espeak/espeak_ohos.patch @@ -0,0 +1,22 @@ +diff -Naur espeak-1.48.04-source/src/event.cpp espeak-1.48.04-source_ohos/src/event.cpp +--- espeak-1.48.04-source/src/event.cpp 2014-03-04 08:47:15.000000000 -0800 ++++ espeak-1.48.04-source_ohos/src/event.cpp 2023-11-01 02:19:33.268631600 -0700 +@@ -720,7 +720,6 @@ + + if (thread_inited) + { +- pthread_cancel(my_thread); + pthread_join(my_thread,NULL); + pthread_mutex_destroy(&my_mutex); + sem_destroy(&my_sem_start_is_required); +diff -Naur espeak-1.48.04-source/src/fifo.cpp espeak-1.48.04-source_ohos/src/fifo.cpp +--- espeak-1.48.04-source/src/fifo.cpp 2014-03-04 08:47:15.000000000 -0800 ++++ espeak-1.48.04-source_ohos/src/fifo.cpp 2023-11-01 02:20:00.377179298 -0700 +@@ -595,7 +595,6 @@ + { + ENTER("fifo_terminate"); + +- pthread_cancel(my_thread); + pthread_join(my_thread,NULL); + pthread_mutex_destroy(&my_mutex); + sem_destroy(&my_sem_start_is_required); -- Gitee