From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 1A26C15815E for ; Mon, 5 Feb 2024 11:57:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E825DE2A66; Mon, 5 Feb 2024 11:57:41 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 CC1B8E2A66 for ; Mon, 5 Feb 2024 11:57:41 +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 B725C343112 for ; Mon, 5 Feb 2024 11:57:40 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D1BFD14D3 for ; Mon, 5 Feb 2024 11:57:37 +0000 (UTC) From: "David Roman" 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" Message-ID: <1707074777.a27cd8860814a297f487e3b01c36e6e2d3292f04.davidroman@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: eclass/ X-VCS-Repository: repo/proj/guru X-VCS-Files: eclass/rhvoice-lang.eclass X-VCS-Directories: eclass/ X-VCS-Committer: davidroman X-VCS-Committer-Name: David Roman X-VCS-Revision: a27cd8860814a297f487e3b01c36e6e2d3292f04 X-VCS-Branch: master Date: Mon, 5 Feb 2024 11:57:37 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7f61316f-d1d3-456b-8ae7-5af084ae5ee5 X-Archives-Hash: 8d29065df08505eca809ff7a939a7dcf commit: a27cd8860814a297f487e3b01c36e6e2d3292f04 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sat Feb 3 12:00:18 2024 +0000 Commit: David Roman gmail com> CommitDate: Sun Feb 4 19:26:17 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=a27cd886 rhvoice-lang.eclass: new eclass Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/rhvoice-lang.eclass | 109 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/eclass/rhvoice-lang.eclass b/eclass/rhvoice-lang.eclass new file mode 100644 index 0000000000..17e65096f6 --- /dev/null +++ b/eclass/rhvoice-lang.eclass @@ -0,0 +1,109 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: rhvoice-lang.eclass +# @MAINTAINER: +# Anna +# @AUTHOR: +# Anna +# @SUPPORTED_EAPIS: 8 +# @BLURB: eclass for packaging RHVoice languages +# @DESCRIPTION: +# An eclass streamlining the construction of ebuilds for the officially +# supported RHVoice languages. +# +# Look at "src/scripts" files to identify language's license. +# @EXAMPLE: +# +# Most ebuilds will look like this: +# +# @CODE +# +# EAPI=8 +# +# RHVOICE_LANG="Russian" +# inherit rhvoice-lang +# +# LICENSE="LGPL-2.1+" +# +# @CODE + +case ${EAPI} in + 8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ ! ${_RHVOICE_LANG_ECLASS} ]]; then +_RHVOICE_LANG_ECLASS=1 + +# @ECLASS_VARIABLE: RHVOICE_LANG +# @PRE_INHERIT +# @REQUIRED +# @DESCRIPTION: +# Full language name (see "data/languages" in RHVoice source code). + +if [[ ! ${RHVOICE_LANG} ]]; then + die "RHVOICE_LANG must be set before inherit" +fi + +# @ECLASS_VARIABLE: RHVOICE_LANG_REPO +# @PRE_INHERIT +# @DESCRIPTION: +# Repository name under the RHVoice GitHub organization. +: "${RHVOICE_LANG_REPO:=${RHVOICE_LANG:?}}" + +# @ECLASS_VARIABLE: RHVOICE_LANG_TAG +# @PRE_INHERIT +# @DESCRIPTION: +# Tag name for generating SRC_URI. +: "${RHVOICE_LANG_TAG:=${PV}}" + +# @ECLASS_VARIABLE: RHVOICE_LANG_DISTFILE +# @PRE_INHERIT +# @DESCRIPTION: +# Distfile name for generating SRC_URI, should be a ZIP archive. +: "${RHVOICE_LANG_DISTFILE:=RHVoice-language-${RHVOICE_LANG}-v${PV}.zip}" + +DESCRIPTION="${RHVOICE_LANG:?} language support for RHVoice" +HOMEPAGE="https://github.com/RHVoice/${RHVOICE_LANG_REPO:?}" +SRC_URI="https://github.com/RHVoice/${RHVOICE_LANG_REPO}/releases/download/${RHVOICE_LANG_TAG}/${RHVOICE_LANG_DISTFILE} -> ${P}.zip" +S="${WORKDIR}" + +KEYWORDS="~amd64 ~x86" +SLOT="0" + +BDEPEND="app-arch/unzip" + +# @FUNCTION: rhvoice-lang_src_prepare +# @DESCRIPTION: +# Remove stray files such as licenses. +rhvoice-lang_src_prepare() { + debug-print-function ${FUNCNAME} "${@}" + + default_src_prepare + find . -name "COPYING*" -o -name "LICENSE*" -delete || \ + die "removing licenses failed" +} + +# @FUNCTION: rhvoice-lang_src_install +# @DESCRIPTION: +# Install the language. +rhvoice-lang_src_install() { + debug-print-function ${FUNCNAME} "${@}" + + shopt -s nullglob + local docs=( README* ) + shopt -u nullglob + + for doc in "${docs[@]}"; do + dodoc "${doc}" + rm "${doc}" || die "removing ${doc}" failed + done + + insinto /usr/share/RHVoice/languages/${RHVOICE_LANG:?} + doins -r . +} + +fi + +EXPORT_FUNCTIONS src_prepare src_install