commit:     4bd838280b7d4be0f84e0ea6a523a6f14c556136
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 13 18:46:34 2021 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sat Mar 13 20:02:19 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4bd83828

eclass/myspell-r2.eclass: add EAPI support

As this eclass has no EAPI checks, so adding them.
Currently EAPI 5,6 and 7 will be supported, as all existing ebuilds are
currently in EAPI 5 and 6.

This eclass also adds app-arch/unzip to DEPEND.
In order to support EAPI=7, we need to add app-arch/unzip
to BDEPEND instead.

Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 eclass/myspell-r2.eclass | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/eclass/myspell-r2.eclass b/eclass/myspell-r2.eclass
index b75044a383f..8abbed09798 100644
--- a/eclass/myspell-r2.eclass
+++ b/eclass/myspell-r2.eclass
@@ -6,13 +6,12 @@
 # [email protected]
 # @AUTHOR:
 # Tomáš Chvátal <[email protected]>
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: An eclass to streamline the construction of ebuilds for new Myspell 
dictionaries.
 # @DESCRIPTION:
 # The myspell-r2 eclass is designed to streamline the construction of ebuilds 
for
 # the new Myspell dictionaries which support hunspell.
 
-EXPORT_FUNCTIONS src_unpack src_install
-
 # @ECLASS-VARIABLE: MYSPELL_DICT
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -31,11 +30,28 @@ EXPORT_FUNCTIONS src_unpack src_install
 # Array variable containing list of all thesarus files.
 # MYSPELL_THES=( "file.dat" "dir/file2.idx" )
 
+case ${EAPI:-0} in
+       [0-4])
+               die "${ECLASS} is banned in EAPI ${EAPI:-0}"
+               ;;
+       [5-7])
+               ;;
+       *)
+               die "Unknown EAPI ${EAPI:-0}"
+               ;;
+esac
+
+EXPORT_FUNCTIONS src_unpack src_install
+
 # Basically no extra deps needed.
 # Unzip is required for .oxt libreoffice extensions
 # which are just fancy zip files.
-DEPEND="app-arch/unzip"
-RDEPEND=""
+if [[ ${EAPI:-0} == 7 ]]; then
+       BDEPEND="app-arch/unzip"
+else
+       DEPEND="app-arch/unzip"
+       RDEPEND=""
+fi
 
 # by default this stuff does not have any folder in the pack
 S="${WORKDIR}"

Reply via email to