Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/libqalculate/, sci-libs/libqalculate/files/
Date: Thu, 29 Dec 2022 22:45:04
Message-Id: 1672353721.40937d5af20e7e4d82592013d254a00d54c245c9.sam@gentoo
1 commit: 40937d5af20e7e4d82592013d254a00d54c245c9
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 29 22:41:47 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 29 22:42:01 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40937d5a
7
8 sci-libs/libqalculate: add 4.5.0
9
10 Bug: https://bugs.gentoo.org/887369
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 sci-libs/libqalculate/Manifest | 1 +
14 .../files/libqalculate-4.5.0-tests.patch | 81 +++++++++++++++++++++
15 sci-libs/libqalculate/libqalculate-4.5.0.ebuild | 83 ++++++++++++++++++++++
16 sci-libs/libqalculate/metadata.xml | 5 ++
17 4 files changed, 170 insertions(+)
18
19 diff --git a/sci-libs/libqalculate/Manifest b/sci-libs/libqalculate/Manifest
20 index dfa964a4533d..fa43c41f3e1f 100644
21 --- a/sci-libs/libqalculate/Manifest
22 +++ b/sci-libs/libqalculate/Manifest
23 @@ -3,3 +3,4 @@ DIST libqalculate-3.22.0.tar.gz 2150167 BLAKE2B 2023dc00e516f26d93e6acae66acb621
24 DIST libqalculate-4.1.1.tar.gz 2172017 BLAKE2B e9dcc22ad2d102572610ddc103afc5a279cf4f63681750c6165dac40225c7e29ebb4ccdc4f54cb97031ca8684ef17e08e99478c6b200870c7858e832a7588f18 SHA512 7a0f2fac6c96247b40565bdd015f8b52dc250fa74a8d8ed4a52a6f2134fb2b628e469c0253723f22b433a8f575590a28be8c0d4aa6cfb473b58f1b2c63707956
25 DIST libqalculate-4.2.0.tar.gz 2215812 BLAKE2B 393bab0d9cf5d4a3158d93bf676805d829a2103ec1dc733e3d98fd7a54ab0c42d3797dadb1cde72b1df2e13cfb691430982f5fbd886ac9f0a906b3884f912202 SHA512 105f567a3b24a1c396df0eb85f299d18228f489e4d989f0fa09cf97321494030e9a85d9cd9fe4b5dd8cc233b4329025788275ba168546929e912598dee8ef6b8
26 DIST libqalculate-4.3.0.tar.gz 2230559 BLAKE2B 724dde0bc16e5eaed63420c6dd68ac7c94477c44c007c92bb3b4560d8a2d2062ade4be6d2c8005ff64bf8ffe4c42d95d6990f7900df7a1c1a36cd4cd717bd04d SHA512 234c111435d9461ab65d274030f9a5f6ee401cd81df62b9c2273e921edb8db3bde4254060285dbfaa7b9701a257a5801c8ab8f26b0c2aeeafd2a36042bdeeb84
27 +DIST libqalculate-4.5.0.tar.gz 2603599 BLAKE2B 142790cf89e97c601b08d553b1f9cd6c1bf184a43c2614a07fa91560a875ea3e3124cf29d7652640b1f2fb4fada1519d48e4cb0ebcfb844c26369d3031aee230 SHA512 a123eaa725c6c6badce0eceecd6ef7e37ca281e7de18085d6a28aa6043bb3f1069f9ebba82b29989c9958455aa093ee183fd8013a86b39bd34e56454bdb35770
28
29 diff --git a/sci-libs/libqalculate/files/libqalculate-4.5.0-tests.patch b/sci-libs/libqalculate/files/libqalculate-4.5.0-tests.patch
30 new file mode 100644
31 index 000000000000..102b245a56b1
32 --- /dev/null
33 +++ b/sci-libs/libqalculate/files/libqalculate-4.5.0-tests.patch
34 @@ -0,0 +1,81 @@
35 +https://github.com/Qalculate/libqalculate/commit/e4c86b6124a3c8732f03dc1dfc8be9fac14a40eb
36 +
37 +From e4c86b6124a3c8732f03dc1dfc8be9fac14a40eb Mon Sep 17 00:00:00 2001
38 +From: Hanna K <hanna.knutsson@××××××××××.com>
39 +Date: Wed, 28 Dec 2022 09:44:40 +0100
40 +Subject: [PATCH] Fix unit tests (issue #499); Fix some limits broken by
41 + countTotalChildren() update
42 +
43 +--- a/libqalculate/MathStructure-limit.cc
44 ++++ b/libqalculate/MathStructure-limit.cc
45 +@@ -595,7 +595,7 @@ bool calculate_limit_sub(MathStructure &mstruct, const MathStructure &x_var, con
46 + }
47 + }
48 + }
49 +- if(!b_possible_zero && !b_fail && lhop_depth < 5 && !mzero.isOne() && !minfp.isOne() && mzero.countTotalChildren(false) + minfp.countTotalChildren(false) < 50) {
50 ++ if(!b_possible_zero && !b_fail && lhop_depth < 5 && !mzero.isOne() && !minfp.isOne() && mzero.countTotalChildren(false) + minfp.countTotalChildren(false) < 250) {
51 + //L'Hôpital's rule
52 + MathStructure mden, mnum;
53 + for(size_t i2 = 0; i2 < 2; i2++) {
54 +--- a/tests/calculus.batch
55 ++++ b/tests/calculus.batch
56 +@@ -1,7 +1,7 @@
57 + diff(6x^2)
58 + 12x
59 + diff(sinh(x^2)/(5x) + 3xy/sqrt(x))
60 +- 0.4 * cosh(x^2) - sinh(x^2) / (5x^2) + (3y) / (2 * sqrt(x))
61 ++ 0.4 * cosh(x^2) + (3y) / (2 * sqrt(x)) - sinh(x^2) / (5x^2)
62 +
63 + integrate(6x^2)
64 + 2x^3 + C
65 +--- a/tests/solver.batch
66 ++++ b/tests/solver.batch
67 +@@ -23,37 +23,37 @@ x^(-3x) = 2
68 + x = e^lambertw(-ln(2) / 3) or x = e^lambertw(-ln(2) / 3, -1)
69 +
70 + 1/3 * sin(3x) - 1/3 = 0
71 +- x = pi / 6 + (2/3) * pi * n
72 ++ x = (2/3) * pi * n + pi / 6
73 +
74 + 2/3 * sin(3x) - 1/3 = 0
75 +- x = (5/18) * pi + (2/3) * pi * n or x = pi / 18 + (2/3) * pi * n
76 ++ x = (2/3) * pi * n + (5/18) * pi or x = (2/3) * pi * n + pi / 18
77 +
78 + sin(x) + cos(x) = 1
79 +- x = 2 pi * n or x = pi / 2 + 2 pi * n
80 ++ x = 2 pi * n or x = 2 pi * n + pi / 2
81 +
82 + sin(x) = 1 + cos(x)
83 +- x = pi + 2 pi * n or x = pi / 2 + 2 pi * n
84 ++ x = 2 pi * n + pi or x = 2 pi * n + pi / 2
85 +
86 + sqrt(2) * cos(3x + pi/6) = 1
87 +- x = (2/3) * pi * n - (5/36) * pi or x = pi / 36 + (2/3) * pi * n
88 ++ x = (2/3) * pi * n + pi / 36 or x = (2/3) * pi * n - (5/36) * pi
89 +
90 + 2 * sin(3x/4) = 1
91 +- x = (10/9) * pi + (8/3) * pi * n or x = (2/9) * pi + (8/3) * pi * n
92 ++ x = (8/3) * pi * n + (10/9) * pi or x = (8/3) * pi * n + (2/9) * pi
93 +
94 + tan(x/4 + pi/3) = sqrt(3)
95 + x = 4 pi * n
96 +
97 + sqrt(3) * sin(x) + cos(x) = sqrt(3)
98 +- x = pi / 2 + 2 pi * n or x = pi / 6 + 2 pi * n
99 ++ x = 2 pi * n + pi / 2 or x = 2 pi * n + pi / 6
100 +
101 + sin(x)^2 = sin(x)^3
102 +- x = pi * n or x = pi / 2 + 2 pi * n
103 ++ x = pi * n or x = 2 pi * n + pi / 2
104 +
105 + sin(x) = sin(x/2)
106 +- x = 2 pi * n or x = 4 pi * n - (2/3) * pi or x = (2/3) * pi + 4 pi * n
107 ++ x = 2 pi * n or x = 4 pi * n + (2/3) * pi or x = 4 pi * n - (2/3) * pi
108 +
109 + sin(4x) + cos(2x) = 0
110 +- x = pi * n - pi / 12 or x = (7/12) * pi + pi * n or x = (pi * n) / 2 - pi / 4
111 ++ x = pi * n + (7/12) * pi or x = pi * n - pi / 12 or x = (pi * n) / 2 - pi / 4
112 +
113 + /set approximation try exact
114 +
115 +
116
117 diff --git a/sci-libs/libqalculate/libqalculate-4.5.0.ebuild b/sci-libs/libqalculate/libqalculate-4.5.0.ebuild
118 new file mode 100644
119 index 000000000000..d967fd779daf
120 --- /dev/null
121 +++ b/sci-libs/libqalculate/libqalculate-4.5.0.ebuild
122 @@ -0,0 +1,83 @@
123 +# Copyright 1999-2022 Gentoo Authors
124 +# Distributed under the terms of the GNU General Public License v2
125 +
126 +EAPI=8
127 +
128 +# Bump with sci-calculators/qalculate-gtk!
129 +
130 +inherit toolchain-funcs
131 +
132 +DESCRIPTION="A modern multi-purpose calculator library"
133 +HOMEPAGE="https://qalculate.github.io/"
134 +SRC_URI="https://github.com/Qalculate/${PN}/releases/download/v${PV}/${P}.tar.gz"
135 +
136 +LICENSE="GPL-2"
137 +# SONAME changes pretty often on bumps. Check!
138 +SLOT="0/22"
139 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
140 +IUSE="curl icu gnuplot +hardened readline test"
141 +RESTRICT="!test? ( test )"
142 +
143 +DEPEND="dev-libs/gmp:=
144 + dev-libs/libxml2:2
145 + dev-libs/mpfr:=
146 + virtual/libiconv
147 + curl? ( net-misc/curl )
148 + icu? ( dev-libs/icu:= )
149 + readline? ( sys-libs/readline:= )"
150 +RDEPEND="${DEPEND}
151 + gnuplot? ( >=sci-visualization/gnuplot-3.7 )"
152 +BDEPEND="dev-util/intltool
153 + sys-devel/gettext
154 + virtual/pkgconfig"
155 +
156 +PATCHES=(
157 + "${FILESDIR}"/${P}-tests.patch
158 +)
159 +
160 +src_prepare() {
161 + default
162 +
163 + cat >po/POTFILES.skip <<-EOF || die
164 + # Required by make check
165 + data/currencies.xml.in
166 + data/datasets.xml.in
167 + data/elements.xml.in
168 + data/functions.xml.in
169 + data/planets.xml.in
170 + data/prefixes.xml.in
171 + data/units.xml.in
172 + data/variables.xml.in
173 + src/defs2doc.cc
174 + EOF
175 +}
176 +
177 +src_configure() {
178 + # Needed for po-defs/Makefile
179 + export CXX_FOR_BUILD="$(tc-getBUILD_CXX)"
180 + export CXXCPP_FOR_BUILD="$(tc-getBUILD_CXX) -E"
181 +
182 + # bug #792027
183 + tc-export CC
184 +
185 + econf \
186 + $(use_enable test tests) \
187 + $(use_enable test unittests) \
188 + $(use_with curl libcurl) \
189 + $(use_with gnuplot gnuplot-call) \
190 + $(use_enable !hardened insecure) \
191 + $(use_with icu) \
192 + $(use_with readline)
193 +}
194 +
195 +src_install() {
196 + # docs/reference/Makefile.am -> referencedir=
197 + emake \
198 + DESTDIR="${D}" \
199 + referencedir="${EPREFIX}/usr/share/doc/${PF}/html" \
200 + install
201 +
202 + einstalldocs
203 +
204 + find "${ED}" -name '*.la' -delete || die
205 +}
206
207 diff --git a/sci-libs/libqalculate/metadata.xml b/sci-libs/libqalculate/metadata.xml
208 index 284c82a7b616..39ddc8a41c49 100644
209 --- a/sci-libs/libqalculate/metadata.xml
210 +++ b/sci-libs/libqalculate/metadata.xml
211 @@ -5,6 +5,11 @@
212 <email>sci@g.o</email>
213 <name>Gentoo Science Project</name>
214 </maintainer>
215 + <use>
216 + <flag name="hardened">
217 + Disable unsafe functions like 'command' and variables like 'uptime'.
218 + </flag>
219 + </use>
220 <upstream>
221 <remote-id type="sourceforge">qalculate-0.9.7</remote-id>
222 <remote-id type="github">Qalculate/libqalculate</remote-id>