public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/prefix:master commit in: dev-build/meson/files/, dev-build/meson/
@ 2024-01-17  8:05 Fabian Groffen
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Groffen @ 2024-01-17  8:05 UTC (permalink / raw
  To: gentoo-commits

commit:     c76c83d5e1d8ccb20be5333d3cc5d921b4849380
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 17 08:01:15 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Jan 17 08:03:20 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=c76c83d5

dev-build/meson: import from gx86 to keep xtools support

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 dev-build/meson/Manifest                           |   2 +
 ...vert-clike-Deduplicate-rpath-linker-flags.patch |  55 +++++
 ...nd-don-t-hide-all-compiler-warnings-for-t.patch | 250 +++++++++++++++++++++
 .../meson/files/meson-1.2.1-python-path.patch      |  26 +++
 .../meson/files/meson-1.3.1-xtools-support.patch   |  26 +++
 dev-build/meson/meson-1.3.1.ebuild                 | 134 +++++++++++
 dev-build/meson/metadata.xml                       |  15 ++
 7 files changed, 508 insertions(+)

diff --git a/dev-build/meson/Manifest b/dev-build/meson/Manifest
new file mode 100644
index 0000000000..c5619b32b9
--- /dev/null
+++ b/dev-build/meson/Manifest
@@ -0,0 +1,2 @@
+DIST meson-1.3.1.tar.gz 2222386 BLAKE2B 64d53eddc8cb321a4e2dabaa4b7499798a7b68764b1a7a5182bfa21d081dc07105acab616119b88ff610e5d75504f03d1c0aefee3602ddf538fc491ff3d0204a SHA512 6e694beb70329535faca9405358c04e2fd5a490b0c0d2678d5831b7de3477e0fcf4f6a242f1bc6218da04ac4f6e096ee53cdf273c6b6a38a35d370e8c16694ba
+DIST meson-1.3.1.tar.gz.asc 833 BLAKE2B 1db7aabe3b7d491dfcd288a780d10784517a73e07348f2d5b98d1fa347dd08b2afa210511c7f5ff867b10ecd3ce470ea764b5ce6907aa7dcaa4d619f705e339c SHA512 0f652d375fa7700f3048266330d783664593c08da47d4f0d87af0be5d8b5e21113521651fb923c6a1cfe88aef7067ebd85b27946f19e71133d7c9805839fc873

diff --git a/dev-build/meson/files/0001-Revert-clike-Deduplicate-rpath-linker-flags.patch b/dev-build/meson/files/0001-Revert-clike-Deduplicate-rpath-linker-flags.patch
new file mode 100644
index 0000000000..3d40616fec
--- /dev/null
+++ b/dev-build/meson/files/0001-Revert-clike-Deduplicate-rpath-linker-flags.patch
@@ -0,0 +1,55 @@
+From 2fbc7b5ce3aced483b196dd10ca9eee1713b7494 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Tue, 26 Dec 2023 15:06:12 -0500
+Subject: [PATCH] Revert "clike: Deduplicate rpath linker flags"
+
+This reverts commit 53ea59ad8455277797117d225f326851fe7d369c.
+
+This breaks at least:
+- frameworks/17 mpi
+- frameworks/30 scalapack
+
+The problem is that openmpi's pkg-config emitted link arguments
+includes:
+
+```
+-Wl,-rpath -Wl,/path/to/libdir
+```
+
+The deduplication logic in meson doesn't contain sufficient information
+to tell when the compiler is passing an argument that requires values,
+and definitely cannot tell when that argument is split across argv. But
+for arguments that *can* do this, it is not possible to deduplicate a
+single argument as standalone, because it is not standalone.
+
+The argument for deduplicating rpath here was that if you have multiple
+dependencies that all add the same rpath, the Apple ld64 emits a
+non-fatal warning "duplicate -rpath ignored". Since this is non-fatal,
+it's not a major issue. A major issue is when builds fatally error out
+with:
+
+```
+FAILED: scalapack_c
+cc  -o scalapack_c scalapack_c.p/main.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group /usr/lib64/libscalapack.so /usr/lib64/liblapack.so /usr/lib64/libblas.so -Wl,-rpath -Wl,/usr/lib64 -Wl,/usr/lib64 -Wl,--enable-new-dtags /usr/lib64/libmpi.so -Wl,--end-group
+/usr/libexec/gcc/x86_64-pc-linux-gnu/ld: error: /usr/lib64: read: Is a directory
+```
+---
+ mesonbuild/compilers/mixins/clike.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
+index b3fc96cec..76c8e0413 100644
+--- a/mesonbuild/compilers/mixins/clike.py
++++ b/mesonbuild/compilers/mixins/clike.py
+@@ -54,7 +54,7 @@ class CLikeCompilerArgs(arglist.CompilerArgs):
+ 
+     # NOTE: not thorough. A list of potential corner cases can be found in
+     # https://github.com/mesonbuild/meson/pull/4593#pullrequestreview-182016038
+-    dedup1_prefixes = ('-l', '-Wl,-l', '-Wl,--export-dynamic', '-Wl,-rpath')
++    dedup1_prefixes = ('-l', '-Wl,-l', '-Wl,--export-dynamic')
+     dedup1_suffixes = ('.lib', '.dll', '.so', '.dylib', '.a')
+     dedup1_args = ('-c', '-S', '-E', '-pipe', '-pthread')
+ 
+-- 
+2.41.0
+

diff --git a/dev-build/meson/files/0001-ninja-backend-don-t-hide-all-compiler-warnings-for-t.patch b/dev-build/meson/files/0001-ninja-backend-don-t-hide-all-compiler-warnings-for-t.patch
new file mode 100644
index 0000000000..652ffd2522
--- /dev/null
+++ b/dev-build/meson/files/0001-ninja-backend-don-t-hide-all-compiler-warnings-for-t.patch
@@ -0,0 +1,250 @@
+From 5f659af870011e74299d1455a65c2cd5f5ace51f Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Tue, 5 Dec 2023 14:26:54 -0500
+Subject: [PATCH] ninja backend: don't hide all compiler warnings for
+ transpiled languages
+
+This was originally added for vala only, with the rationale that vala
+generates bad code that has warnings. Unfortunately, the rationale was
+fatally flawed. The compiler warns about a number of things, which the
+user can control depending on their code (or their code generator's
+code), but some of those things are absolutely critical to warn about.
+
+In particular, GCC 14 and clang 17 are updating their defaults to warn
+-- and error by default for -- invalid C code that breaks the standard,
+but has been silently accepted for over 20 years "because lots of people
+do it". The code in question is UB, and compilers will generate faulty
+machine code that behaves erroneously and probably has a mass of CVEs
+waiting to happen.
+
+Compiler warnings are NOT safe to just... universally turn off. Compiler
+warnings could be either:
+
+- coding style lints
+
+- threatening statements that the code is factually and behaviorally wrong
+
+There is no magic bullet to ignore the former while respecting the
+latter. And the very last thing we should ever do is pass `-w`, since
+that causes ALL warnings to be disabled, even the manually added
+`-Werror=XXX`.
+
+If vala generated code creates warnings, then the vala compiler can
+decrease the log level by generating better code, or by adding warning
+suppression pragmas for *specific* issues, such as unused functions.
+---
+ mesonbuild/backend/backends.py                | 13 ++-----
+ mesonbuild/backend/ninjabackend.py            | 19 ++++------
+ .../failing build/1 vala c werror/meson.build | 10 -----
+ .../failing build/1 vala c werror/prog.vala   |  7 ----
+ .../1 vala c werror/unused-var.c              |  8 ----
+ test cases/vala/5 target glib/meson.build     |  4 --
+ unittests/linuxliketests.py                   | 37 -------------------
+ 7 files changed, 11 insertions(+), 87 deletions(-)
+ delete mode 100644 test cases/failing build/1 vala c werror/meson.build
+ delete mode 100644 test cases/failing build/1 vala c werror/prog.vala
+ delete mode 100644 test cases/failing build/1 vala c werror/unused-var.c
+
+diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
+index 2c24e4c31..639e07b2a 100644
+--- a/mesonbuild/backend/backends.py
++++ b/mesonbuild/backend/backends.py
+@@ -986,7 +986,7 @@ class Backend:
+             return compiler.get_no_stdinc_args()
+         return []
+ 
+-    def generate_basic_compiler_args(self, target: build.BuildTarget, compiler: 'Compiler', no_warn_args: bool = False) -> 'CompilerArgs':
++    def generate_basic_compiler_args(self, target: build.BuildTarget, compiler: 'Compiler') -> 'CompilerArgs':
+         # Create an empty commands list, and start adding arguments from
+         # various sources in the order in which they must override each other
+         # starting from hard-coded defaults followed by build options and so on.
+@@ -999,17 +999,12 @@ class Backend:
+         commands += self.get_no_stdlib_args(target, compiler)
+         # Add things like /NOLOGO or -pipe; usually can't be overridden
+         commands += compiler.get_always_args()
+-        # Only add warning-flags by default if the buildtype enables it, and if
+-        # we weren't explicitly asked to not emit warnings (for Vala, f.ex)
+-        if no_warn_args:
+-            commands += compiler.get_no_warn_args()
+-        else:
+-            # warning_level is a string, but mypy can't determine that
+-            commands += compiler.get_warn_args(T.cast('str', target.get_option(OptionKey('warning_level'))))
++        # warning_level is a string, but mypy can't determine that
++        commands += compiler.get_warn_args(T.cast('str', target.get_option(OptionKey('warning_level'))))
+         # Add -Werror if werror=true is set in the build options set on the
+         # command-line or default_options inside project(). This only sets the
+         # action to be done for warnings if/when they are emitted, so it's ok
+-        # to set it after get_no_warn_args() or get_warn_args().
++        # to set it after or get_warn_args().
+         if target.get_option(OptionKey('werror')):
+             commands += compiler.get_werror_args()
+         # Add compile args for c_* or cpp_* build options set on the
+diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
+index 049ae253f..cdb747d73 100644
+--- a/mesonbuild/backend/ninjabackend.py
++++ b/mesonbuild/backend/ninjabackend.py
+@@ -1939,7 +1939,7 @@ class NinjaBackend(backends.Backend):
+         if cratetype in {'bin', 'dylib'}:
+             args.extend(rustc.get_linker_always_args())
+ 
+-        args += self.generate_basic_compiler_args(target, rustc, False)
++        args += self.generate_basic_compiler_args(target, rustc)
+         # Rustc replaces - with _. spaces or dots are not allowed, so we replace them with underscores
+         args += ['--crate-name', target.name.replace('-', '_').replace(' ', '_').replace('.', '_')]
+         depfile = os.path.join(target.subdir, target.name + '.d')
+@@ -2804,10 +2804,9 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
+             bargs = []
+         return (sargs, bargs)
+ 
+-    def _generate_single_compile(self, target: build.BuildTarget, compiler: 'Compiler',
+-                                 is_generated: bool = False) -> 'CompilerArgs':
++    def _generate_single_compile(self, target: build.BuildTarget, compiler: Compiler) -> CompilerArgs:
+         commands = self._generate_single_compile_base_args(target, compiler)
+-        commands += self._generate_single_compile_target_args(target, compiler, is_generated)
++        commands += self._generate_single_compile_target_args(target, compiler)
+         return commands
+ 
+     def _generate_single_compile_base_args(self, target: build.BuildTarget, compiler: 'Compiler') -> 'CompilerArgs':
+@@ -2825,14 +2824,10 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
+         return commands
+ 
+     @lru_cache(maxsize=None)
+-    def _generate_single_compile_target_args(self, target: build.BuildTarget, compiler: 'Compiler',
+-                                             is_generated: bool = False) -> 'ImmutableListProtocol[str]':
+-        # The code generated by valac is usually crap and has tons of unused
+-        # variables and such, so disable warnings for Vala C sources.
+-        no_warn_args = is_generated == 'vala'
++    def _generate_single_compile_target_args(self, target: build.BuildTarget, compiler: Compiler) -> ImmutableListProtocol[str]:
+         # Add compiler args and include paths from several sources; defaults,
+         # build options, external dependencies, etc.
+-        commands = self.generate_basic_compiler_args(target, compiler, no_warn_args)
++        commands = self.generate_basic_compiler_args(target, compiler)
+         # Add custom target dirs as includes automatically, but before
+         # target-specific include directories.
+         if target.implicit_include_directories:
+@@ -2901,7 +2896,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
+             if use_pch and 'mw' not in compiler.id:
+                 commands += self.get_pch_include_args(compiler, target)
+ 
+-            commands += self._generate_single_compile_target_args(target, compiler, is_generated=False)
++            commands += self._generate_single_compile_target_args(target, compiler)
+ 
+             # Metrowerks compilers require PCH include args to come after intraprocedural analysis args
+             if use_pch and 'mw' in compiler.id:
+@@ -2935,7 +2930,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
+         if use_pch and 'mw' not in compiler.id:
+             commands += self.get_pch_include_args(compiler, target)
+ 
+-        commands += self._generate_single_compile_target_args(target, compiler, is_generated)
++        commands += self._generate_single_compile_target_args(target, compiler)
+ 
+         # Metrowerks compilers require PCH include args to come after intraprocedural analysis args
+         if use_pch and 'mw' in compiler.id:
+diff --git a/test cases/failing build/1 vala c werror/meson.build b/test cases/failing build/1 vala c werror/meson.build
+deleted file mode 100644
+index 736d7aa43..000000000
+--- a/test cases/failing build/1 vala c werror/meson.build	
++++ /dev/null
+@@ -1,10 +0,0 @@
+-project('valatest', 'c', default_options : 'werror=true')
+-
+-if find_program('valac', required : false).found()
+-  add_languages('vala')
+-  valadeps = [dependency('glib-2.0'), dependency('gobject-2.0')]
+-  # Must fail due to -Werror and unused variable in C file
+-  executable('valaprog', 'prog.vala', 'unused-var.c', dependencies : valadeps)
+-else
+-  executable('failprog', 'unused-var.c')
+-endif
+diff --git a/test cases/failing build/1 vala c werror/prog.vala b/test cases/failing build/1 vala c werror/prog.vala
+deleted file mode 100644
+index 638e77660..000000000
+--- a/test cases/failing build/1 vala c werror/prog.vala	
++++ /dev/null
+@@ -1,7 +0,0 @@
+-class MainProg : GLib.Object {
+-
+-    public static int main(string[] args) {
+-        stdout.printf("Vala is working.\n");
+-        return 0;
+-    }
+-}
+diff --git a/test cases/failing build/1 vala c werror/unused-var.c b/test cases/failing build/1 vala c werror/unused-var.c
+deleted file mode 100644
+index 6b85078c9..000000000
+--- a/test cases/failing build/1 vala c werror/unused-var.c	
++++ /dev/null
+@@ -1,8 +0,0 @@
+-#warning "something"
+-
+-int
+-somelib(void)
+-{
+-  int unused_var;
+-  return 33;
+-}
+diff --git a/test cases/vala/5 target glib/meson.build b/test cases/vala/5 target glib/meson.build
+index f285d9f16..089bb3c97 100644
+--- a/test cases/vala/5 target glib/meson.build	
++++ b/test cases/vala/5 target glib/meson.build	
+@@ -1,9 +1,5 @@
+ project('valatest', 'vala', 'c')
+ 
+-if not meson.is_unity()
+-  add_global_arguments('-Werror', language : 'c')
+-endif
+-
+ valadeps = [dependency('glib-2.0', version : '>=2.32'), dependency('gobject-2.0')]
+ 
+ e = executable('valaprog', 'GLib.Thread.vala', 'retcode.c', dependencies : valadeps)
+diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py
+index 4fcf52e09..a02c99e8f 100644
+--- a/unittests/linuxliketests.py
++++ b/unittests/linuxliketests.py
+@@ -298,43 +298,6 @@ class LinuxlikeTests(BasePlatformTests):
+         self.build()
+         self._run(self.mtest_command)
+ 
+-    def test_vala_c_warnings(self):
+-        '''
+-        Test that no warnings are emitted for C code generated by Vala. This
+-        can't be an ordinary test case because we need to inspect the compiler
+-        database.
+-        https://github.com/mesonbuild/meson/issues/864
+-        '''
+-        if not shutil.which('valac'):
+-            raise SkipTest('valac not installed.')
+-        testdir = os.path.join(self.vala_test_dir, '5 target glib')
+-        self.init(testdir)
+-        compdb = self.get_compdb()
+-        vala_command = None
+-        c_command = None
+-        for each in compdb:
+-            if each['file'].endswith('GLib.Thread.c'):
+-                vala_command = each['command']
+-            elif each['file'].endswith('GLib.Thread.vala'):
+-                continue
+-            elif each['file'].endswith('retcode.c'):
+-                c_command = each['command']
+-            else:
+-                m = 'Unknown file {!r} in vala_c_warnings test'.format(each['file'])
+-                raise AssertionError(m)
+-        self.assertIsNotNone(vala_command)
+-        self.assertIsNotNone(c_command)
+-        # -w suppresses all warnings, should be there in Vala but not in C
+-        self.assertIn(" -w ", vala_command)
+-        self.assertNotIn(" -w ", c_command)
+-        # -Wall enables all warnings, should be there in C but not in Vala
+-        self.assertNotIn(" -Wall ", vala_command)
+-        self.assertIn(" -Wall ", c_command)
+-        # -Werror converts warnings to errors, should always be there since it's
+-        # injected by an unrelated piece of code and the project has werror=true
+-        self.assertIn(" -Werror ", vala_command)
+-        self.assertIn(" -Werror ", c_command)
+-
+     @skipIfNoPkgconfig
+     def test_qtdependency_pkgconfig_detection(self):
+         '''
+-- 
+2.41.0
+

diff --git a/dev-build/meson/files/meson-1.2.1-python-path.patch b/dev-build/meson/files/meson-1.2.1-python-path.patch
new file mode 100644
index 0000000000..d6151881f8
--- /dev/null
+++ b/dev-build/meson/files/meson-1.2.1-python-path.patch
@@ -0,0 +1,26 @@
+From 2b33c94e6315e9a397dd48a58a5becb0df3b8aba Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+Date: Sat, 12 Aug 2023 09:56:44 +0100
+Subject: [PATCH 2/2] python module: Respect PATH when python is not given in
+ machine file
+
+We should only fall back to the Python interpreter running Meson itself
+if `python3` is not found in the PATH.
+
+https://github.com/mesonbuild/meson/pull/12116
+
+diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
+index 5654e4231..2b2395a9b 100644
+--- a/mesonbuild/modules/python.py
++++ b/mesonbuild/modules/python.py
+@@ -381,7 +381,9 @@ class PythonModule(ExtensionModule):
+ 
+     def _find_installation_impl(self, state: 'ModuleState', display_name: str, name_or_path: str, required: bool) -> MaybePythonProg:
+         if not name_or_path:
+-            python = PythonExternalProgram('python3', mesonlib.python_command)
++            python = PythonExternalProgram('python3')
++            if not python.found():
++                python = PythonExternalProgram('python3', mesonlib.python_command)
+         else:
+             tmp_python = ExternalProgram.from_entry(display_name, name_or_path)
+             python = PythonExternalProgram(display_name, ext_prog=tmp_python)

diff --git a/dev-build/meson/files/meson-1.3.1-xtools-support.patch b/dev-build/meson/files/meson-1.3.1-xtools-support.patch
new file mode 100644
index 0000000000..6e9e670ba8
--- /dev/null
+++ b/dev-build/meson/files/meson-1.3.1-xtools-support.patch
@@ -0,0 +1,26 @@
+linkers_detect: detect xtools (Apple ld64 derivative)
+
+xtools is in use on x86_64 and ppc based darwin Prefix installs.  Pick
+it up as a valid linker.
+
+Meson is the only thing known at this point to try and figure out what
+linker is in use exactly, so instead of changing the linker (xtools),
+just teach Meson about xtools.
+
+Author: Fabian Groffen <grobian@gentoo.org>
+Bug: https://bugs.gentoo.org/868516
+
+--- a/mesonbuild/linkers/detect.py
++++ b/mesonbuild/linkers/detect.py
+@@ -185,6 +185,11 @@
+             v = search_version(o)
+ 
+         linker = linkers.LLVMDynamicLinker(compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v)
++    # detect xtools first, bug #868516
++    elif 'xtools-' in o.split('\n')[0]:
++        xtools = o.split(' ')[0]
++        v = xtools.split('-')[1]
++        linker = AppleDynamicLinker(compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v)
+     # First might be apple clang, second is for real gcc, the third is icc.
+     # Note that "ld: unknown option: " sometimes instead is "ld: unknown options:".
+     elif e.endswith('(use -v to see invocation)\n') or 'macosx_version' in e or 'ld: unknown option' in e:

diff --git a/dev-build/meson/meson-1.3.1.ebuild b/dev-build/meson/meson-1.3.1.ebuild
new file mode 100644
index 0000000000..0f026f75c3
--- /dev/null
+++ b/dev-build/meson/meson-1.3.1.ebuild
@@ -0,0 +1,134 @@
+# 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
+
+if [[ ${PV} = *9999* ]]; then
+	EGIT_REPO_URI="https://github.com/mesonbuild/meson"
+	inherit git-r3
+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 )
+	"
+	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
+
+inherit bash-completion-r1 distutils-r1 toolchain-funcs
+
+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="
+	virtual/pkgconfig
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.2.1-python-path.patch
+	"${FILESDIR}"/${PN}-1.3.1-xtools-support.patch
+
+	# backport fix for hiding compiler warnings (such as Modern C) in vala and cython
+	"${FILESDIR}"/0001-ninja-backend-don-t-hide-all-compiler-warnings-for-t.patch
+
+	# backport revert for broken rpath changes: https://github.com/mesonbuild/meson/pull/12672
+	"${FILESDIR}"/0001-Revert-clike-Deduplicate-rpath-linker-flags.patch
+)
+
+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
+}
+
+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() {
+	(
+		# 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
+}

diff --git a/dev-build/meson/metadata.xml b/dev-build/meson/metadata.xml
new file mode 100644
index 0000000000..f4b485f0be
--- /dev/null
+++ b/dev-build/meson/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>base-system@gentoo.org</email>
+	</maintainer>
+	<maintainer type="person" proxied="yes">
+		<email>eschwartz93@gmail.com</email>
+		<name>Eli Schwartz</name>
+	</maintainer>
+	<upstream>
+		<remote-id type="github">mesonbuild/meson</remote-id>
+		<remote-id type="pypi">meson</remote-id>
+	</upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/proj/prefix:master commit in: dev-build/meson/files/, dev-build/meson/
@ 2024-01-19  7:52 Fabian Groffen
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Groffen @ 2024-01-19  7:52 UTC (permalink / raw
  To: gentoo-commits

commit:     45bcbdaea2e34882fa8db8c9b43118dafa6479a1
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 19 07:51:47 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Jan 19 07:51:47 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=45bcbdae

dev-build/meson: gx86 version now has xtools support

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 dev-build/meson/Manifest                           |   2 -
 ...vert-clike-Deduplicate-rpath-linker-flags.patch |  55 -----
 ...nd-don-t-hide-all-compiler-warnings-for-t.patch | 250 ---------------------
 .../meson/files/meson-1.2.1-python-path.patch      |  26 ---
 .../meson/files/meson-1.3.1-xtools-support.patch   |  36 ---
 dev-build/meson/meson-1.3.1.ebuild                 | 134 -----------
 dev-build/meson/metadata.xml                       |  15 --
 7 files changed, 518 deletions(-)

diff --git a/dev-build/meson/Manifest b/dev-build/meson/Manifest
deleted file mode 100644
index c5619b32b9..0000000000
--- a/dev-build/meson/Manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-DIST meson-1.3.1.tar.gz 2222386 BLAKE2B 64d53eddc8cb321a4e2dabaa4b7499798a7b68764b1a7a5182bfa21d081dc07105acab616119b88ff610e5d75504f03d1c0aefee3602ddf538fc491ff3d0204a SHA512 6e694beb70329535faca9405358c04e2fd5a490b0c0d2678d5831b7de3477e0fcf4f6a242f1bc6218da04ac4f6e096ee53cdf273c6b6a38a35d370e8c16694ba
-DIST meson-1.3.1.tar.gz.asc 833 BLAKE2B 1db7aabe3b7d491dfcd288a780d10784517a73e07348f2d5b98d1fa347dd08b2afa210511c7f5ff867b10ecd3ce470ea764b5ce6907aa7dcaa4d619f705e339c SHA512 0f652d375fa7700f3048266330d783664593c08da47d4f0d87af0be5d8b5e21113521651fb923c6a1cfe88aef7067ebd85b27946f19e71133d7c9805839fc873

diff --git a/dev-build/meson/files/0001-Revert-clike-Deduplicate-rpath-linker-flags.patch b/dev-build/meson/files/0001-Revert-clike-Deduplicate-rpath-linker-flags.patch
deleted file mode 100644
index 3d40616fec..0000000000
--- a/dev-build/meson/files/0001-Revert-clike-Deduplicate-rpath-linker-flags.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 2fbc7b5ce3aced483b196dd10ca9eee1713b7494 Mon Sep 17 00:00:00 2001
-From: Eli Schwartz <eschwartz93@gmail.com>
-Date: Tue, 26 Dec 2023 15:06:12 -0500
-Subject: [PATCH] Revert "clike: Deduplicate rpath linker flags"
-
-This reverts commit 53ea59ad8455277797117d225f326851fe7d369c.
-
-This breaks at least:
-- frameworks/17 mpi
-- frameworks/30 scalapack
-
-The problem is that openmpi's pkg-config emitted link arguments
-includes:
-
-```
--Wl,-rpath -Wl,/path/to/libdir
-```
-
-The deduplication logic in meson doesn't contain sufficient information
-to tell when the compiler is passing an argument that requires values,
-and definitely cannot tell when that argument is split across argv. But
-for arguments that *can* do this, it is not possible to deduplicate a
-single argument as standalone, because it is not standalone.
-
-The argument for deduplicating rpath here was that if you have multiple
-dependencies that all add the same rpath, the Apple ld64 emits a
-non-fatal warning "duplicate -rpath ignored". Since this is non-fatal,
-it's not a major issue. A major issue is when builds fatally error out
-with:
-
-```
-FAILED: scalapack_c
-cc  -o scalapack_c scalapack_c.p/main.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group /usr/lib64/libscalapack.so /usr/lib64/liblapack.so /usr/lib64/libblas.so -Wl,-rpath -Wl,/usr/lib64 -Wl,/usr/lib64 -Wl,--enable-new-dtags /usr/lib64/libmpi.so -Wl,--end-group
-/usr/libexec/gcc/x86_64-pc-linux-gnu/ld: error: /usr/lib64: read: Is a directory
-```
----
- mesonbuild/compilers/mixins/clike.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
-index b3fc96cec..76c8e0413 100644
---- a/mesonbuild/compilers/mixins/clike.py
-+++ b/mesonbuild/compilers/mixins/clike.py
-@@ -54,7 +54,7 @@ class CLikeCompilerArgs(arglist.CompilerArgs):
- 
-     # NOTE: not thorough. A list of potential corner cases can be found in
-     # https://github.com/mesonbuild/meson/pull/4593#pullrequestreview-182016038
--    dedup1_prefixes = ('-l', '-Wl,-l', '-Wl,--export-dynamic', '-Wl,-rpath')
-+    dedup1_prefixes = ('-l', '-Wl,-l', '-Wl,--export-dynamic')
-     dedup1_suffixes = ('.lib', '.dll', '.so', '.dylib', '.a')
-     dedup1_args = ('-c', '-S', '-E', '-pipe', '-pthread')
- 
--- 
-2.41.0
-

diff --git a/dev-build/meson/files/0001-ninja-backend-don-t-hide-all-compiler-warnings-for-t.patch b/dev-build/meson/files/0001-ninja-backend-don-t-hide-all-compiler-warnings-for-t.patch
deleted file mode 100644
index 652ffd2522..0000000000
--- a/dev-build/meson/files/0001-ninja-backend-don-t-hide-all-compiler-warnings-for-t.patch
+++ /dev/null
@@ -1,250 +0,0 @@
-From 5f659af870011e74299d1455a65c2cd5f5ace51f Mon Sep 17 00:00:00 2001
-From: Eli Schwartz <eschwartz93@gmail.com>
-Date: Tue, 5 Dec 2023 14:26:54 -0500
-Subject: [PATCH] ninja backend: don't hide all compiler warnings for
- transpiled languages
-
-This was originally added for vala only, with the rationale that vala
-generates bad code that has warnings. Unfortunately, the rationale was
-fatally flawed. The compiler warns about a number of things, which the
-user can control depending on their code (or their code generator's
-code), but some of those things are absolutely critical to warn about.
-
-In particular, GCC 14 and clang 17 are updating their defaults to warn
--- and error by default for -- invalid C code that breaks the standard,
-but has been silently accepted for over 20 years "because lots of people
-do it". The code in question is UB, and compilers will generate faulty
-machine code that behaves erroneously and probably has a mass of CVEs
-waiting to happen.
-
-Compiler warnings are NOT safe to just... universally turn off. Compiler
-warnings could be either:
-
-- coding style lints
-
-- threatening statements that the code is factually and behaviorally wrong
-
-There is no magic bullet to ignore the former while respecting the
-latter. And the very last thing we should ever do is pass `-w`, since
-that causes ALL warnings to be disabled, even the manually added
-`-Werror=XXX`.
-
-If vala generated code creates warnings, then the vala compiler can
-decrease the log level by generating better code, or by adding warning
-suppression pragmas for *specific* issues, such as unused functions.
----
- mesonbuild/backend/backends.py                | 13 ++-----
- mesonbuild/backend/ninjabackend.py            | 19 ++++------
- .../failing build/1 vala c werror/meson.build | 10 -----
- .../failing build/1 vala c werror/prog.vala   |  7 ----
- .../1 vala c werror/unused-var.c              |  8 ----
- test cases/vala/5 target glib/meson.build     |  4 --
- unittests/linuxliketests.py                   | 37 -------------------
- 7 files changed, 11 insertions(+), 87 deletions(-)
- delete mode 100644 test cases/failing build/1 vala c werror/meson.build
- delete mode 100644 test cases/failing build/1 vala c werror/prog.vala
- delete mode 100644 test cases/failing build/1 vala c werror/unused-var.c
-
-diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
-index 2c24e4c31..639e07b2a 100644
---- a/mesonbuild/backend/backends.py
-+++ b/mesonbuild/backend/backends.py
-@@ -986,7 +986,7 @@ class Backend:
-             return compiler.get_no_stdinc_args()
-         return []
- 
--    def generate_basic_compiler_args(self, target: build.BuildTarget, compiler: 'Compiler', no_warn_args: bool = False) -> 'CompilerArgs':
-+    def generate_basic_compiler_args(self, target: build.BuildTarget, compiler: 'Compiler') -> 'CompilerArgs':
-         # Create an empty commands list, and start adding arguments from
-         # various sources in the order in which they must override each other
-         # starting from hard-coded defaults followed by build options and so on.
-@@ -999,17 +999,12 @@ class Backend:
-         commands += self.get_no_stdlib_args(target, compiler)
-         # Add things like /NOLOGO or -pipe; usually can't be overridden
-         commands += compiler.get_always_args()
--        # Only add warning-flags by default if the buildtype enables it, and if
--        # we weren't explicitly asked to not emit warnings (for Vala, f.ex)
--        if no_warn_args:
--            commands += compiler.get_no_warn_args()
--        else:
--            # warning_level is a string, but mypy can't determine that
--            commands += compiler.get_warn_args(T.cast('str', target.get_option(OptionKey('warning_level'))))
-+        # warning_level is a string, but mypy can't determine that
-+        commands += compiler.get_warn_args(T.cast('str', target.get_option(OptionKey('warning_level'))))
-         # Add -Werror if werror=true is set in the build options set on the
-         # command-line or default_options inside project(). This only sets the
-         # action to be done for warnings if/when they are emitted, so it's ok
--        # to set it after get_no_warn_args() or get_warn_args().
-+        # to set it after or get_warn_args().
-         if target.get_option(OptionKey('werror')):
-             commands += compiler.get_werror_args()
-         # Add compile args for c_* or cpp_* build options set on the
-diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
-index 049ae253f..cdb747d73 100644
---- a/mesonbuild/backend/ninjabackend.py
-+++ b/mesonbuild/backend/ninjabackend.py
-@@ -1939,7 +1939,7 @@ class NinjaBackend(backends.Backend):
-         if cratetype in {'bin', 'dylib'}:
-             args.extend(rustc.get_linker_always_args())
- 
--        args += self.generate_basic_compiler_args(target, rustc, False)
-+        args += self.generate_basic_compiler_args(target, rustc)
-         # Rustc replaces - with _. spaces or dots are not allowed, so we replace them with underscores
-         args += ['--crate-name', target.name.replace('-', '_').replace(' ', '_').replace('.', '_')]
-         depfile = os.path.join(target.subdir, target.name + '.d')
-@@ -2804,10 +2804,9 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
-             bargs = []
-         return (sargs, bargs)
- 
--    def _generate_single_compile(self, target: build.BuildTarget, compiler: 'Compiler',
--                                 is_generated: bool = False) -> 'CompilerArgs':
-+    def _generate_single_compile(self, target: build.BuildTarget, compiler: Compiler) -> CompilerArgs:
-         commands = self._generate_single_compile_base_args(target, compiler)
--        commands += self._generate_single_compile_target_args(target, compiler, is_generated)
-+        commands += self._generate_single_compile_target_args(target, compiler)
-         return commands
- 
-     def _generate_single_compile_base_args(self, target: build.BuildTarget, compiler: 'Compiler') -> 'CompilerArgs':
-@@ -2825,14 +2824,10 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
-         return commands
- 
-     @lru_cache(maxsize=None)
--    def _generate_single_compile_target_args(self, target: build.BuildTarget, compiler: 'Compiler',
--                                             is_generated: bool = False) -> 'ImmutableListProtocol[str]':
--        # The code generated by valac is usually crap and has tons of unused
--        # variables and such, so disable warnings for Vala C sources.
--        no_warn_args = is_generated == 'vala'
-+    def _generate_single_compile_target_args(self, target: build.BuildTarget, compiler: Compiler) -> ImmutableListProtocol[str]:
-         # Add compiler args and include paths from several sources; defaults,
-         # build options, external dependencies, etc.
--        commands = self.generate_basic_compiler_args(target, compiler, no_warn_args)
-+        commands = self.generate_basic_compiler_args(target, compiler)
-         # Add custom target dirs as includes automatically, but before
-         # target-specific include directories.
-         if target.implicit_include_directories:
-@@ -2901,7 +2896,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
-             if use_pch and 'mw' not in compiler.id:
-                 commands += self.get_pch_include_args(compiler, target)
- 
--            commands += self._generate_single_compile_target_args(target, compiler, is_generated=False)
-+            commands += self._generate_single_compile_target_args(target, compiler)
- 
-             # Metrowerks compilers require PCH include args to come after intraprocedural analysis args
-             if use_pch and 'mw' in compiler.id:
-@@ -2935,7 +2930,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
-         if use_pch and 'mw' not in compiler.id:
-             commands += self.get_pch_include_args(compiler, target)
- 
--        commands += self._generate_single_compile_target_args(target, compiler, is_generated)
-+        commands += self._generate_single_compile_target_args(target, compiler)
- 
-         # Metrowerks compilers require PCH include args to come after intraprocedural analysis args
-         if use_pch and 'mw' in compiler.id:
-diff --git a/test cases/failing build/1 vala c werror/meson.build b/test cases/failing build/1 vala c werror/meson.build
-deleted file mode 100644
-index 736d7aa43..000000000
---- a/test cases/failing build/1 vala c werror/meson.build	
-+++ /dev/null
-@@ -1,10 +0,0 @@
--project('valatest', 'c', default_options : 'werror=true')
--
--if find_program('valac', required : false).found()
--  add_languages('vala')
--  valadeps = [dependency('glib-2.0'), dependency('gobject-2.0')]
--  # Must fail due to -Werror and unused variable in C file
--  executable('valaprog', 'prog.vala', 'unused-var.c', dependencies : valadeps)
--else
--  executable('failprog', 'unused-var.c')
--endif
-diff --git a/test cases/failing build/1 vala c werror/prog.vala b/test cases/failing build/1 vala c werror/prog.vala
-deleted file mode 100644
-index 638e77660..000000000
---- a/test cases/failing build/1 vala c werror/prog.vala	
-+++ /dev/null
-@@ -1,7 +0,0 @@
--class MainProg : GLib.Object {
--
--    public static int main(string[] args) {
--        stdout.printf("Vala is working.\n");
--        return 0;
--    }
--}
-diff --git a/test cases/failing build/1 vala c werror/unused-var.c b/test cases/failing build/1 vala c werror/unused-var.c
-deleted file mode 100644
-index 6b85078c9..000000000
---- a/test cases/failing build/1 vala c werror/unused-var.c	
-+++ /dev/null
-@@ -1,8 +0,0 @@
--#warning "something"
--
--int
--somelib(void)
--{
--  int unused_var;
--  return 33;
--}
-diff --git a/test cases/vala/5 target glib/meson.build b/test cases/vala/5 target glib/meson.build
-index f285d9f16..089bb3c97 100644
---- a/test cases/vala/5 target glib/meson.build	
-+++ b/test cases/vala/5 target glib/meson.build	
-@@ -1,9 +1,5 @@
- project('valatest', 'vala', 'c')
- 
--if not meson.is_unity()
--  add_global_arguments('-Werror', language : 'c')
--endif
--
- valadeps = [dependency('glib-2.0', version : '>=2.32'), dependency('gobject-2.0')]
- 
- e = executable('valaprog', 'GLib.Thread.vala', 'retcode.c', dependencies : valadeps)
-diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py
-index 4fcf52e09..a02c99e8f 100644
---- a/unittests/linuxliketests.py
-+++ b/unittests/linuxliketests.py
-@@ -298,43 +298,6 @@ class LinuxlikeTests(BasePlatformTests):
-         self.build()
-         self._run(self.mtest_command)
- 
--    def test_vala_c_warnings(self):
--        '''
--        Test that no warnings are emitted for C code generated by Vala. This
--        can't be an ordinary test case because we need to inspect the compiler
--        database.
--        https://github.com/mesonbuild/meson/issues/864
--        '''
--        if not shutil.which('valac'):
--            raise SkipTest('valac not installed.')
--        testdir = os.path.join(self.vala_test_dir, '5 target glib')
--        self.init(testdir)
--        compdb = self.get_compdb()
--        vala_command = None
--        c_command = None
--        for each in compdb:
--            if each['file'].endswith('GLib.Thread.c'):
--                vala_command = each['command']
--            elif each['file'].endswith('GLib.Thread.vala'):
--                continue
--            elif each['file'].endswith('retcode.c'):
--                c_command = each['command']
--            else:
--                m = 'Unknown file {!r} in vala_c_warnings test'.format(each['file'])
--                raise AssertionError(m)
--        self.assertIsNotNone(vala_command)
--        self.assertIsNotNone(c_command)
--        # -w suppresses all warnings, should be there in Vala but not in C
--        self.assertIn(" -w ", vala_command)
--        self.assertNotIn(" -w ", c_command)
--        # -Wall enables all warnings, should be there in C but not in Vala
--        self.assertNotIn(" -Wall ", vala_command)
--        self.assertIn(" -Wall ", c_command)
--        # -Werror converts warnings to errors, should always be there since it's
--        # injected by an unrelated piece of code and the project has werror=true
--        self.assertIn(" -Werror ", vala_command)
--        self.assertIn(" -Werror ", c_command)
--
-     @skipIfNoPkgconfig
-     def test_qtdependency_pkgconfig_detection(self):
-         '''
--- 
-2.41.0
-

diff --git a/dev-build/meson/files/meson-1.2.1-python-path.patch b/dev-build/meson/files/meson-1.2.1-python-path.patch
deleted file mode 100644
index d6151881f8..0000000000
--- a/dev-build/meson/files/meson-1.2.1-python-path.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 2b33c94e6315e9a397dd48a58a5becb0df3b8aba Mon Sep 17 00:00:00 2001
-From: James Le Cuirot <chewi@gentoo.org>
-Date: Sat, 12 Aug 2023 09:56:44 +0100
-Subject: [PATCH 2/2] python module: Respect PATH when python is not given in
- machine file
-
-We should only fall back to the Python interpreter running Meson itself
-if `python3` is not found in the PATH.
-
-https://github.com/mesonbuild/meson/pull/12116
-
-diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
-index 5654e4231..2b2395a9b 100644
---- a/mesonbuild/modules/python.py
-+++ b/mesonbuild/modules/python.py
-@@ -381,7 +381,9 @@ class PythonModule(ExtensionModule):
- 
-     def _find_installation_impl(self, state: 'ModuleState', display_name: str, name_or_path: str, required: bool) -> MaybePythonProg:
-         if not name_or_path:
--            python = PythonExternalProgram('python3', mesonlib.python_command)
-+            python = PythonExternalProgram('python3')
-+            if not python.found():
-+                python = PythonExternalProgram('python3', mesonlib.python_command)
-         else:
-             tmp_python = ExternalProgram.from_entry(display_name, name_or_path)
-             python = PythonExternalProgram(display_name, ext_prog=tmp_python)

diff --git a/dev-build/meson/files/meson-1.3.1-xtools-support.patch b/dev-build/meson/files/meson-1.3.1-xtools-support.patch
deleted file mode 100644
index 6d766afc10..0000000000
--- a/dev-build/meson/files/meson-1.3.1-xtools-support.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 2725b6d7a35b3bbbadd65c0accd71a66ac70549d Mon Sep 17 00:00:00 2001
-From: Fabian Groffen <grobian@gentoo.org>
-Date: Wed, 17 Jan 2024 17:04:45 +0100
-Subject: [PATCH] linkers_detect: detect xtools (Apple ld64 derivative)
-
-xtools is in use on Gentoo Prefix x86_64 and ppc based Darwin installs.
-Pick it up as a valid linker.
-
-Since xtools is answering with a version to --version, as opposed to
-ld64, detection of xtools in the ld64 handling block is not possible,
-since --version already succeeded.
-
-Author: Fabian Groffen <grobian@gentoo.org>
-Bug: https://bugs.gentoo.org/868516
-Bug: https://github.com/mesonbuild/meson/issues/10805
-Signed-off-by: Fabian Groffen <grobian@gentoo.org>
----
- mesonbuild/linkers/detect.py | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/mesonbuild/linkers/detect.py b/mesonbuild/linkers/detect.py
-index 918f2e63426b..1bce413f4f52 100644
---- a/mesonbuild/linkers/detect.py
-+++ b/mesonbuild/linkers/detect.py
-@@ -174,6 +174,11 @@ def guess_nix_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Ty
-             v = search_version(o)
- 
-         linker = linkers.LLVMDynamicLinker(compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v)
-+    # detect xtools first, bug #10805
-+    elif 'xtools-' in o.split('\n', maxsplit=1)[0]:
-+        xtools = o.split(' ', maxsplit=1)[0]
-+        v = xtools.split('-', maxsplit=2)[1]
-+        linker = linkers.AppleDynamicLinker(compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v)
-     # First might be apple clang, second is for real gcc, the third is icc.
-     # Note that "ld: unknown option: " sometimes instead is "ld: unknown options:".
-     elif e.endswith('(use -v to see invocation)\n') or 'macosx_version' in e or 'ld: unknown option' in e:

diff --git a/dev-build/meson/meson-1.3.1.ebuild b/dev-build/meson/meson-1.3.1.ebuild
deleted file mode 100644
index 0f026f75c3..0000000000
--- a/dev-build/meson/meson-1.3.1.ebuild
+++ /dev/null
@@ -1,134 +0,0 @@
-# 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
-
-if [[ ${PV} = *9999* ]]; then
-	EGIT_REPO_URI="https://github.com/mesonbuild/meson"
-	inherit git-r3
-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 )
-	"
-	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
-
-inherit bash-completion-r1 distutils-r1 toolchain-funcs
-
-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="
-	virtual/pkgconfig
-"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.2.1-python-path.patch
-	"${FILESDIR}"/${PN}-1.3.1-xtools-support.patch
-
-	# backport fix for hiding compiler warnings (such as Modern C) in vala and cython
-	"${FILESDIR}"/0001-ninja-backend-don-t-hide-all-compiler-warnings-for-t.patch
-
-	# backport revert for broken rpath changes: https://github.com/mesonbuild/meson/pull/12672
-	"${FILESDIR}"/0001-Revert-clike-Deduplicate-rpath-linker-flags.patch
-)
-
-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
-}
-
-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() {
-	(
-		# 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
-}

diff --git a/dev-build/meson/metadata.xml b/dev-build/meson/metadata.xml
deleted file mode 100644
index f4b485f0be..0000000000
--- a/dev-build/meson/metadata.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
-	<maintainer type="project">
-		<email>base-system@gentoo.org</email>
-	</maintainer>
-	<maintainer type="person" proxied="yes">
-		<email>eschwartz93@gmail.com</email>
-		<name>Eli Schwartz</name>
-	</maintainer>
-	<upstream>
-		<remote-id type="github">mesonbuild/meson</remote-id>
-		<remote-id type="pypi">meson</remote-id>
-	</upstream>
-</pkgmetadata>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/proj/prefix:master commit in: dev-build/meson/files/, dev-build/meson/
@ 2024-03-27 18:07 Fabian Groffen
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Groffen @ 2024-03-27 18:07 UTC (permalink / raw
  To: gentoo-commits

commit:     77fa58d79b6f22e7095cf4bcdb2a417c446eade4
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 27 17:46:56 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Mar 27 17:46:56 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=77fa58d7

dev-build/meson-1.4.0-r1: add path to unbreak Darwin builds

Submitted upstream,
https://github.com/mesonbuild/meson/pull/13012
in the meanwhile unbreak Darwin hosts.

Closes: https://bugs.gentoo.org/923706
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 dev-build/meson/Manifest                           |   3 +
 .../meson/files/meson-1.2.1-python-path.patch      |  26 +++
 .../meson/files/meson-1.4.0-darwin-rpath.patch     | 101 ++++++++++++
 dev-build/meson/meson-1.4.0-r1.ebuild              | 181 +++++++++++++++++++++
 4 files changed, 311 insertions(+)

diff --git a/dev-build/meson/Manifest b/dev-build/meson/Manifest
new file mode 100644
index 0000000000..d7742feeed
--- /dev/null
+++ b/dev-build/meson/Manifest
@@ -0,0 +1,3 @@
+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

diff --git a/dev-build/meson/files/meson-1.2.1-python-path.patch b/dev-build/meson/files/meson-1.2.1-python-path.patch
new file mode 100644
index 0000000000..d6151881f8
--- /dev/null
+++ b/dev-build/meson/files/meson-1.2.1-python-path.patch
@@ -0,0 +1,26 @@
+From 2b33c94e6315e9a397dd48a58a5becb0df3b8aba Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+Date: Sat, 12 Aug 2023 09:56:44 +0100
+Subject: [PATCH 2/2] python module: Respect PATH when python is not given in
+ machine file
+
+We should only fall back to the Python interpreter running Meson itself
+if `python3` is not found in the PATH.
+
+https://github.com/mesonbuild/meson/pull/12116
+
+diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
+index 5654e4231..2b2395a9b 100644
+--- a/mesonbuild/modules/python.py
++++ b/mesonbuild/modules/python.py
+@@ -381,7 +381,9 @@ class PythonModule(ExtensionModule):
+ 
+     def _find_installation_impl(self, state: 'ModuleState', display_name: str, name_or_path: str, required: bool) -> MaybePythonProg:
+         if not name_or_path:
+-            python = PythonExternalProgram('python3', mesonlib.python_command)
++            python = PythonExternalProgram('python3')
++            if not python.found():
++                python = PythonExternalProgram('python3', mesonlib.python_command)
+         else:
+             tmp_python = ExternalProgram.from_entry(display_name, name_or_path)
+             python = PythonExternalProgram(display_name, ext_prog=tmp_python)

diff --git a/dev-build/meson/files/meson-1.4.0-darwin-rpath.patch b/dev-build/meson/files/meson-1.4.0-darwin-rpath.patch
new file mode 100644
index 0000000000..abcb9be6bb
--- /dev/null
+++ b/dev-build/meson/files/meson-1.4.0-darwin-rpath.patch
@@ -0,0 +1,101 @@
+From c9565bd44149041d613046d02be4cb9a5bd9ee2b Mon Sep 17 00:00:00 2001
+From: Fabian Groffen <grobian@gentoo.org>
+Date: Wed, 27 Mar 2024 17:20:16 +0000
+Subject: [PATCH] depfixer: change fix_darwin to act like fix_rpathtype_entry
+
+This somewhat aligns "darwin" (Mach-O) with how ELF RPATHs are treated.
+Instead of blindly removing all RPATHs, only remove the ones that are in
+the rpath_dirs_to_remove set.  This way, RPATHs that were added by the
+toolchain or user are left untouched.
+
+It is important not to remove RPATHs as they may be vital for the
+executable at runtime.  Issues #12045 and #12288 are examples of this.
+
+Issue: https://github.com/mesonbuild/meson/issues/12045
+Signed-off-by: Fabian Groffen <grobian@gentoo.org>
+---
+ mesonbuild/scripts/depfixer.py | 53 ++++++++++++++--------------------
+ 1 file changed, 21 insertions(+), 32 deletions(-)
+
+diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py
+index 61b7ffa642f1..71599f784e73 100644
+--- a/mesonbuild/scripts/depfixer.py
++++ b/mesonbuild/scripts/depfixer.py
+@@ -379,7 +379,7 @@ def fix_elf(fname: str, rpath_dirs_to_remove: T.Set[bytes], new_rpath: T.Optiona
+             # note: e.get_rpath() and e.get_runpath() may be useful
+             e.fix_rpath(fname, rpath_dirs_to_remove, new_rpath)
+ 
+-def get_darwin_rpaths_to_remove(fname: str) -> T.List[str]:
++def get_darwin_rpaths(fname: str) -> T.List[str]:
+     p, out, _ = Popen_safe(['otool', '-l', fname], stderr=subprocess.DEVNULL)
+     if p.returncode != 0:
+         raise subprocess.CalledProcessError(p.returncode, p.args, out)
+@@ -397,43 +397,32 @@ def get_darwin_rpaths_to_remove(fname: str) -> T.List[str]:
+             result.append(rp)
+     return result
+ 
+-def fix_darwin(fname: str, new_rpath: str, final_path: str, install_name_mappings: T.Dict[str, str]) -> None:
++def fix_darwin(fname: str, rpath_dirs_to_remove: T.Set[bytes], new_rpath: str, final_path: str, install_name_mappings: T.Dict[str, str]) -> None:
+     try:
+-        rpaths = get_darwin_rpaths_to_remove(fname)
++        old_rpaths = get_darwin_rpaths(fname)
+     except subprocess.CalledProcessError:
+         # Otool failed, which happens when invoked on a
+         # non-executable target. Just return.
+         return
++    new_rpaths: OrderedSet[str] = OrderedSet()
++    if new_rpath:
++        new_rpaths.update(new_rpath)
++    # filter out build-only rpath entries, like in
++    # fix_rpathtype_entry
++    remove_rpaths = [x.decode('utf8') for x in rpath_dirs_to_remove]
++    for rpath_dir in old_rpaths:
++        if rpath_dir and rpath_dir not in remove_rpaths:
++            new_rpaths.add(rpath_dir)
+     try:
+         args = []
+-        if rpaths:
+-            # TODO: fix this properly, not totally clear how
+-            #
+-            # removing rpaths from binaries on macOS has tons of
+-            # weird edge cases. For instance, if the user provided
+-            # a '-Wl,-rpath' argument in LDFLAGS that happens to
+-            # coincide with an rpath generated from a dependency,
+-            # this would cause installation failures, as meson would
+-            # generate install_name_tool calls with two identical
+-            # '-delete_rpath' arguments, which install_name_tool
+-            # fails on. Because meson itself ensures that it never
+-            # adds duplicate rpaths, duplicate rpaths necessarily
+-            # come from user variables. The idea of using OrderedSet
+-            # is to remove *at most one* duplicate RPATH entry. This
+-            # is not optimal, as it only respects the user's choice
+-            # partially: if they provided a non-duplicate '-Wl,-rpath'
+-            # argument, it gets removed, if they provided a duplicate
+-            # one, it remains in the final binary. A potentially optimal
+-            # solution would split all user '-Wl,-rpath' arguments from
+-            # LDFLAGS, and later add them back with '-add_rpath'.
+-            for rp in OrderedSet(rpaths):
+-                args += ['-delete_rpath', rp]
+-            subprocess.check_call(['install_name_tool', fname] + args,
+-                                  stdout=subprocess.DEVNULL,
+-                                  stderr=subprocess.DEVNULL)
+-        args = []
+-        if new_rpath:
+-            args += ['-add_rpath', new_rpath]
++        # compute diff, translate it into -delete_rpath and -add_rpath
++        # calls
++        for path in new_rpaths:
++            if path not in old_rpaths:
++                args += ['-add_rpath', path]
++        for path in old_rpaths:
++            if path not in new_rpaths:
++                args += ['-delete_rpath', path]
+         # Rewrite -install_name @rpath/libfoo.dylib to /path/to/libfoo.dylib
+         if fname.endswith('dylib'):
+             args += ['-id', final_path]
+@@ -492,4 +481,4 @@ def fix_rpath(fname: str, rpath_dirs_to_remove: T.Set[bytes], new_rpath: T.Union
+     if INSTALL_NAME_TOOL:
+         if isinstance(new_rpath, bytes):
+             new_rpath = new_rpath.decode('utf8')
+-        fix_darwin(fname, new_rpath, final_path, install_name_mappings)
++        fix_darwin(fname, rpath_dirs_to_remove, new_rpath, final_path, install_name_mappings)

diff --git a/dev-build/meson/meson-1.4.0-r1.ebuild b/dev-build/meson/meson-1.4.0-r1.ebuild
new file mode 100644
index 0000000000..e29322ee47
--- /dev/null
+++ b/dev-build/meson/meson-1.4.0-r1.ebuild
@@ -0,0 +1,181 @@
+# 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
+	"${FILESDIR}"/${PN}-1.4.0-darwin-rpath.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
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-27 18:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 18:07 [gentoo-commits] repo/proj/prefix:master commit in: dev-build/meson/files/, dev-build/meson/ Fabian Groffen
  -- strict thread matches above, loose matches on Subject: below --
2024-01-19  7:52 Fabian Groffen
2024-01-17  8:05 Fabian Groffen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox