check-reqs.eclass
Name
check-reqs.eclass -- Provides a uniform way of handling ebuilds with very high build requirements
Description
This eclass provides a uniform way of handling ebuilds which have very high
build requirements in terms of memory or disk space. It provides a function
which should usually be called during pkg_setup().
The chosen action only happens when the system's resources are detected correctly and only if they are below the threshold specified by the package.
# need this much memory (does *not* check swap)
CHECKREQS_MEMORY="256M"
# need this much temporary build space
CHECKREQS_DISK_BUILD="2G"
# install will need this much space in /usr
CHECKREQS_DISK_USR="1G"
# install will need this much space in /var
CHECKREQS_DISK_VAR="1024M"
        If you don't specify a value for, say, CHECKREQS_MEMORY, then the test is
not carried out.
These checks should probably mostly work on non-Linux, and they should probably degrade gracefully if they don't. Probably.
Functions
- check-reqs_pkg_setup
 - 
            
Exported function running the resources checks in
pkg_setupphase. It should be run in both phases to ensure condition changes betweenpkg_pretendandpkg_setupwon't affect the build. - check-reqs_pkg_pretend
 - 
            
Exported function running the resources checks in
pkg_pretendphase. 
Variables
- CHECKREQS_MEMORY
 - 
            
How much RAM is needed? Eg.:
CHECKREQS_MEMORY=15M - CHECKREQS_DISK_BUILD
 - 
            
How much diskspace is needed to build the package? Eg.:
CHECKREQS_DISK_BUILD=2T - CHECKREQS_DISK_USR
 - 
            
How much space in /usr is needed to install the package? Eg.:
CHECKREQS_DISK_USR=15G - CHECKREQS_DISK_VAR
 - 
            
How much space is needed in /var? Eg.:
CHECKREQS_DISK_VAR=3000M - CHECKREQS_DONOTHING = 1 (USER VARIABLE)
 - 
            
Do not error out in
_check-reqs_outputif requirements are not met. This is a user flag and should under no circumstances be set in the ebuild. 
Maintainers
QA Team <qa@gentoo.org>
Reporting Bugs
Please report bugs via https://bugs.gentoo.org/