summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlphaJack2024-03-06 15:05:33 +0100
committerAlphaJack2024-03-06 15:05:33 +0100
commit352987b5cc39ddcfc9191fb6e9b5cf03e55328a1 (patch)
treebb873866bd9bb2c04b5b7868059dcf040d009112
downloadaur-352987b5cc39ddcfc9191fb6e9b5cf03e55328a1.tar.gz
Initial commit
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD50
2 files changed, 63 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9d015e9a2212
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,13 @@
+pkgbase = piper-voices-it-it
+ pkgdesc = Voices for Piper text to speech system (it_IT)
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://huggingface.co/rhasspy/piper-voices
+ arch = any
+ groups = piper-voices
+ license = MIT
+ makedepends = git-lfs
+ depends = piper-voices-common
+ provides = piper-voices
+
+pkgname = piper-voices-it-it
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9644c3399339
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: AlphaJack <alphajack at tuta dot io>
+
+# to create a package for another locale, check the available locales from
+# https://huggingface.co/rhasspy/piper-voices/tree/main
+# then copy this PKGBUILD and adjust $_lang and $_region accordingly
+
+_lang="it"
+_region="IT"
+
+_regionSmall=${_region,,}
+_locale="${_lang}_${_region}"
+pkgname="piper-voices-${_lang}-${_regionSmall}"
+pkgver=1.0.0
+pkgrel=1
+pkgdesc="Voices for Piper text to speech system ($_locale)"
+url="https://huggingface.co/rhasspy/piper-voices"
+license=("MIT")
+arch=("any")
+groups=("piper-voices")
+provides=("piper-voices")
+depends=("piper-voices-common")
+makedepends=("git-lfs")
+
+prepare(){
+ # needed to avoid smudge error
+ rm -rf "piper-voices"
+
+ # download the full repo (~220MB) but keep the lfs pointers
+ GIT_LFS_SKIP_SMUDGE=1 git clone "https://huggingface.co/rhasspy/piper-voices"
+
+ # define specific models to be downloaded
+ cd "piper-voices"
+ mapfile -t _models < <(find . -type f -name "*$_locale*.onnx" -printf "/%P\n")
+ echo 'Downloading the following models:'
+ printf '%s\n' ${_models[*]}
+
+ # convert specific lfs pointers into actual models
+ git lfs pull --include $(IFS=,; echo "${_models[*]}")
+}
+
+package(){
+ # copy only the specific locale
+ cd "piper-voices"
+ install -d "$pkgdir/usr/share/piper-voices/$_lang"
+ cp -r "$_lang/$_locale" "$pkgdir/usr/share/piper-voices/$_lang"
+
+ # remove mp3 samples
+ find "$pkgdir/usr/share/piper-voices" -type d -name 'samples' -exec rm -rf {} +
+}
+