Skip to content

Commit

Permalink
eclass: standardize prologue/epilogue
Browse files Browse the repository at this point in the history
Closes: gentoo#30061
Signed-off-by: David Seifert <[email protected]>
  • Loading branch information
SoapGentoo committed Mar 17, 2023
1 parent b5240fb commit 2cba2db
Show file tree
Hide file tree
Showing 68 changed files with 382 additions and 374 deletions.
9 changes: 5 additions & 4 deletions eclass/acct-group.eclass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2022 Gentoo Authors
# Copyright 2019-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: acct-group.eclass
Expand Down Expand Up @@ -36,9 +36,9 @@
if [[ -z ${_ACCT_GROUP_ECLASS} ]]; then
_ACCT_GROUP_ECLASS=1

case ${EAPI:-0} in
case ${EAPI} in
7|8) ;;
*) die "EAPI=${EAPI:-0} not supported";;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

inherit user-info
Expand Down Expand Up @@ -83,7 +83,6 @@ S=${WORKDIR}


# << Phase functions >>
EXPORT_FUNCTIONS pkg_pretend src_install pkg_preinst

# @FUNCTION: acct-group_pkg_pretend
# @DESCRIPTION:
Expand Down Expand Up @@ -184,3 +183,5 @@ acct-group_pkg_preinst() {
}

fi

EXPORT_FUNCTIONS pkg_pretend src_install pkg_preinst
10 changes: 5 additions & 5 deletions eclass/acct-user.eclass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2022 Gentoo Authors
# Copyright 2019-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: acct-user.eclass
Expand Down Expand Up @@ -44,9 +44,9 @@
if [[ -z ${_ACCT_USER_ECLASS} ]]; then
_ACCT_USER_ECLASS=1

case ${EAPI:-0} in
case ${EAPI} in
7|8) ;;
*) die "EAPI=${EAPI:-0} not supported";;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

inherit user-info
Expand Down Expand Up @@ -212,8 +212,6 @@ eislocked() {
}

# << Phase functions >>
EXPORT_FUNCTIONS pkg_pretend src_install pkg_preinst pkg_postinst \
pkg_prerm

# @FUNCTION: acct-user_pkg_pretend
# @DESCRIPTION:
Expand Down Expand Up @@ -490,3 +488,5 @@ acct-user_pkg_prerm() {
}

fi

EXPORT_FUNCTIONS pkg_pretend src_install pkg_preinst pkg_postinst pkg_prerm
7 changes: 6 additions & 1 deletion eclass/ada.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

EXPORT_FUNCTIONS pkg_setup
if [[ -z ${_ADA_ECLASS} ]]; then
_ADA_ECLASS=1

# @ECLASS_VARIABLE: ADA_DEPS
# @OUTPUT_VARIABLE
Expand Down Expand Up @@ -523,3 +524,7 @@ ada_pkg_setup() {

[[ ${MERGE_TYPE} != binary ]] && ada_setup
}

fi

EXPORT_FUNCTIONS pkg_setup
11 changes: 8 additions & 3 deletions eclass/ant-tasks.eclass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2007-2022 Gentoo Authors
# Copyright 2007-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: ant-tasks.eclass
Expand All @@ -18,14 +18,15 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

if [[ -z ${_ANT_TASKS_ECLASS} ]]; then
_ANT_TASKS_ECLASS=1

# we set ant-core dep ourselves, restricted
JAVA_ANT_DISABLE_ANT_CORE_DEP=true
# rewriting build.xml for are the testcases has no reason atm
JAVA_PKG_BSFIX_ALL=no
inherit java-pkg-2 java-ant-2

EXPORT_FUNCTIONS src_unpack src_compile src_install

# @ECLASS_VARIABLE: ANT_TASK_JDKVER
# @PRE_INHERIT
# @DESCRIPTION:
Expand Down Expand Up @@ -164,3 +165,7 @@ ant-tasks_src_install() {
dodir /usr/share/ant/lib
dosym /usr/share/${PN}/lib/${PN}.jar /usr/share/ant/lib/${PN}.jar
}

fi

EXPORT_FUNCTIONS src_unpack src_compile src_install
16 changes: 7 additions & 9 deletions eclass/autotools.eclass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: autotools.eclass
Expand All @@ -13,6 +13,11 @@
# Note: We require GNU m4, as does autoconf. So feel free to use any features
# from the GNU version of m4 without worrying about other variants (i.e. BSD).

case ${EAPI} in
6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

if [[ ${_AUTOTOOLS_AUTO_DEPEND+set} == "set" ]] ; then
# See if we were included already, but someone changed the value
# of AUTOTOOLS_AUTO_DEPEND on us. We could reload the entire
Expand All @@ -26,14 +31,7 @@ fi
if [[ -z ${_AUTOTOOLS_ECLASS} ]] ; then
_AUTOTOOLS_ECLASS=1

case ${EAPI} in
6)
# Needed for eqawarn
inherit eutils
;;
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
esac
[[ ${EAPI} == 6 ]] && inherit eqawarn

inherit gnuconfig libtool

Expand Down
8 changes: 4 additions & 4 deletions eclass/bzr.eclass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: bzr.eclass
Expand All @@ -21,15 +21,13 @@

case ${EAPI} in
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} is not supported" ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

PROPERTIES+=" live"

BDEPEND="dev-vcs/breezy"

EXPORT_FUNCTIONS src_unpack

# @ECLASS_VARIABLE: EBZR_STORE_DIR
# @USER_VARIABLE
# @DESCRIPTION:
Expand Down Expand Up @@ -255,3 +253,5 @@ bzr_fetch() {
bzr_src_unpack() {
bzr_fetch
}

EXPORT_FUNCTIONS src_unpack
23 changes: 11 additions & 12 deletions eclass/cargo.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@
# @SUPPORTED_EAPIS: 7 8
# @BLURB: common functions and variables for cargo builds

case ${EAPI} in
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

if [[ -z ${_CARGO_ECLASS} ]]; then
_CARGO_ECLASS=1

# check and document RUST_DEPEND and options we need below in case conditions.
# https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md
RUST_DEPEND="virtual/rust"

case "${EAPI:-0}" in
0|1|2|3|4|5|6)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
case ${EAPI} in
7)
# 1.37 added 'cargo vendor' subcommand and net.offline config knob
RUST_DEPEND=">=virtual/rust-1.37.0"
;;

8)
# 1.39 added --workspace
# 1.46 added --target dir
Expand All @@ -40,17 +41,11 @@ case "${EAPI:-0}" in
die "CRATES variable not defined"
fi
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
;;
esac

inherit multiprocessing toolchain-funcs

if [[ ! ${CARGO_OPTIONAL} ]]; then
BDEPEND="${RUST_DEPEND}"
EXPORT_FUNCTIONS src_unpack src_configure src_compile src_install src_test
fi
[[ ! ${CARGO_OPTIONAL} ]] && BDEPEND="${RUST_DEPEND}"

IUSE="${IUSE} debug"

Expand Down Expand Up @@ -549,3 +544,7 @@ cargo_src_test() {
}

fi

if [[ ! ${CARGO_OPTIONAL} ]]; then
EXPORT_FUNCTIONS src_unpack src_configure src_compile src_install src_test
fi
10 changes: 5 additions & 5 deletions eclass/check-reqs.eclass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2004-2022 Gentoo Authors
# Copyright 2004-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: check-reqs.eclass
Expand Down Expand Up @@ -40,12 +40,10 @@

case ${EAPI} in
6|7|8) ;;
*) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

EXPORT_FUNCTIONS pkg_pretend pkg_setup

if [[ ! ${_CHECK_REQS_ECLASS} ]]; then
if [[ -z ${_CHECK_REQS_ECLASS} ]]; then
_CHECK_REQS_ECLASS=1

# @ECLASS_VARIABLE: CHECKREQS_MEMORY
Expand Down Expand Up @@ -467,3 +465,5 @@ _check-reqs_unsatisfied() {
}

fi

EXPORT_FUNCTIONS pkg_pretend pkg_setup
4 changes: 2 additions & 2 deletions eclass/chromium-2.eclass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: chromium-2.eclass
Expand All @@ -11,7 +11,7 @@

case ${EAPI} in
7|8) ;;
*) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

inherit linux-info
Expand Down
4 changes: 2 additions & 2 deletions eclass/cmake-multilib.eclass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: cmake-multilib.eclass
Expand Down Expand Up @@ -36,7 +36,7 @@ case ${EAPI} in
;;
esac
;;
*) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then
Expand Down
2 changes: 1 addition & 1 deletion eclass/cmake.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

case ${EAPI} in
7|8) ;;
*) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

if [[ -z ${_CMAKE_ECLASS} ]]; then
Expand Down
10 changes: 5 additions & 5 deletions eclass/common-lisp-3.eclass
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: common-lisp-3.eclass
Expand All @@ -11,15 +11,15 @@
# to provide a simple way to write ebuilds with these characteristics.

case ${EAPI} in
[67]) ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
6|7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

inherit eutils

if [[ -z ${_COMMON_LISP_3_ECLASS} ]]; then
_COMMON_LISP_3_ECLASS=1

inherit eutils

# @ECLASS_VARIABLE: CLIMPLEMENTATIONS
# @DESCRIPTION:
# Common Lisp implementations
Expand Down
25 changes: 9 additions & 16 deletions eclass/cuda.eclass
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

case "${EAPI:-0}" in
[0-6])
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
7|8)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
;;
esac

# @ECLASS: cuda.eclass
# @MAINTAINER:
# Gentoo Science Project <[email protected]>
Expand All @@ -25,10 +14,15 @@ esac
# @EXAMPLE:
# inherit cuda

case ${EAPI} in
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

if [[ -z ${_CUDA_ECLASS} ]]; then
_CUDA_ECLASS=1

inherit flag-o-matic toolchain-funcs
[[ ${EAPI} == [56] ]] && inherit eapi7-ver

# @ECLASS_VARIABLE: NVCCFLAGS
# @DESCRIPTION:
Expand Down Expand Up @@ -195,7 +189,6 @@ cuda_src_prepare() {
cuda_sanitize
}

EXPORT_FUNCTIONS src_prepare

_CUDA_ECLASS=1
fi

EXPORT_FUNCTIONS src_prepare
Loading

0 comments on commit 2cba2db

Please sign in to comment.