Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-util/meson: backport fix for broken configure_file() which caused portage to miscompile #34099

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,31 @@
From 9016e6958bb83feb9a724f20d8badb116bf7c5f2 Mon Sep 17 00:00:00 2001
From: Jan200101 <sentrycraft123@gmail.com>
Date: Tue, 21 Nov 2023 08:42:56 +0100
Subject: [PATCH] Only convert boolean values for cmake formats

This caused a regression with mesondefine where
`conf_data.set("FOO", true)`
turned into
`#define FOO 1`
instead of
`#define FOO`
---
mesonbuild/utils/universal.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py
index 26194628c..93e64c0a2 100644
--- a/mesonbuild/utils/universal.py
+++ b/mesonbuild/utils/universal.py
@@ -1210,7 +1210,7 @@ def do_replacement(regex: T.Pattern[str], line: str,
var, _ = confdata.get(varname)
if isinstance(var, str):
var_str = var
- elif isinstance(var, bool):
+ elif variable_format.startswith("cmake") and isinstance(var, bool):
var_str = str(int(var))
elif isinstance(var, int):
var_str = str(var)
--
2.41.0

Expand Up @@ -54,6 +54,9 @@ RDEPEND="

PATCHES=(
"${FILESDIR}"/${PN}-1.2.1-python-path.patch

# backport fix for broken configure_file()
"${FILESDIR}"/0001-Only-convert-boolean-values-for-cmake-formats.patch
)

python_prepare_all() {
Expand Down
5 changes: 5 additions & 0 deletions profiles/package.mask
Expand Up @@ -33,6 +33,11 @@

#--- END OF EXAMPLES ---

# Eli Schwartz <eschwartz93@gmail.com> (2023-12-02)
# Has a bug that breaks sys-apps/portage. Upgrade to 1.3.0-r1 instead.
# Bug #919072.
=dev-util/meson-1.3.0

# Michał Górny <mgorny@gentoo.org> (2023-11-30)
# Last commit in 2020. It was used exclusively by dev-python/ipython,
# and it is used no more.
Expand Down