mate-extra/mate-calc: fix compat w/ mpc-1.4*

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2026-04-19 21:23:14 +01:00
parent e87372497f
commit e6c11abf60
2 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
https://github.com/mate-desktop/mate-calc/issues/239
https://github.com/mate-desktop/mate-calc/pull/240
From 220027f5ab946a1ca38f9888fdbe64630106aecc Mon Sep 17 00:00:00 2001
From: mbkma <johannes.unruh@fau.de>
Date: Sun, 19 Apr 2026 11:32:51 +0200
Subject: [PATCH] Set imaginary component to +0*i when inverting a real number
see https://gitlab.gnome.org/GNOME/gnome-calculator/-/merge_requests/457
---
src/mp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/mp.c b/src/mp.c
index 31a84d4d..08e7afce 100644
--- a/src/mp.c
+++ b/src/mp.c
@@ -398,6 +398,10 @@ void
mp_invert_sign(const MPNumber *x, MPNumber *z)
{
mpc_neg(z->num, x->num, MPC_RNDNN);
+ if (!mp_is_complex(x))
+ {
+ mpfr_set_zero(mpc_imagref(z->num), MPFR_RNDN);
+ }
}
void

View File

@@ -0,0 +1,40 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit mate
MINOR=$(($(ver_cut 2) % 2))
if [[ ${MINOR} -eq 0 ]]; then
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~x86"
fi
DESCRIPTION="Calculator for MATE"
LICENSE="CC-BY-SA-3.0 GPL-2+"
SLOT="0"
COMMON_DEPEND="
>=app-accessibility/at-spi2-core-2.46.0
>=dev-libs/glib-2.50:2
dev-libs/libxml2:2=
dev-libs/mpc:=
>=dev-libs/mpfr-4.0.2:=
>=x11-libs/gtk+-3.22:3
x11-libs/pango
"
RDEPEND="${COMMON_DEPEND}
virtual/libintl
"
BDEPEND="${COMMON_DEPEND}
app-text/yelp-tools
dev-libs/libxml2
>=sys-devel/gettext-0.19.8
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}"/${PN}-1.28.0-mpc-1.4.patch
)