dev-build/meson: Sync with Gentoo

It's from Gentoo commit 51f042454cc8b26eb0ece359d2ab2f348fb7df54.
This commit is contained in:
Flatcar Buildbot 2024-03-25 07:10:43 +00:00 committed by Krzesimir Nowak
parent 555a88281f
commit fc3250abe2
6 changed files with 251 additions and 15 deletions

View File

@ -8,5 +8,6 @@ DIST meson-1.3.1.tar.gz 2222386 BLAKE2B 64d53eddc8cb321a4e2dabaa4b7499798a7b6876
DIST meson-1.3.1.tar.gz.asc 833 BLAKE2B 1db7aabe3b7d491dfcd288a780d10784517a73e07348f2d5b98d1fa347dd08b2afa210511c7f5ff867b10ecd3ce470ea764b5ce6907aa7dcaa4d619f705e339c SHA512 0f652d375fa7700f3048266330d783664593c08da47d4f0d87af0be5d8b5e21113521651fb923c6a1cfe88aef7067ebd85b27946f19e71133d7c9805839fc873
DIST meson-1.3.2.tar.gz 2223798 BLAKE2B 72b061598a0cb22517460de4df25394a9dfbddb536c5b8e75b7267ae21292fe2a6a3ec16d64aa81cde63d33022decebcc051cf2d87d677f9b40eb2f4106a40cd SHA512 6369c6d64f91c769f0f4d3e2445bb3615785998489d41acba2134b44ec89abd04bd97a3d3d17c64779eb40b0bf4808e3419eb47638169446a98824d680f37a7b
DIST meson-1.3.2.tar.gz.asc 833 BLAKE2B b11ae2be4e9cb0278be9cafd304146432e606a5fd23379d08116943676286f240fb8cc1d5f897cbd4c2bacfe298802afb1a847e447d71250f58cee5dec38083b SHA512 0cb9575fb599cba4ae77c1954599a24b1f079c46cf255bb8d581ef434598503db6e08af6a95b7c00bc54c165ec8fd9834310e2d4874afe01c5d44e72cef496b3
DIST meson-1.4.0rc2.tar.gz 2227818 BLAKE2B 8b33fc50c726f8aa712aa8d23da712051d99b72f909e74baec54fef64e559a5562b75947987057e496e0d161ff9c2fa85140bf6fac70ecbc2375a09036e8422d SHA512 e070fa321824e2870371fc869157b469a1d37353706984e52d5f6dbe2730561ce6a0aefe15a697b2c2be4060fea29430a5f2460a4fa25736a8bd72f99bcc9b72
DIST meson-1.4.0rc2.tar.gz.asc 833 BLAKE2B 9ce4649f7c4fff4d8c0f12bb5d309dc5662a133a14b9ceb01c511b6619a59314ff19aca8fab94cd904d5b33abecf3248b9f2c6a3efdbdf91de95aebba1f1ac50 SHA512 400e8e4b3f1910a06b94aa5b23919e9c049c4a91d6612b9792e8e0796f90d01644930f2cd44903c3d4a29bedf989b3aba4cb5c88c1507fafaa277ee0e4db0ba3
DIST meson-1.4.0.tar.gz 2224663 BLAKE2B 7f742ef870c182e552c1ff3508d65f251009d610def6a08e01fddb6c6a4ed6d608ead0d52cf8ca7d66b5bd7a4732dccd7ab5d98f141a4a61e275398885f79486 SHA512 2787941fbc77d5ad95011753df52fe39812929a06d84dbce8bdc965c9c1e62fd6bfa819712eb1f5934c2ebe6919a65f7874ecac2caf40d111ea024343108cfbd
DIST meson-1.4.0.tar.gz.asc 833 BLAKE2B 6e4002303da16bcaa3d1d3c76a3485b23174074de2d29bd34347a4671d7fb0f1c0767559ed9267e0f0b52c02638b85a11a5980f4ee188e7e4d35c733b0821c62 SHA512 ea73e72d929bf30d28c033f103fd1d26bac7cef175aabbf9b3a24c7b336682c28f5aae184e04d2189731cf80dd7571939cb02de642bb5b412cea996ca30dfdad
DIST meson-reference-1.4.0.3 339324 BLAKE2B 8ad24592c1a9100832dead97a55d4cb358892fc1cd6aee641f9610cb6a5df211831e6cfc42e047d5e835ed53de1bb9c7d711dd1a0a8cfe18a0f85e92a1a3f925 SHA512 8df06f63db6db01a6c8c0a5b4a8b26c868bb027f26580d290288b1067429a526fb654fae01a45085c1f20ee8dab1b5325e8b2fd285faf175d2fcfc2c704b4768

View File

@ -24,7 +24,7 @@ else
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/jpakkane.gpg
if [[ ${PV} != *_rc* ]] ; then
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
fi

View File

@ -24,7 +24,7 @@ else
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/jpakkane.gpg
if [[ ${PV} != *_rc* ]] ; then
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
fi

View File

@ -0,0 +1,180 @@
# Copyright 2016-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} pypy3 )
DISTUTILS_USE_PEP517=setuptools
inherit bash-completion-r1 edo distutils-r1 flag-o-matic toolchain-funcs
if [[ ${PV} = *9999* ]]; then
EGIT_REPO_URI="https://github.com/mesonbuild/meson"
inherit ninja-utils git-r3
BDEPEND="
${NINJA_DEPEND}
$(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]')
"
else
inherit verify-sig
MY_PV=${PV/_/}
MY_P=${P/_/}
S=${WORKDIR}/${MY_P}
SRC_URI="
https://github.com/mesonbuild/meson/releases/download/${MY_PV}/${MY_P}.tar.gz
verify-sig? ( https://github.com/mesonbuild/meson/releases/download/${MY_PV}/${MY_P}.tar.gz.asc )
https://github.com/mesonbuild/meson/releases/download/${MY_PV}/meson-reference.3 -> meson-reference-${MY_PV}.3
"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-jpakkane )"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/jpakkane.gpg
if [[ ${PV} != *_rc* ]] ; then
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
fi
DESCRIPTION="Open source build system"
HOMEPAGE="https://mesonbuild.com/"
LICENSE="Apache-2.0"
SLOT="0"
IUSE="test"
RESTRICT="!test? ( test )"
DEPEND="
test? (
dev-libs/glib:2
dev-libs/gobject-introspection
app-alternatives/ninja
dev-vcs/git
sys-libs/zlib[static-libs(+)]
virtual/pkgconfig
)
"
RDEPEND="
!<dev-build/muon-0.2.0-r2[man(-)]
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}"/${PN}-1.2.1-python-path.patch
)
src_unpack() {
if [[ ${PV} = *9999* ]]; then
git-r3_src_unpack
else
default
use verify-sig && verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.asc}
fi
}
python_prepare_all() {
local disable_unittests=(
# ASAN and sandbox both want control over LD_PRELOAD
# https://bugs.gentoo.org/673016
-e 's/test_generate_gir_with_address_sanitizer/_&/'
# ASAN is unsupported on some targets
# https://bugs.gentoo.org/692822
-e 's/test_pch_with_address_sanitizer/_&/'
)
sed -i "${disable_unittests[@]}" unittests/*.py || die
# Broken due to python2 script created by python_wrapper_setup
rm -r "test cases/frameworks/1 boost" || die
distutils-r1_python_prepare_all
}
python_check_deps() {
if [[ ${PV} = *9999* ]]; then
python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]"
fi
}
python_configure_all() {
if [[ ${PV} = *9999* ]]; then
# We use the unsafe_yaml loader because strictyaml is not packaged. In
# theory they produce the same results, but pyyaml is faster and
# without safety checks.
edo ./meson.py setup \
--prefix "${EPREFIX}/usr" \
-Dhtml=false \
-Dunsafe_yaml=true \
docs/ docs/builddir
fi
}
python_compile_all() {
if [[ ${PV} = *9999* ]]; then
eninja -C docs/builddir
fi
}
src_test() {
tc-export PKG_CONFIG
if ${PKG_CONFIG} --exists Qt5Core && ! ${PKG_CONFIG} --exists Qt5Gui; then
ewarn "Found Qt5Core but not Qt5Gui; skipping tests"
else
distutils-r1_src_test
fi
}
python_test() {
(
# meson has its own tests for LTO support. We don't need to verify that
# all tests work when they happen to use it. And in particular, this
# breaks rust.
filter-lto
# remove unwanted python_wrapper_setup contents
# We actually do want to non-error if python2 is installed and tested.
remove="${T}/${EPYTHON}/bin:"
PATH=${PATH/${remove}/}
# test_meson_installed
unset PYTHONDONTWRITEBYTECODE
# https://bugs.gentoo.org/687792
unset PKG_CONFIG
# test_cross_file_system_paths
unset XDG_DATA_HOME
# 'test cases/unit/73 summary' expects 80 columns
export COLUMNS=80
# If JAVA_HOME is not set, meson looks for javac in PATH.
# If javac is in /usr/bin, meson assumes /usr/include is a valid
# JDK include path. Setting JAVA_HOME works around this broken
# autodetection. If no JDK is installed, we should end up with an empty
# value in JAVA_HOME, and the tests should get skipped.
export JAVA_HOME=$(java-config -O 2>/dev/null)
${EPYTHON} -u run_tests.py
) || die "Testing failed with ${EPYTHON}"
}
python_install_all() {
distutils-r1_python_install_all
insinto /usr/share/vim/vimfiles
doins -r data/syntax-highlighting/vim/{ftdetect,indent,syntax}
insinto /usr/share/zsh/site-functions
doins data/shell-completions/zsh/_meson
dobashcomp data/shell-completions/bash/meson
if [[ ${PV} = *9999* ]]; then
DESTDIR="${ED}" eninja -C docs/builddir install
else
newman "${DISTDIR}"/meson-reference-${PV}.3 meson-reference.3
fi
}

View File

@ -6,9 +6,17 @@ EAPI=8
PYTHON_COMPAT=( python3_{10..12} pypy3 )
DISTUTILS_USE_PEP517=setuptools
inherit bash-completion-r1 edo distutils-r1 flag-o-matic toolchain-funcs
if [[ ${PV} = *9999* ]]; then
EGIT_REPO_URI="https://github.com/mesonbuild/meson"
inherit git-r3
inherit ninja-utils git-r3
BDEPEND="
${NINJA_DEPEND}
$(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]')
"
else
inherit verify-sig
@ -19,6 +27,7 @@ else
SRC_URI="
https://github.com/mesonbuild/meson/releases/download/${MY_PV}/${MY_P}.tar.gz
verify-sig? ( https://github.com/mesonbuild/meson/releases/download/${MY_PV}/${MY_P}.tar.gz.asc )
https://github.com/mesonbuild/meson/releases/download/${MY_PV}/meson-reference.3 -> meson-reference-${MY_PV}.3
"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-jpakkane )"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/jpakkane.gpg
@ -28,8 +37,6 @@ else
fi
fi
inherit bash-completion-r1 distutils-r1 toolchain-funcs
DESCRIPTION="Open source build system"
HOMEPAGE="https://mesonbuild.com/"
@ -49,9 +56,23 @@ DEPEND="
)
"
RDEPEND="
!<dev-build/muon-0.2.0-r2[man(-)]
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}"/${PN}-1.2.1-python-path.patch
)
src_unpack() {
if [[ ${PV} = *9999* ]]; then
git-r3_src_unpack
else
default
use verify-sig && verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.asc}
fi
}
python_prepare_all() {
local disable_unittests=(
# ASAN and sandbox both want control over LD_PRELOAD
@ -61,12 +82,6 @@ python_prepare_all() {
# ASAN is unsupported on some targets
# https://bugs.gentoo.org/692822
-e 's/test_pch_with_address_sanitizer/_&/'
# https://github.com/mesonbuild/meson/issues/7203
-e 's/test_templates/_&/'
# Broken due to python2 wrapper
-e 's/test_python_module/_&/'
)
sed -i "${disable_unittests[@]}" unittests/*.py || die
@ -77,6 +92,31 @@ python_prepare_all() {
distutils-r1_python_prepare_all
}
python_check_deps() {
if [[ ${PV} = *9999* ]]; then
python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]"
fi
}
python_configure_all() {
if [[ ${PV} = *9999* ]]; then
# We use the unsafe_yaml loader because strictyaml is not packaged. In
# theory they produce the same results, but pyyaml is faster and
# without safety checks.
edo ./meson.py setup \
--prefix "${EPREFIX}/usr" \
-Dhtml=false \
-Dunsafe_yaml=true \
docs/ docs/builddir
fi
}
python_compile_all() {
if [[ ${PV} = *9999* ]]; then
eninja -C docs/builddir
fi
}
src_test() {
tc-export PKG_CONFIG
if ${PKG_CONFIG} --exists Qt5Core && ! ${PKG_CONFIG} --exists Qt5Gui; then
@ -88,6 +128,16 @@ src_test() {
python_test() {
(
# meson has its own tests for LTO support. We don't need to verify that
# all tests work when they happen to use it. And in particular, this
# breaks rust.
filter-lto
# remove unwanted python_wrapper_setup contents
# We actually do want to non-error if python2 is installed and tested.
remove="${T}/${EPYTHON}/bin:"
PATH=${PATH/${remove}/}
# test_meson_installed
unset PYTHONDONTWRITEBYTECODE
@ -107,8 +157,7 @@ python_test() {
# value in JAVA_HOME, and the tests should get skipped.
export JAVA_HOME=$(java-config -O 2>/dev/null)
# Call python3 instead of EPYTHON to satisfy test_meson_uninstalled.
python3 run_tests.py
${EPYTHON} -u run_tests.py
) || die "Testing failed with ${EPYTHON}"
}
@ -122,4 +171,10 @@ python_install_all() {
doins data/shell-completions/zsh/_meson
dobashcomp data/shell-completions/bash/meson
if [[ ${PV} = *9999* ]]; then
DESTDIR="${ED}" eninja -C docs/builddir install
else
newman "${DISTDIR}"/meson-reference-${PV}.3 meson-reference.3
fi
}