Diff meson-1.1.1 with a meson-1.9.2

/usr/portage/dev-build/meson/meson-1.9.2.ebuild 2026-02-10 11:18:07.164120800 +0300
1
# Copyright 2016-2025 Gentoo Authors
1
# Copyright 2016-2026 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=8
5 5

  
6
PYTHON_COMPAT=( python3_{11..12} )
6
PYTHON_COMPAT=( python3_{11..14} pypy3_11 )
7 7
DISTUTILS_USE_PEP517=setuptools
8 8

  
9
inherit shell-completion edo distutils-r1 flag-o-matic toolchain-funcs
10

  
9 11
if [[ ${PV} = *9999* ]]; then
10 12
	EGIT_REPO_URI="https://github.com/mesonbuild/meson"
11
	inherit git-r3
13
	inherit ninja-utils git-r3
14

  
15
	BDEPEND="
16
		${NINJA_DEPEND}
17
		$(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]')
18
	"
19

  
12 20
else
13 21
	inherit verify-sig
14 22

  
......
19 27
	SRC_URI="
20 28
		https://github.com/mesonbuild/meson/releases/download/${MY_PV}/${MY_P}.tar.gz
21 29
		verify-sig? ( https://github.com/mesonbuild/meson/releases/download/${MY_PV}/${MY_P}.tar.gz.asc )
30
		https://github.com/mesonbuild/meson/releases/download/${MY_PV}/meson-reference.3 -> meson-reference-${MY_PV}.3
22 31
	"
23
	BDEPEND="verify-sig? ( sec-keys/openpgp-keys-jpakkane )"
32
	# Releases may be signed by those listed in Releasing.md. Jussi
33
	# remains the default release manager.
34
	# https://github.com/mesonbuild/meson/commit/c2d795735fa1c46c54d6aed4d4a30f36a1f853cb
35
	BDEPEND="verify-sig? ( >=sec-keys/openpgp-keys-eschwartz-20250723-r1 sec-keys/openpgp-keys-jpakkane )"
36
	#VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/eschwartz.asc
24 37
	VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/jpakkane.gpg
25 38

  
26 39
	if [[ ${PV} != *_rc* ]] ; then
......
28 41
	fi
29 42
fi
30 43

  
31
inherit shell-completion distutils-r1 toolchain-funcs
32

  
33 44
DESCRIPTION="Open source build system"
34 45
HOMEPAGE="https://mesonbuild.com/"
35 46

  
36 47
LICENSE="Apache-2.0"
37 48
SLOT="0"
38
IUSE="test"
49
IUSE="test test-full"
39 50
RESTRICT="!test? ( test )"
51
REQUIRED_USE="test-full? ( test )"
40 52

  
41 53
DEPEND="
42 54
	test? (
......
46 58
		dev-vcs/git
47 59
		virtual/zlib:=[static-libs(+)]
48 60
		virtual/pkgconfig
61
		dev-build/cmake
62
	)
63
	test-full? (
64
		|| ( dev-lang/rust dev-lang/rust-bin )
65
		dev-lang/nasm
66
		>=dev-lang/pypy-3
67
		dev-lang/vala
68
		dev-python/cython
69
		virtual/fortran
70
		virtual/jdk
71

  
72
		app-text/doxygen
73
		dev-cpp/gtest
74
		dev-libs/protobuf
75
		dev-util/bindgen
76
		dev-util/gtk-doc
77
		dev-util/itstool
78
		llvm-core/llvm
79
		media-libs/libsdl2
80
		media-libs/libwmf
81
		net-libs/libpcap
82
		sci-libs/hdf5[cxx,fortran]
83
		sci-libs/netcdf
84
		sys-cluster/openmpi[fortran]
85
		sys-devel/bison
86
		sys-devel/flex
87

  
88
		dev-qt/linguist-tools:5
89
		dev-qt/qtwidgets:5
90
		dev-qt/qtbase:6[gui,widgets]
91
		dev-qt/qtdeclarative:6
92
		dev-qt/qttools:6
93
		>=dev-util/gdbus-codegen-2.80.5-r1
94
		x11-libs/gtk+:3
95

  
96
		dev-libs/wayland
97
		dev-util/wayland-scanner
49 98
	)
50 99
"
51 100
RDEPEND="
101
	!<dev-build/muon-0.2.0-r2[man(-)]
52 102
	virtual/pkgconfig
53 103
"
54 104

  
55 105
PATCHES=(
56
	"${FILESDIR}"/${PN}-0.63-xtools-support.patch
106
	"${FILESDIR}"/${PN}-1.2.1-python-path.patch
57 107
)
58 108

  
109
src_unpack() {
110
	if [[ ${PV} = *9999* ]]; then
111
		git-r3_src_unpack
112
	else
113
		default
114
		use verify-sig && verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.asc}
115
	fi
116
}
117

  
59 118
python_prepare_all() {
60 119
	local disable_unittests=(
61 120
		# ASAN and sandbox both want control over LD_PRELOAD
62 121
		# https://bugs.gentoo.org/673016
63 122
		-e 's/test_generate_gir_with_address_sanitizer/_&/'
123
		-e 's/test_env_cflags_ldflags/_&/'
124
		-e 's/test_c_link_args_and_env/_&/'
64 125

  
65 126
		# ASAN is unsupported on some targets
66 127
		# https://bugs.gentoo.org/692822
67 128
		-e 's/test_pch_with_address_sanitizer/_&/'
68 129

  
69
		# https://github.com/mesonbuild/meson/issues/7203
70
		-e 's/test_templates/_&/'
71

  
72
		# Broken due to python2 wrapper
73
		-e 's/test_python_module/_&/'
130
		# clippy-driver fails, but only when run via portage.
131
		#
132
		#   error[E0463]: can't find crate for `std`
133
		#   error: requires `sized` lang_item
134
		-e 's/test_rust_clippy/_&/'
74 135
	)
75 136

  
76 137
	sed -i "${disable_unittests[@]}" unittests/*.py || die
77 138

  
78 139
	# Broken due to python2 script created by python_wrapper_setup
79 140
	rm -r "test cases/frameworks/1 boost" || die
141
	# nvcc breaks on essentially any LDFLAGS
142
	# https://bugs.gentoo.org/936757
143
	# https://github.com/mesonbuild/meson/issues/11234
144
	rm -r "test cases/cuda"/* || die
80 145

  
81 146
	distutils-r1_python_prepare_all
82 147
}
83 148

  
149
python_check_deps() {
150
	if [[ ${PV} = *9999* ]]; then
151
		python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]"
152
	fi
153
}
154

  
155
python_configure_all() {
156
	if [[ ${PV} = *9999* ]]; then
157
		# We use the unsafe_yaml loader because strictyaml is not packaged. In
158
		# theory they produce the same results, but pyyaml is faster and
159
		# without safety checks.
160
		edo ./meson.py setup \
161
			--prefix "${EPREFIX}/usr" \
162
			-Dhtml=false \
163
			-Dunsafe_yaml=true \
164
			docs/ docs/builddir
165
	fi
166
}
167

  
168
python_compile_all() {
169
	if [[ ${PV} = *9999* ]]; then
170
		eninja -C docs/builddir
171
	fi
172
}
173

  
84 174
src_test() {
85 175
	tc-export PKG_CONFIG
86 176
	if ${PKG_CONFIG} --exists Qt5Core && ! ${PKG_CONFIG} --exists Qt5Gui; then
......
92 182

  
93 183
python_test() {
94 184
	(
185
		# meson has its own tests for LTO support. We don't need to verify that
186
		# all tests work when they happen to use it. And in particular, this
187
		# breaks rust.
188
		filter-lto
189

  
190
		# remove unwanted python_wrapper_setup contents
191
		# We actually do want to non-error if python2 is installed and tested.
192
		remove="${T}/${EPYTHON}/bin:"
193
		PATH=${PATH/${remove}/}
194

  
95 195
		# test_meson_installed
96 196
		unset PYTHONDONTWRITEBYTECODE
97 197

  
......
111 211
		# value in JAVA_HOME, and the tests should get skipped.
112 212
		export JAVA_HOME=$(java-config -O 2>/dev/null)
113 213

  
114
		# Call python3 instead of EPYTHON to satisfy test_meson_uninstalled.
115
		python3 run_tests.py
214
		${EPYTHON} -u run_tests.py
116 215
	) || die "Testing failed with ${EPYTHON}"
117 216
}
118 217

  
......
124 223

  
125 224
	dozshcomp data/shell-completions/zsh/_meson
126 225
	dobashcomp data/shell-completions/bash/meson
226

  
227
	if [[ ${PV} = *9999* ]]; then
228
		DESTDIR="${ED}" eninja -C docs/builddir install
229
	else
230
		newman "${DISTDIR}"/meson-reference-${MY_PV}.3 meson-reference.3
231
	fi
127 232
}
Thank you!