SCONS-UTILS.ECLASS

Section: eclass-manpages (5)
Updated: Apr 2024
Index Return to Main Contents

NAME

scons-utils.eclass - helper functions to deal with SCons buildsystem

DESCRIPTION

This eclass provides a set of function to help developers sanely call dev-build/scons and pass parameters to it.

As of dev-build/scons-3.0.1-r100, SCons supports Python 3. Since SCons* files in build systems are written as Python, all packages need to explicitly verify which versions of Python are supported and use appropriate Python suite eclass to select the implementation. The eclass needs to be inherited before scons-utils, and scons-utils will automatically take advantage of it. For more details, please see: https://projects.gentoo.org/python/guide/buildsys.html#scons

Please note that SCons is more like a 'build system creation kit', and requires a lot of upstream customization to be used sanely. We attempt to force sane behavior via custom patching but this is not guaranteed to work. You will sometimes need to request fixes upstream and/or patch the build system. In particular, normally:

1. There are no 'standard' variables. To respect CC, CXX, CFLAGS, CXXFLAGS, CPPFLAGS, LDFLAGS, upstream needs to define appropriate variables explicitly. In some cases, upstreams respect envvars, in others you need to pass them as options.

2. SCons scrubs out environment by default and replaces it with some pre-defined values. To respect environment variables such as PATH, Upstreams need to explicitly get them from os.environ and copy them to the build environment.

SUPPORTED EAPIS

7 8

EXAMPLE

PYTHON_COMPAT=( python3_{8..11} )
inherit python-any-r1 scons-utils toolchain-funcs

EAPI=8

src_configure() {
        MYSCONS=(
                CC="$(tc-getCC)"
                ENABLE_NLS=$(usex nls)
        )
}

src_compile() {
        escons "${MYSCONS[@]}"
}

src_install() {
        # note: this can be DESTDIR, INSTALL_ROOT, ... depending on package
        escons "${MYSCONS[@]}" DESTDIR="${D}" install
}

FUNCTIONS

escons [<args>...]
Call scons, passing the supplied arguments. Like emake, this function dies on failure, unless nonfatal is used.

ECLASS VARIABLES

SCONS_MIN_VERSION ?= 4.4.0
The minimal version of SCons required for the build to work.
SCONSOPTS (USER VARIABLE)
The default set of options to pass to scons. Similar to MAKEOPTS, supposed to be set in make.conf. If unset, escons() will set -j based on MAKEOPTS.
EXTRA_ESCONS (USER VARIABLE)
The additional parameters to pass to SCons whenever escons() is used. Much like EXTRA_EMAKE, this is not supposed to be used in make.conf and not in ebuilds!

MAINTAINERS

mgorny@gentoo.org

REPORTING BUGS

Please report bugs via https://bugs.gentoo.org/

FILES

scons-utils.eclass

SEE ALSO

ebuild(5)
https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/scons-utils.eclass


Index

NAME
DESCRIPTION
SUPPORTED EAPIS
EXAMPLE
FUNCTIONS
ECLASS VARIABLES
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:27:01 GMT, April 20, 2024