From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1597540-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 967E015815E
	for <garchives@archives.gentoo.org>; Mon,  5 Feb 2024 11:57:47 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 90640E2A6D;
	Mon,  5 Feb 2024 11:57:42 +0000 (UTC)
Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 637DEE2A6C
	for <gentoo-commits@lists.gentoo.org>; Mon,  5 Feb 2024 11:57:42 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id A0FF1343111
	for <gentoo-commits@lists.gentoo.org>; Mon,  5 Feb 2024 11:57:41 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 3E30314D8
	for <gentoo-commits@lists.gentoo.org>; Mon,  5 Feb 2024 11:57:38 +0000 (UTC)
From: "David Roman" <davidroman96@gmail.com>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "David Roman" <davidroman96@gmail.com>
Message-ID: <1707074778.3378f870a916cbcbe0db2706b9df3ab88f5babd8.davidroman@gentoo>
Subject: [gentoo-commits] repo/proj/guru:master commit in: eclass/
X-VCS-Repository: repo/proj/guru
X-VCS-Files: eclass/rhvoice-voice.eclass
X-VCS-Directories: eclass/
X-VCS-Committer: davidroman
X-VCS-Committer-Name: David Roman
X-VCS-Revision: 3378f870a916cbcbe0db2706b9df3ab88f5babd8
X-VCS-Branch: master
Date: Mon,  5 Feb 2024 11:57:38 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 6e93dd3b-f287-4c80-b6ed-ec9d5c0c71d3
X-Archives-Hash: 7f86a0d7e7e692e25b0a4445d519676a

commit:     3378f870a916cbcbe0db2706b9df3ab88f5babd8
Author:     Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Sat Feb  3 14:03:03 2024 +0000
Commit:     David Roman <davidroman96 <AT> gmail <DOT> com>
CommitDate: Sun Feb  4 19:26:18 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3378f870

rhvoice-voice.eclass: new eclass

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>

 eclass/rhvoice-voice.eclass | 102 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 102 insertions(+)

diff --git a/eclass/rhvoice-voice.eclass b/eclass/rhvoice-voice.eclass
new file mode 100644
index 0000000000..796019f21d
--- /dev/null
+++ b/eclass/rhvoice-voice.eclass
@@ -0,0 +1,102 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: rhvoice-voice.eclass
+# @MAINTAINER:
+# Anna <cyber+gentoo@sysrq.in>
+# @AUTHOR:
+# Anna <cyber+gentoo@sysrq.in>
+# @SUPPORTED_EAPIS: 8
+# @BLURB: eclass for packaging RHVoice voices
+# @DESCRIPTION:
+# An eclass streamlining the construction of ebuilds for the officially
+# supported RHVoice voices.
+#
+# Look at "copyright" files to identify voice's license.
+# @EXAMPLE:
+#
+# Most ebuilds will look like this:
+#
+# @CODE
+#
+# EAPI=8
+#
+# RHVOICE_VOICE="arina"
+# RHVOICE_VOICE_REPO="arina-rus"
+# RHVOICE_VOICE_L10N="ru"
+# inherit rhvoice-voice
+#
+# LICENSE="CC-BY-NC-ND-4.0"
+#
+# @CODE
+
+case ${EAPI} in
+	8) ;;
+	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ ! ${_RHVOICE_VOICE_ECLASS} ]]; then
+_RHVOICE_VOICE_ECLASS=1
+
+# @ECLASS_VARIABLE: RHVOICE_VOICE
+# @PRE_INHERIT
+# @REQUIRED
+# @DESCRIPTION:
+# Voice name (see "data/voices" in RHVoice source code).
+
+# @ECLASS_VARIABLE: RHVOICE_VOICE_L10N
+# @PRE_INHERIT
+# @REQUIRED
+# @DESCRIPTION:
+# Language name in L10N USE_EXPAND syntax.
+
+if [[ ! ${RHVOICE_VOICE} ]]; then
+	die "RHVOICE_VOICE must be set before inherit"
+fi
+
+if [[ ! ${RHVOICE_VOICE_L10N} ]]; then
+	die "RHVOICE_VOICE_L10N must be set before inherit"
+fi
+
+# @ECLASS_VARIABLE: RHVOICE_VOICE_REPO
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Repository name under the RHVoice GitHub organization.
+: "${RHVOICE_VOICE_REPO:=${RHVOICE_VOICE:?}}"
+
+# @ECLASS_VARIABLE: RHVOICE_VOICE_TAG
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Tag name for generating SRC_URI.
+: "${RHVOICE_VOICE_TAG:=${PV}}"
+
+# @ECLASS_VARIABLE: RHVOICE_VOICE_DISTFILE
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Distfile name for generating SRC_URI, should be a ZIP archive.
+: "${RHVOICE_VOICE_DISTFILE:=data.zip}"
+
+DESCRIPTION="RHVoice voice: ${RHVOICE_VOICE:?} (${RHVOICE_VOICE_L10N:?})"
+HOMEPAGE="https://github.com/RHVoice/${RHVOICE_VOICE_REPO:?}"
+SRC_URI="https://github.com/RHVoice/${RHVOICE_VOICE_REPO}/releases/download/${RHVOICE_VOICE_TAG}/${RHVOICE_VOICE_DISTFILE} -> ${P}.zip"
+S="${WORKDIR}"
+
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+
+RDEPEND="app-accessibility/rhvoice-core[l10n_${RHVOICE_VOICE_L10N}]"
+BDEPEND="app-arch/unzip"
+
+# @FUNCTION: rhvoice-voice_src_install
+# @DESCRIPTION:
+# Install the voice.
+rhvoice-voice_src_install() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	insinto /usr/share/RHVoice/voices/${RHVOICE_VOICE:?}
+	doins -r .
+}
+
+fi
+
+EXPORT_FUNCTIONS src_install