app-shells/bash-completion: add 2.16.0
[gentoo/gentoo.git] / dev-build / meson / meson-1.1.1.ebuild
blob046626dcf1ee96b894f006b586a2266cf984f4f8
1 # Copyright 2016-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 PYTHON_COMPAT=( python3_{10..12} pypy3 )
7 DISTUTILS_USE_PEP517=setuptools
9 if [[ ${PV} = *9999* ]]; then
10         EGIT_REPO_URI="https://github.com/mesonbuild/meson"
11         inherit git-r3
12 else
13         inherit verify-sig
15         MY_PV=${PV/_/}
16         MY_P=${P/_/}
17         S=${WORKDIR}/${MY_P}
19         SRC_URI="
20                 https://github.com/mesonbuild/meson/releases/download/${MY_PV}/${MY_P}.tar.gz
21                 verify-sig? ( https://github.com/mesonbuild/meson/releases/download/${MY_PV}/${MY_P}.tar.gz.asc )
22         "
23         BDEPEND="verify-sig? ( sec-keys/openpgp-keys-jpakkane )"
24         VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/jpakkane.gpg
26         if [[ ${PV} != *_rc* ]] ; then
27                 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"
28         fi
31 inherit bash-completion-r1 distutils-r1 toolchain-funcs
33 DESCRIPTION="Open source build system"
34 HOMEPAGE="https://mesonbuild.com/"
36 LICENSE="Apache-2.0"
37 SLOT="0"
38 IUSE="test"
39 RESTRICT="!test? ( test )"
41 DEPEND="
42         test? (
43                 dev-libs/glib:2
44                 dev-libs/gobject-introspection
45                 app-alternatives/ninja
46                 dev-vcs/git
47                 sys-libs/zlib[static-libs(+)]
48                 virtual/pkgconfig
49         )
51 RDEPEND="
52         virtual/pkgconfig
55 PATCHES=(
56         "${FILESDIR}"/${PN}-0.63-xtools-support.patch
59 python_prepare_all() {
60         local disable_unittests=(
61                 # ASAN and sandbox both want control over LD_PRELOAD
62                 # https://bugs.gentoo.org/673016
63                 -e 's/test_generate_gir_with_address_sanitizer/_&/'
65                 # ASAN is unsupported on some targets
66                 # https://bugs.gentoo.org/692822
67                 -e 's/test_pch_with_address_sanitizer/_&/'
69                 # https://github.com/mesonbuild/meson/issues/7203
70                 -e 's/test_templates/_&/'
72                 # Broken due to python2 wrapper
73                 -e 's/test_python_module/_&/'
74         )
76         sed -i "${disable_unittests[@]}" unittests/*.py || die
78         # Broken due to python2 script created by python_wrapper_setup
79         rm -r "test cases/frameworks/1 boost" || die
81         distutils-r1_python_prepare_all
84 src_test() {
85         tc-export PKG_CONFIG
86         if ${PKG_CONFIG} --exists Qt5Core && ! ${PKG_CONFIG} --exists Qt5Gui; then
87                 ewarn "Found Qt5Core but not Qt5Gui; skipping tests"
88         else
89                 distutils-r1_src_test
90         fi
93 python_test() {
94         (
95                 # test_meson_installed
96                 unset PYTHONDONTWRITEBYTECODE
98                 # https://bugs.gentoo.org/687792
99                 unset PKG_CONFIG
101                 # test_cross_file_system_paths
102                 unset XDG_DATA_HOME
104                 # 'test cases/unit/73 summary' expects 80 columns
105                 export COLUMNS=80
107                 # If JAVA_HOME is not set, meson looks for javac in PATH.
108                 # If javac is in /usr/bin, meson assumes /usr/include is a valid
109                 # JDK include path. Setting JAVA_HOME works around this broken
110                 # autodetection. If no JDK is installed, we should end up with an empty
111                 # value in JAVA_HOME, and the tests should get skipped.
112                 export JAVA_HOME=$(java-config -O 2>/dev/null)
114                 # Call python3 instead of EPYTHON to satisfy test_meson_uninstalled.
115                 python3 run_tests.py
116         ) || die "Testing failed with ${EPYTHON}"
119 python_install_all() {
120         distutils-r1_python_install_all
122         insinto /usr/share/vim/vimfiles
123         doins -r data/syntax-highlighting/vim/{ftdetect,indent,syntax}
125         insinto /usr/share/zsh/site-functions
126         doins data/shell-completions/zsh/_meson
128         dobashcomp data/shell-completions/bash/meson