dev-build/meson: Sync with Gentoo

It's from Gentoo commit ef099d0cd4603c8737ef410b09af45aee588b7e6.
This commit is contained in:
Flatcar Buildbot 2025-04-07 07:06:04 +00:00 committed by Krzesimir Nowak
parent 38795c6996
commit dbfe7c7ba1
4 changed files with 466 additions and 0 deletions

View File

@ -12,7 +12,13 @@ DIST meson-1.6.1.tar.gz 2276144 BLAKE2B 7ccdb3bf3f701fc787fabf91413db8301a8658b8
DIST meson-1.6.1.tar.gz.asc 833 BLAKE2B 6666eca8e5506b8692fc29ba66dc3ee9d725a7d720a7b43db720098f7e00671e71993586606c187d8314e3919474f5733d64a8d052be6552cbcf013a872905ab SHA512 543cf396de0a58998c3587aa05580fa9a56734db40b74fc5fbb22cd56124531804a5360d6b9acb9baa71753ac04c343364da4d78a0d366d8e8bc760030ebf8d3
DIST meson-1.7.0.tar.gz 2293975 BLAKE2B 64465b33c2358fddc3594807ee5d251dc6bcc1030ed3559d2d5dc33b7092a512b8a3d3b75cc7152812dbc62631d3b9fba596cd105654ae3ff38f01be8ada5232 SHA512 a5d1f00b193ca37ae64f85c9dfc29a2661c167d82d9953b9acd1393b222b05fa5fc03ffdf00fd1ae7a2014da3a7366c35f70bf02e3204e929b74f7b00c17c840
DIST meson-1.7.0.tar.gz.asc 833 BLAKE2B 34783968262e5ce54cca7f4878b09e7611670ede620b8588ac915bb55fed7f4051e151d789b10e9bd650241149dc9930c14b356c3ce436682d496eeabc805672 SHA512 85ec14f080d0d1492922c971909dc734ab1cd4914a567afbfeff5dc00d19a9a72e6e0668280fc045f270c49389ea03059b9eeb831788b2154fb39116b38f6e5e
DIST meson-1.7.1.tar.gz 2295198 BLAKE2B a1eda88cc349f74ab00e367daf5f27452875f483d95d7dcad2255b5df040efd39019dd6b1b61a58709662193c3dce28c6f378e80f7c15a4b9be694ed4173f59d SHA512 bad913c59f540b701a0d234a868bd88615ccfcdc09931f8dea7b4da48bcc3a3c3c7e9cdeeff5abfcd48c6b2b25e5c60590811125b7156da36b714e00b35813c6
DIST meson-1.7.1.tar.gz.asc 833 BLAKE2B 1e854c5f026471d1fa1f9f9ca26a8be06518564694b92ba8a751f2c05fa430359c5f6c9b636c0df9a2db338f61a9750e4080d60171a0e3bef49163c416166ef6 SHA512 266de0d34828688491ad3167bb3b88f489b579af1bbbb20a28e3ccfc342fa04659970d4db5e10a0470a5c52d37f4b04f718d7af4c3c3e9e1e67c69c10f3c4662
DIST meson-1.7.2.tar.gz 5009274 BLAKE2B f5a19d7c0dfa35efda5bdef972fa6362a64fee2c74be0c09dee6d52c30a8b0169dbe7fab3199add306c778f6a57196251b44ec27ff6b5e038e12c11b27513a54 SHA512 c3c71ae0e0c31d8d72e200bb5fd5e6584ce41aabe1e85575d50371f82ed02c6e346da3b0b4a2786199b9410daaa1622807a88bfc8ac991cf134bad4a53b3c863
DIST meson-1.7.2.tar.gz.asc 996 BLAKE2B 9a34bb86f15eb92d4eb972835e8e18e175c869a6ba9d88310ca6058654200b227c7a4a945eee220784f584737a3b74ffcd06e2b60a3e502e49af5da69eb1e5bf SHA512 a1e0461a28dfc8ba74ffd919511584148094c2bc809c3d380749856cbdaa33473c1a0c1ec92928020f50e116803fc03deb37b3ee2aca7e56287b155a5ccc36ac
DIST meson-reference-1.4.2.3 339324 BLAKE2B 1a4fbd8c27a8cfba773777eabd2ebaa0f76ec0c61dcfe1c7b4483737b348ff9528d68f26e68d7d40b2e1875611eed5b9a31c1cf55fed8eabb42fc1e31d9ef14b SHA512 8b8ec43e812599203ec44c08805eb6818485805c45b9c69802261eaa35efc97846a96f6472c6b1ef5f6c703e7153fd957df7b805f173ca3400a2030dfbe002ca
DIST meson-reference-1.5.2.3 341110 BLAKE2B 0d588b796f7f2da2dcb0e7822acde6a9a461930da4bfead3cf9148fa0fac18cd0ccbc6e891f555c973836f1c16b4eae299908a838a0b6843293de8815d30fc23 SHA512 64715ce2113e362e7d67179fe13566bc8f84ce7f4e6d795b836f42455a871173fee06e3e969e2996022d7e6c9b4b5379587a4c0c3d97b4bca527fb8902d3547f
DIST meson-reference-1.6.1.3 343730 BLAKE2B 55df822192781a70e4bc44cfe14fb363e3f820406260ca9705d7fdb5fad1bf0117e3f1325d37e58e23477bc075ab6bd84056409355ec694f72eeaa5bf982ecc7 SHA512 553cdcd86a7a600cda05ac970cc285c4c50017d1e7d2925645d7f19a62b34c2f079673cafecf4111aa102afbe9d8e4d56f166d1d9940b740eeec0bb99d6cbc0d
DIST meson-reference-1.7.0.3 344764 BLAKE2B 615c70325b6ca3b964bf2827f20f07845150943b6cd95a0599b0392299e2a9338921b52bbe3613fc03fa931c28fb2121801bdb74880f2bd4fecb051b7f1fcb4b SHA512 9d9a3862602251ca780acdf18cee4ab9cd14404481e216b557eafc88b23561ecf481836898b78cbc4ee3539869b5578c649a5c71f32b3074d8125b867ea4751d
DIST meson-reference-1.7.1.3 344764 BLAKE2B f4b6a5eb80f143310e9aae3fe512b5146b39df4e74e589c571d3f58ddfcb3298d1accff417c055e46a4ad61fc0557723eb4d89607a4793d1bcc134f1e83ab3eb SHA512 f36e4adcf7eab70738c71c48c87328bc436168dc605c0931b746d4b48915269dc9245215a4aa968046e4cb0f5167f595da1cf2acd96d87ed47aea9b34b63a652
DIST meson-reference-1.7.2.3 344764 BLAKE2B 82de9a7a01c2f1b45a2b3432deb4713af3cfd3b2dc9af8802488b7d1b86dde9b6ac81f90b144006a79e90b313e1d4d23f9cc90e17255ce9573e5487d3e20c286 SHA512 d482a3b3bed671705d6316e106984ad2c2169fe890349437e512455705ee8dddb31a29d31f44402a4c7c5bd2f78595b75bfc5ad34d8c0337b66f40837b08ee56

View File

@ -0,0 +1,227 @@
# Copyright 2016-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} pypy3 pypy3_11 )
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 ~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 test-full"
RESTRICT="!test? ( test )"
REQUIRED_USE="test-full? ( test )"
DEPEND="
test? (
dev-libs/glib:2
dev-libs/gobject-introspection
app-alternatives/ninja
dev-vcs/git
sys-libs/zlib[static-libs(+)]
virtual/pkgconfig
dev-build/cmake
)
test-full? (
|| ( dev-lang/rust dev-lang/rust-bin )
dev-lang/nasm
>=dev-lang/pypy-3
dev-lang/vala
dev-python/cython
virtual/fortran
virtual/jdk
app-text/doxygen
dev-cpp/gtest
dev-libs/protobuf
dev-util/bindgen
dev-util/gtk-doc
dev-util/itstool
llvm-core/llvm
media-libs/libsdl2
media-libs/libwmf
net-libs/libpcap
sci-libs/hdf5[fortran]
sci-libs/netcdf
sys-cluster/openmpi[fortran]
sys-devel/bison
sys-devel/flex
dev-qt/linguist-tools:5
dev-qt/qtwidgets:5
dev-qt/qtbase:6[gui,widgets]
dev-qt/qttools:6
dev-util/gdbus-codegen
x11-libs/gtk+:3
dev-libs/wayland
dev-util/wayland-scanner
)
"
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/_&/'
# clippy-driver fails, but only when run via portage.
#
# error[E0463]: can't find crate for `std`
# error: requires `sized` lang_item
-e 's/test_rust_clippy/_&/'
)
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
# nvcc breaks on essentially any LDFLAGS
# https://bugs.gentoo.org/936757
# https://github.com/mesonbuild/meson/issues/11234
rm -r "test cases/cuda"/* || 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-${MY_PV}.3 meson-reference.3
fi
}

View File

@ -0,0 +1,230 @@
# Copyright 2016-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} pypy3 pypy3_11 )
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
"
# Releases may be signed by those listed in Releasing.md. Jussi
# remains the default release manager.
# https://github.com/mesonbuild/meson/commit/c2d795735fa1c46c54d6aed4d4a30f36a1f853cb
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-eschwartz )"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/eschwartz.gpg
if [[ ${PV} != *_rc* ]] ; then
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~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 test-full"
RESTRICT="!test? ( test )"
REQUIRED_USE="test-full? ( test )"
DEPEND="
test? (
dev-libs/glib:2
dev-libs/gobject-introspection
app-alternatives/ninja
dev-vcs/git
sys-libs/zlib[static-libs(+)]
virtual/pkgconfig
dev-build/cmake
)
test-full? (
|| ( dev-lang/rust dev-lang/rust-bin )
dev-lang/nasm
>=dev-lang/pypy-3
dev-lang/vala
dev-python/cython
virtual/fortran
virtual/jdk
app-text/doxygen
dev-cpp/gtest
dev-libs/protobuf
dev-util/bindgen
dev-util/gtk-doc
dev-util/itstool
llvm-core/llvm
media-libs/libsdl2
media-libs/libwmf
net-libs/libpcap
sci-libs/hdf5[fortran]
sci-libs/netcdf
sys-cluster/openmpi[fortran]
sys-devel/bison
sys-devel/flex
dev-qt/linguist-tools:5
dev-qt/qtwidgets:5
dev-qt/qtbase:6[gui,widgets]
dev-qt/qttools:6
dev-util/gdbus-codegen
x11-libs/gtk+:3
dev-libs/wayland
dev-util/wayland-scanner
)
"
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/_&/'
# clippy-driver fails, but only when run via portage.
#
# error[E0463]: can't find crate for `std`
# error: requires `sized` lang_item
-e 's/test_rust_clippy/_&/'
)
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
# nvcc breaks on essentially any LDFLAGS
# https://bugs.gentoo.org/936757
# https://github.com/mesonbuild/meson/issues/11234
rm -r "test cases/cuda"/* || 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-${MY_PV}.3 meson-reference.3
fi
}

View File

@ -29,6 +29,9 @@ else
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
"
# Releases may be signed by those listed in Releasing.md. Jussi
# remains the default release manager.
# https://github.com/mesonbuild/meson/commit/c2d795735fa1c46c54d6aed4d4a30f36a1f853cb
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-jpakkane )"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/jpakkane.gpg