Skip to content

Commit

Permalink
meson.eclass: misc improvements for #619178
Browse files Browse the repository at this point in the history
  • Loading branch information
Coacher authored and williamh committed May 21, 2017
1 parent 3b82cec commit 5fe09d0
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions eclass/meson.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ case ${EAPI:-0} in
*) die "EAPI=${EAPI} is not supported" ;;
esac

EXPORT_FUNCTIONS src_configure src_compile src_test src_install

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

# FIXME: We will need to inherit toolchain-funcs as well to support crossdev.
inherit ninja-utils

fi

EXPORT_FUNCTIONS src_configure src_compile src_test src_install

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

DEPEND=">=dev-util/meson-0.39.1
>=dev-util/ninja-1.7.2"

Expand All @@ -57,7 +61,7 @@ DEPEND=">=dev-util/meson-0.39.1
# @ECLASS-VARIABLE: EMESON_SOURCE
# @DEFAULT_UNSET
# @DESCRIPTION:
# The location of the source files for the project;this is the source
# The location of the source files for the project; this is the source
# directory to pass to meson.
# If this isn't set, it defaults to ${S}

Expand All @@ -67,17 +71,17 @@ DEPEND=">=dev-util/meson-0.39.1
# Optional meson arguments as Bash array; this should be defined before
# calling meson_src_configure.

# create a cross file for meson
# Create a cross file for meson
# fixme: This function should write a cross file as described at the
# following url.
# http://mesonbuild.com/Cross-compilation.html
# http://mesonbuild.com/Cross-compilation.html
# _meson_create_cross_file() {
# touch "${T}"/meson.crossfile
# }

# @FUNCTION: meson_src_configure
# @DESCRIPTION:
# this is the meson_src_configure function
# This is the meson_src_configure function
meson_src_configure() {
debug-print-function ${FUNCNAME} "$@"

Expand All @@ -86,7 +90,7 @@ meson_src_configure() {
--buildtype plain
--libdir "$(get_libdir)"
--localstatedir "${EPREFIX}/var/lib"
--prefix "${EPREFIX}"/usr
--prefix "${EPREFIX}/usr"
--sysconfdir "${EPREFIX}/etc"
)

Expand Down Expand Up @@ -114,25 +118,26 @@ meson_src_configure() {
meson_src_compile() {
debug-print-function ${FUNCNAME} "$@"

eninja -v -C "${BUILD_DIR}"
eninja -C "${BUILD_DIR}"
}

# @FUNCTION: meson_src_test
# @DESCRIPTION:
# this is the meson_src_test function.
# This is the meson_src_test function.
meson_src_test() {
debug-print-function ${FUNCNAME} "$@"

eninja -v -C "${BUILD_DIR}" test
eninja -C "${BUILD_DIR}" test
}

# @FUNCTION: meson_src_install
# @DESCRIPTION:
# this is the meson_src_install function.
# This is the meson_src_install function.
meson_src_install() {
debug-print-function ${FUNCNAME} "$@"

DESTDIR="${D}" eninja -v -C "${BUILD_DIR}" install
DESTDIR="${D}" eninja -C "${BUILD_DIR}" install
einstalldocs
}

fi

0 comments on commit 5fe09d0

Please sign in to comment.