void-packages/srcpkgs/qt5-speech/template

79 lines
2.6 KiB
Bash

# Template file for 'qt5-speech'
pkgname=qt5-speech
version=5.15.11
revision=1
_commit=d32f4a479d38a11f547598004b975f4356424a16
build_style=qmake
configure_args="-- -flite -flite-alsa -speechd"
hostmakedepends="qt5-qmake perl qt5-host-tools pkg-config"
makedepends="qt5-tools-devel speech-dispatcher-devel flite-devel
alsa-lib-devel qt5-multimedia-devel"
short_desc="Cross-platform application and UI framework (QT5) - Speech component"
maintainer="John <me@johnnynator.dev>"
license="GPL-3.0-or-later, LGPL-3.0-or-later"
homepage="https://invent.kde.org/qt/qt/qtspeech"
distfiles="https://invent.kde.org/qt/qt/qtspeech/-/archive/v${version}-lts-lgpl/qtspeech-v${version}-lts-lgpl.tar.gz"
checksum=f29523be4119168dc0bba16e53c8e7c86ebdfa8556e14775c48c83347f90ef86
_cleanup_wrksrc_leak() {
if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
# Replace references to ${wrksrc} in cmake files
sed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
fi
if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
# Replace references to ${wrksrc} in pkgconfig files
sed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
fi
# Remove QMAKE_PRL_BUILD_DIR from hint files for static libraries
# and replace references to ${wrksrc}
find ${PKGDESTDIR} -iname "*.prl" -exec sed -i "{}" \
-e "/^QMAKE_PRL_BUILD_DIR/d" \
-e "s;-L${wrksrc}/qtbase/lib;-L/usr/lib;g" \;
# Replace ${wrksrc} in project include files
find ${PKGDESTDIR} -iname "*.pri" -exec sed -i "{}" \
-e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \;
}
post_extract() {
mkdir .git
}
post_install() {
sed -e "s/%%VERSION%%/${version}/g" ${FILESDIR}/Qt5TextToSpeechConfig.cmake > \
${DESTDIR}/usr/lib/cmake/Qt5TextToSpeech/Qt5TextToSpeechConfig.cmake
}
qt5-speech-devel_package() {
depends="qt5-devel>=${version} ${sourcepkg}>=${version}_${revision}
${sourcepkg}-plugin-speechd>=${version}_${revision}
${sourcepkg}-plugin-flite>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/cmake
vmove usr/lib/pkgconfig
vmove usr/lib/qt5/mkspecs
vmove "usr/lib/*.so"
vmove "usr/lib/*.prl"
_cleanup_wrksrc_leak
}
}
qt5-speech-plugin-speechd_package() {
short_desc+=" - Speech dispatcher Plugin"
pkg_install() {
vmove usr/lib/qt5/plugins/texttospeech/libqtexttospeech_speechd.so
}
}
qt5-speech-plugin-flite_package() {
short_desc+=" - Flite Plugin"
pkg_install() {
vmove usr/lib/qt5/plugins/texttospeech/libqttexttospeech_flite.so
}
}