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 (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0E9F315821F for ; Sun, 24 Nov 2024 22:47:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 688F6E0B89 for ; Sun, 24 Nov 2024 22:47:35 +0000 (UTC) Received: from sysrq.in (sysrq.in [37.79.202.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DDF65E2B2C for ; Sat, 3 Feb 2024 14:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=sysrq.in; bh=/P2cGFvKJe3 iz5ZBH7tDBOMvv8I0iqwssfjw7QTM10g=; h=references:in-reply-to:date:to: from; d=sysrq.in; b=Y/uZj3SUQzlyOGckBuSbzZ4dsEj32hhOD+pkhy/vhlr3CLcvG7 1ARoSbB6U9p+4ncoIkDyvhrKPbjt3w0bu+6g7OOVsxg8Btd7duob6HbC2EoVBXq62UrjMY nM1vxVCW/QqcIp2vIJsgrlL3RzdfRCtopG/GrEMo19Sos/YJ87dxVapTOSxEGkoArdzYQe +Mgw8BtAfSwiI30mpKEE/3MX6zqLV/A+/wUCeuHo7jvQ1eUOB7bAhtGa3GeDOmmGdlN5Qn l2vsTqGtY/bhLCa0/vfDj/3gH62NRJvxGeW7HFF1yWUtmsglyK0GCNYPRjtQrI3PpFhBaB 6NXZCLj+6hiA== Received: from sysrq.in ( [10.0.0.1]) by sysrq.in (OpenSMTPD) with ESMTPS id a6324150 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Sat, 3 Feb 2024 14:13:36 +0000 (UTC) From: "Anna (cybertailor) Vyalkova" To: gentoo-guru@lists.gentoo.org Subject: [gentoo-guru] [PATCH 1/7] rhvoice-lang.eclass: new eclass Date: Sat, 3 Feb 2024 19:05:13 +0500 Message-ID: <20240203141331.15750-2-cyber+gentoo@sysrq.in> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240203141331.15750-1-cyber+gentoo@sysrq.in> References: <20240203141331.15750-1-cyber+gentoo@sysrq.in> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Discussion on the GURU project and repository X-BeenThere: gentoo-guru@gentoo.org X-BeenThere: gentoo-guru@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 6a2c88f7-fc37-4331-8e84-76ca50522dde X-Archives-Hash: b08f90dd60d77dfe2f8871b409b7d4f6 Signed-off-by: Anna (cybertailor) Vyalkova --- eclass/rhvoice-lang.eclass | 109 +++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 eclass/rhvoice-lang.eclass diff --git a/eclass/rhvoice-lang.eclass b/eclass/rhvoice-lang.eclass new file mode 100644 index 000000000..17e65096f --- /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 -- 2.43.0