gnome-extra/gnome-calculator: pass -fno-strict-aliasing; fix compat w/ mpc-1.4*

* Pass -fno-strict-aliasing (fixed upstream, yay)
* Fix compat w/ mpc-1.4*

Closes: https://bugs.gentoo.org/967919
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2026-04-19 00:11:38 +01:00
parent f44e029163
commit 59a24a8fc7
2 changed files with 38 additions and 2 deletions
@@ -0,0 +1,27 @@
https://gitlab.gnome.org/GNOME/gnome-calculator/-/issues/531
https://gitlab.gnome.org/GNOME/gnome-calculator/-/merge_requests/457
From c9bf69ce3688390a584ca7571ea5fcda5aea8863 Mon Sep 17 00:00:00 2001
From: Weijia Wang <contact@weijia.wang>
Date: Fri, 17 Apr 2026 16:21:25 +0200
Subject: [PATCH] Set imaginary component to +0*i when inverting a real number
---
lib/number.vala | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/number.vala b/lib/number.vala
index f45565b0..505c48eb 100644
--- a/lib/number.vala
+++ b/lib/number.vala
@@ -369,6 +369,8 @@ public class Number : GLib.Object
{
var z = new Number ();
z.num.neg (num);
+ if (!is_complex ())
+ z.num.get_imag ().val.set_zero ();
return z;
}
--
GitLab
@@ -1,9 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit gnome.org gnome2-utils meson vala virtualx xdg
inherit flag-o-matic gnome.org gnome2-utils meson vala virtualx xdg
DESCRIPTION="A calculator application for GNOME"
HOMEPAGE="https://apps.gnome.org/Calculator/"
@@ -46,7 +46,16 @@ src_prepare() {
xdg_environment_reset
}
PATCHES=(
"${FILESDIR}"/${PN}-49.2-mpc-1.4.patch
)
src_configure() {
# TODO: drop when cc1a060dfff7ce792aab99364638a85efdbeb2a0 is in a release
# https://gitlab.gnome.org/GNOME/gnome-calculator/-/issues/520
# bug #967919
append-flags -fno-strict-aliasing
local emesonargs=(
-Ddisable-ui=false
#-Dvala-version # doesn't do anything in 3.34