Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Package Request] RHVoice #26349

Closed
zenny opened this issue Nov 13, 2020 · 8 comments
Closed

[Package Request] RHVoice #26349

zenny opened this issue Nov 13, 2020 · 8 comments
Labels

Comments

@zenny
Copy link

zenny commented Nov 13, 2020

Package Name

RHVoice

Package Source

https://github.com/Olga-Yakovleva/RHVoice

Application

TTS (text-to-speech)

Rationale

Better sounds than espeak and flite

Licenses

LGPL, GPL, CC

@zenny
Copy link
Author

zenny commented Nov 15, 2020

Hi, I am trying to build RHvoice package from the source (https://github.com/Olga-Yakovleva/RHVoice). Just saw an AUR build (https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=rhvoice) and tried to make an xbps-src template. See http://ix.io/2Edy. Any inputs to make it compatible appreciated! Thanks!

# Template file for 'rhvoice-git'
pkgname=rhvoice-git
version=1.2.3.r37.2dc35bc
revision=1
build_style=gnu-configure
configure_args="--disable-multilib
 --disable-bootstrap
 --disable-lto
 --enable-checking=release
 --enable-host-shared
 --enable-languages=jit"
hostmakedepends="git scons speech-dispatcher portaudio libao"
makedepends="libpulse"
short_desc="Free and open source speech synthesizer for Russian and other languages. (development version"
maintainer="null"
license="GPL-3.0-or-later"
homepage="https://github.com/Olga-Yakovleva/RHVoice"
distfiles="${pkgname%-git}::'git+https://github.com/Olga-Yakovleva/RHVoice.git')"
checksum=SKIP
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
backup=('etc/RHVoice/RHVoice.conf')
wrksrc="rhvoice-${version}"

version() {
        cd "$srcdir/${pkgname%-git}"
        printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

build() {
        cd "$srcdir/${pkgname%-git}"
        scons prefix="/usr" sysconfdir="/etc" CPPFLAGS="$CPPFLAGS" CCFLAGS="$CFLAGS" \
              LINKFLAGS="$LDFLAGS"
}

package() {
        cd "$srcdir/${pkgname%-git}"
        mkdir -p "${pkgdir}/usr/lib/speech-dispatcher-modules"
        scons install DESTDIR="${pkgdir}" prefix="/usr" sysconfdir="/etc" \
              CPPFLAGS="$CPPFLAGS" CCFLAGS="$CFLAGS" LINKFLAGS="$LDFLAGS"
        ln -s "/usr/bin/sd_rhvoice" "${pkgdir}/usr/lib/speech-dispatcher-modules/sd_rhvoice"
}

@ericonr
Copy link
Member

ericonr commented Nov 15, 2020

Void tries not to merge git packages; do you think they have a chance of doing actual releases?

Have you tried using this template? As is, it won't work at all, as far as I can tell. I'd recommend using build_style=scons for starters, and checking out other templates that use it for a suggested template structure.

@zenny
Copy link
Author

zenny commented Nov 20, 2020

Void tries not to merge git packages; do you think they have a chance of doing actual releases?

Have you tried using this template? As is, it won't work at all, as far as I can tell. I'd recommend using build_style=scons for starters, and checking out other templates that use it for a suggested template structure.

I tried with the following template to build from the stable repo:

# Template file for 'rhvoice'
pkgname=rhvoice
version=1.2.3
revision=1
wrksrc="RHVoice-${version}"
build_style=scons
depends="speech-dispatcher libpulseaudio"
makedepends="scons portaudio libao"
optdepends="'portaudio: for portaudio backend' 'libao: for ao backend'"
backup="etc/RHVoice/RHVoice.conf"
short_desc="Free and open source speech synthesizer for Russian and other languages"
maintainer="/dev/null"
license="GPL-3.0-or-later"
homepage="https://github.com/Olga-Yakovleva/RHVoice"
distfiles="https://github.com/Olga-Yakovleva/RHVoice/archive/${version}.tar.gz"
checksum=d104f20dc75fcd133d21751a6e894d34b423e12e4784350b4b9573c727fb71cd


build() {
        cd "$wrksrc/RHVoice-${version}"
        scons prefix="/usr" sysconfdir="/etc" CPPFLAGS="$CPPFLAGS" CCFLAGS="$CFLAGS" \
              LINKFLAGS="$LDFLAGS"
}

package() {
        cd "$wrksrc/RHVoice-${version}"
        mkdir -p "${pkgdir}/usr/lib/speech-dispatcher-modules"
scons install DESTDIR="${pkgdir}" prefix="/usr" sysconfdir="/etc" \
              CPPFLAGS="$CPPFLAGS" CCFLAGS="$CFLAGS" LINKFLAGS="$LDFLAGS"
        ln -s "/usr/bin/sd_rhvoice" "${pkgdir}/usr/lib/speech-dispatcher-modules/sd_rhvoice"
}

It builds the package, but there is no /usr/bin/sd_rdvoice found after installation of the package. :( Any input?

@ericonr
Copy link
Member

ericonr commented Nov 20, 2020

We don't use pkgdir, we use DESTDIR.

@zenny
Copy link
Author

zenny commented Nov 20, 2020

We don't use pkgdir, we use DESTDIR.

Thanks @ericonr.

I replaced all instances of pkgdir with DESTDIR,

# Template file for 'rhvoice'
pkgname=rhvoice
version=1.2.3
revision=1
wrksrc="RHVoice-${version}"
build_style=scons
depends="speech-dispatcher libpulseaudio"
makedepends="scons portaudio libao"
optdepends="'portaudio: for portaudio backend' 'libao: for ao backend'"
backup="etc/RHVoice/RHVoice.conf"
short_desc="Free and open source speech synthesizer for Russian and other languages"
maintainer="/dev/null"
license="GPL-3.0-or-later"
homepage="https://github.com/Olga-Yakovleva/RHVoice"
distfiles="https://github.com/Olga-Yakovleva/RHVoice/archive/${version}.tar.gz"
checksum=d104f20dc75fcd133d21751a6e894d34b423e12e4784350b4b9573c727fb71cd


build() {
        cd "$wrksrc/RHVoice-${version}"
        scons prefix="/usr" sysconfdir="/etc" CPPFLAGS="$CPPFLAGS" CCFLAGS="$CFLAGS" \
              LINKFLAGS="$LDFLAGS"
}

package() {
        cd "$wrksrc/RHVoice-${version}"
        mkdir -p "${DESTDIR}/usr/lib/speech-dispatcher-modules"
scons install DESTDIR="${DESTDIR}" prefix="/usr" sysconfdir="/etc" \
              CPPFLAGS="$CPPFLAGS" CCFLAGS="$CFLAGS" LINKFLAGS="$LDFLAGS"
        ln -s "/usr/bin/sd_rhvoice" "${DESTDIR}/usr/lib/speech-dispatcher-modules/sd_rhvoice"

Also, appended following 3 lines to common/shlibs

$ rg libRHVoice common/shlibs
3997:libRHVoice.so.5 rhvoice-1.2.3_1
3998:libRHVoice_audio.so.2 rhvoice-1.2.3_1
3999:libRHVoice_core.so.4 rhvoice-1.2.3_1

The package gets built, but it does not behave as expected (no RHVoice binary nor sd_rhvoice installed) after running $ sudo xbps-install --repository=hostdir/binpkgs rhvoice. No errors either.

@ericonr
Copy link
Member

ericonr commented Dec 18, 2020

@zenny is this still necessary given work on #27193 on espeak-ng?

The build and package functions aren't doing anything, void uses do_build and do_install for this functionality. You don't really need them, though. Just make post_install with

ln -s "../lib/speech-dispatcher-modules/sd_rhvoice" "${DESTDIR}/usr/bin/sd_rhvoice"

and you should be good.

@zenny
Copy link
Author

zenny commented Feb 19, 2021

@zenny is this still necessary given work on #27193 on espeak-ng?

Yep, because espeak-ng produces robotic voice whereas rhvoice has more natural output.

The build and package functions aren't doing anything, void uses do_build and do_install for this functionality. You don't really need them, though. Just make post_install with

ln -s "../lib/speech-dispatcher-modules/sd_rhvoice" "${DESTDIR}/usr/bin/sd_rhvoice"
# Template file for 'RHVoice'
pkgname=rhvoice
version=1.2.3
revision=1
wrksrc="RHVoice-${version}"
build_style=scons
depends="speech-dispatcher libpulseaudio"
makedepends="scons portaudio libao"
optdepends="'portaudio: for portaudio backend' 'libao: for ao backend'"
backup="etc/RHVoice/RHVoice.conf"
short_desc="Free and open source speech synthesizer for Russian and other languages"
maintainer="zenny"
license="GPL-3.0-or-later"
homepage="https://github.com/Olga-Yakovleva/RHVoice"
distfiles="https://github.com/Olga-Yakovleva/RHVoice/archive/${version}.tar.gz"
checksum=d104f20dc75fcd133d21751a6e894d34b423e12e4784350b4b9573c727fb71cd


do_build() {
	cd "$wrksrc/RHVoice-${version}"
	scons prefix="/usr" sysconfdir="/etc" CPPFLAGS="$CPPFLAGS" CCFLAGS="$CFLAGS" \
	      LINKFLAGS="$LDFLAGS"
}

post_install() {
	cd "$wrksrc/RHVoice-${version}"
	mkdir -p "${DESTDIR}/usr/lib/speech-dispatcher-modules"
scons install DESTDIR="${DESTDIR}" prefix="/usr" sysconfdir="/etc" \
	      CPPFLAGS="$CPPFLAGS" CCFLAGS="$CFLAGS" LINKFLAGS="$LDFLAGS"
	      ln -s "../lib/speech-dispatcher-modules/sd_rhvoice" "${DESTDIR}/usr/bin/sd_rhvoice"
}

With above, error reported were missing [runtime] speech-dispatcher-0.10.1_3 among others:

$ ./xbps-src pkg rhvoice
=> xbps-src: updating repositories for host (x86_64)...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/x86_64-repodata' ...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/nonfree/x86_64-repodata' ...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/debug/x86_64-repodata' ...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/multilib/x86_64-repodata' ...
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/multilib/nonfree/x86_64-repodata' ...
=> xbps-src: updating software in / masterdir...
=> xbps-src: cleaning up / masterdir...
=> rhvoice-1.2.3_1: removing autodeps, please wait...
=> rhvoice-1.2.3_1: building [scons] for x86_64...
  [host] scons-4.0.1_2: found (https://alpha.de.repo.voidlinux.org/current)
  [target] scons-4.0.1_2: found (https://alpha.de.repo.voidlinux.org/current)
  [target] portaudio-190600.20161030_6: found (https://alpha.de.repo.voidlinux.org/current)
  [target] libao-1.2.2_1: found (https://alpha.de.repo.voidlinux.org/current)
  [runtime] speech-dispatcher-0.10.1_3: not found
  [runtime] libpulseaudio-14.2_1: found (https://alpha.de.repo.voidlinux.org/current)
=> rhvoice-1.2.3_1: installing host dependencies: scons-4.0.1_2 ...
=> rhvoice-1.2.3_1: installing target dependencies: scons-4.0.1_2 portaudio-190600.20161030_6 libao-1.2.2_1 ...
=> rhvoice-1.2.3_1: running pre-build hook: 02-script-wrapper ...
=> rhvoice-1.2.3_1: running do_build ...
/void-packages/srcpkgs/rhvoice/template: line 20: cd: /builddir/RHVoice-1.2.3/RHVoice-1.2.3: No such file or directory
=> ERROR: rhvoice-1.2.3_1: do_build: 'cd "$wrksrc/RHVoice-${version}"' exited with 1
=> ERROR:   in do_build() at srcpkgs/rhvoice/template:20

and you should be good.

Cheers,

@github-actions
Copy link

Issues become stale 90 days after last activity and are closed 14 days after that. If this issue is still relevant bump it or assign it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants