eclass

From Gentoo Wiki
Jump to:navigation Jump to:search

Resources

An eclass is a collection of code which can be used by more than one ebuild.[1] At the time of writing, all eclasses live in the eclass/ directory of the Gentoo ebuild repository.

To use an eclass, it must be inherited. This is done via the inherit function, which is provided by ebuild.sh. The inherit statement must come at the top of the ebuild, before any functions.[2]

FILE autotools-example-9999.ebuildeclass usage snippet
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools

DESCRIPTION="Example ebuild using the autotools eclass"

# ...

External resources

References