summaryrefslogtreecommitdiff
path: root/sci-mathematics/giac
diff options
context:
space:
mode:
Diffstat (limited to 'sci-mathematics/giac')
-rw-r--r--sci-mathematics/giac/Manifest6
-rw-r--r--sci-mathematics/giac/files/giac-1.9.0.995-fix-undefined-behavior.patch43
-rw-r--r--sci-mathematics/giac/files/giac-1.9.0.995-glibcxx-assertions.patch38
-rw-r--r--sci-mathematics/giac/giac-1.9.0.995-r1.ebuild (renamed from sci-mathematics/giac/giac-1.9.0.93.ebuild)17
4 files changed, 98 insertions, 6 deletions
diff --git a/sci-mathematics/giac/Manifest b/sci-mathematics/giac/Manifest
index 7300d4cfb300..a47bb8cd4771 100644
--- a/sci-mathematics/giac/Manifest
+++ b/sci-mathematics/giac/Manifest
@@ -4,8 +4,10 @@ AUX giac-1.9.0.21-pari-2.15.patch 298 BLAKE2B 99329cfd473ec3b580caf8f9700501e8b5
AUX giac-1.9.0.67-system-gl2ps.patch 2283 BLAKE2B 6c98e3ea09f0f8b0e34e2634218595d576e7eee85234e56436db24fe0aa276288f58049bcfb374ae42d7f104b44f0d51b3e81acc6e2e9af1cecc4e4adadfada8 SHA512 88dae722242b81ee22b7d377e4fd4b98d1e687307aaf3091ab17ffc720678bedb93c30bc0fd92c0388b7994945b820f31dd57e831736b6dd29e5d8285320d4e6
AUX giac-1.9.0.93-glibcxx-assertions.patch 1135 BLAKE2B 5dc1f882f0832f305dbc24789e1ec3fde79ac6f203fef013d330f6cc268fe5366dd938cf6f141d7f3dad7aff6d012d65693d9daea20745d8bc87f15dc55453d1 SHA512 cd882c469a7af89dad475cd77f9a3625f914a6b522eba8eb12275535552da5d98bab63e6b84ba730766976ee3fe70bd414143febb3b5de55727e7da854c0cad9
AUX giac-1.9.0.93-no-fltk-buildfix.patch 1690 BLAKE2B 7ff97352ebe164107700ed0a45cfe25df7685ac69684cdfe6811235db2d2020322791868ef2b503281095120083ac8c63f0982c1eec9baac009c8642dca2229d SHA512 4a739550164d0555ddfaec7a02e2fe43f5dcdbc752d7d785ae8c4d1bad7b3e18d15ff2c5670129fc99b9680e6198f87b1517255a03b390bfcadfa0a02f28752f
+AUX giac-1.9.0.995-fix-undefined-behavior.patch 1296 BLAKE2B f181960feaa2ef42a0d5bb8a3d060fd3e3f62416135d6204c6d4682f58c727b4a734b538b9be52b4e6750d6415e2c08812196f50acf99e147b8f4215f0e37280 SHA512 7d394a3f60b977d5cbc6afded350fb1296823d85adc73b9c215f0882e500660d2c4eefb79c0f451eb60009e86430f8cf10566ef6e8a9cdeca087e489c14fd7d6
+AUX giac-1.9.0.995-glibcxx-assertions.patch 1292 BLAKE2B 640dca5b736c151aedd5ed5bed7c49a468bf70978f2b671b2d67d5bc1248b9921b876fdb097ffa5b1b701f5337dbb601c7217307173d322a376a61f35508c742 SHA512 39b2d553bc3e0dedf53acca38e80b8ca76f4f0308603f0f67d881430e635f008ea618d1a7478e6c215c960b189c6d4fd83073ee2171fb2d2b3921095de53db23
DIST giac_1.9.0-29.tar.gz 115441843 BLAKE2B 9114db489be0c51d67c87b0a0c187fecf9eca84d7cb3117e72793290c8e606e76c3d9bc8a2d573fc2de2f2d885fb34d18583302a5902d69045976114ac02b95e SHA512 57b58aa35c724eae7df36229cb3d45d1b724a8a88acb1d1dd0711be64dd7c891850e7242662e448ce955e76b856973f9065628b65ce0826c60e277cb944b21b7
-DIST giac_1.9.0-93.tar.gz 115117442 BLAKE2B 397c64c5587fadca37b3298fef8c15c2977ded30849af2f3d3ee8a083d26f8db4645ac6a0db2fce4e254144cdc70b88d3313de58a502510e21a22927e1af3505 SHA512 b8c7d7070218afdfdb8f9a94911407860ab81ead9a60adf7f0c0cec3c50cec5fad3a439269192a01ef4d55ed822a4a619b123b6938ba76f9aba3537d14bc4680
+DIST giac_1.9.0-995.tar.gz 128346387 BLAKE2B c275d2cad511b906a3822156bd05f83cd77265cf489da82b111973b0a80de7abd1875d0cf0116e34610aa20b5ea2cc36550950dbf1eb1a321db8c7145c789137 SHA512 7111a21df5efe1ef5f14dc744277e18f3e4701842d827da0f8d745e1bcec4c06b45e3306b7ed3c4affee59c5df2454643900eefe32d46019771e6bb07bc971d9
EBUILD giac-1.9.0.29-r1.ebuild 4542 BLAKE2B dce03818ac9af080b4416b6546563e4be99617b220c4661a540f77e0127760582cfe0a3df8c6a2f94da676b8a0e9fa967be59748184b86eb8934481c607d7500 SHA512 6915110b6964d2e79d7da01cee85ee3b51b944f9879e5659447f0cba5d74bda8c4113ee9290203510fdb57ad1ba60eae52639b134ed74eec01b04a97d75cf066
-EBUILD giac-1.9.0.93.ebuild 5112 BLAKE2B c9de1431f29cc2d4c75c0584887bceb7856e5e1277d3238cc442a786fe52ed46ca27b21fc4202a0707d958a7a8b0440208917e8ea9c72aa2d9f3fefb28827c66 SHA512 93faf00338c23b2893be12b630d5de460c921cb23f70822f17f3017f91416783f93b2984f01e12a66f0b4b546e20d70a5896f6af439749c6a2fb84ae68df1ce0
+EBUILD giac-1.9.0.995-r1.ebuild 5505 BLAKE2B 68dec9bdc7b5245c7768379f0ad59c0ab88694cf934f09f628835034cde12c765d9407ccb90a6f03bc1afa5ace636a24c23f268a38f95442ce0848ed9ef96ad9 SHA512 0fef66cfc86e1cb92cd71fbd3ee5e3e71b5ab13cd084ed7fe4e0db46dce310d64cb5b9e93bdb02940dba57d945b65bb8e73b89dfe8f9dc599107722cbc40fc8a
MISC metadata.xml 1315 BLAKE2B a461d359b33617422f5863466bdbec9ddf56db03467b992c887bce9967d434913489602fd684edc893303078f89cf94d01b44cfdc0ccff33db9b42c5e686cfa8 SHA512 eaeb480010c9dbdfd75516e45e97e3226d2b2812c44e217b318c5a1d86dc40820bac0de69686d7b502775b14a6f1ed3bc11d2372b891c46a37080b4e84da9a1c
diff --git a/sci-mathematics/giac/files/giac-1.9.0.995-fix-undefined-behavior.patch b/sci-mathematics/giac/files/giac-1.9.0.995-fix-undefined-behavior.patch
new file mode 100644
index 000000000000..92d37ae93fa8
--- /dev/null
+++ b/sci-mathematics/giac/files/giac-1.9.0.995-fix-undefined-behavior.patch
@@ -0,0 +1,43 @@
+From 864ecde569ce9fad636abe1135de33fdc94e6981 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Thu, 5 Sep 2024 19:49:07 -0400
+Subject: [PATCH 1/1] src/vecteur.cc: skip undefined behavior with a bounds
+ check
+
+---
+ src/vecteur.cc | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/vecteur.cc b/src/vecteur.cc
+index de10197..119d454 100644
+--- a/src/vecteur.cc
++++ b/src/vecteur.cc
+@@ -8490,6 +8490,17 @@ namespace giac {
+ }
+ else {
+ int C=col+1;
++ // mjo: C can be equal to cmax here, which makes buffer[C]
++ // illegal. In that case, however, nothing will happen
++ // below:
++ //
++ // 1. C = cmax ==> C >= (cmax-4), so the "for" loop is skipped
++ // 2. After the "for" loop, C += ptr-&buffer[C] sets C to zero
++ // 3. Now C = cmax means that the second "for" loop is skipped
++ //
++ // As a result, we can comment out this whole thing when
++ // C = cmax to avoid a crash.
++ if (C < cmax) {
+ longlong * ptr= &buffer[C],*ptrend=&buffer[0]+cmax-4;
+ const int *ptrN=&Nline[C];
+ for (;ptr<ptrend;ptrN+=4,ptr+=4){
+@@ -8502,6 +8513,7 @@ namespace giac {
+ for (;C<cmax;++C){
+ buffer[C] -= coeff*Nline[C];
+ }
++ }
+ }
+ }
+ // copy back buffer to N[l]
+--
+2.44.2
+
diff --git a/sci-mathematics/giac/files/giac-1.9.0.995-glibcxx-assertions.patch b/sci-mathematics/giac/files/giac-1.9.0.995-glibcxx-assertions.patch
new file mode 100644
index 000000000000..4c0d6d7d8d0a
--- /dev/null
+++ b/sci-mathematics/giac/files/giac-1.9.0.995-glibcxx-assertions.patch
@@ -0,0 +1,38 @@
+From Michael Orlitzky <michael@orlitzky.com> in the original version
+of the patch:
+
+This was added upstream when it was pointed out that the codebase
+contains undefined behavior that triggers glibcxx's assertions.
+Disabling the assertions without fixing the undefined behavior is not
+a satisfactory solution, so we drop the override.
+
+diff --git a/configure.ac b/configure.ac
+index 96b0223..cdc5618 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -48,7 +48,7 @@ AC_CHECK_FUNCS(tgammaf)
+ dnl avoid "security" checks for vectors is also included in first.h
+ dnl use -std=c++17 -march=native for vectorclass v2 optimizations
+ dnl -DUSE_OBJET_BIDON added because xcas::localisation() does not load locales correctly for modules loaded before main() is executed
+-CXXFLAGS="$CXXFLAGS -U_GLIBCXX_ASSERTIONS -DUSE_OBJET_BIDON"
++CXXFLAGS="$CXXFLAGS -DUSE_OBJET_BIDON"
+
+ dnl Define DOUBLEVAL if bigendian
+ if test "x$ac_cv_c_bigendian" = "xyes"; then
+diff --git a/src/first.h b/src/first.h
+index 7852c73..21e15b9 100644
+--- a/src/first.h
++++ b/src/first.h
+@@ -25,9 +25,9 @@
+ #define register
+
+
+-#ifdef _GLIBCXX_ASSERTIONS
+-#undef _GLIBCXX_ASSERTIONS
+-#endif
++// #ifdef _GLIBCXX_ASSERTIONS
++// #undef _GLIBCXX_ASSERTIONS
++// #endif
+
+ #if defined NUMWORKS && !defined SDL_KHICAS
+ #define KHICAS 1
diff --git a/sci-mathematics/giac/giac-1.9.0.93.ebuild b/sci-mathematics/giac/giac-1.9.0.995-r1.ebuild
index 9f42bdacc1a7..6a9a85a14f05 100644
--- a/sci-mathematics/giac/giac-1.9.0.93.ebuild
+++ b/sci-mathematics/giac/giac-1.9.0.995-r1.ebuild
@@ -10,6 +10,7 @@ MY_PV=$(ver_cut 1-3)
DESCRIPTION="A free C++ Computer Algebra System library and its interfaces"
HOMEPAGE="https://www-fourier.ujf-grenoble.fr/~parisse/giac.html"
SRC_URI="https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/${FETCH_P}.tar.gz"
+S="${WORKDIR}/${PN}-${MY_PV}"
# The licensing is explained in README. We disable or delete several
# bundled features (MicroPytho, QuickJS, FLTK, gl2ps) that are
@@ -58,7 +59,7 @@ PATCHES=(
"${FILESDIR}/${PN}-1.9.0.21-pari-2.15.patch"
"${FILESDIR}/${PN}-1.9.0.67-system-gl2ps.patch"
"${FILESDIR}/${P}-glibcxx-assertions.patch"
- "${FILESDIR}/${P}-no-fltk-buildfix.patch"
+ "${FILESDIR}/${P}-fix-undefined-behavior.patch"
)
REQUIRED_USE="test? ( gui )"
@@ -68,8 +69,6 @@ REQUIRED_USE="test? ( gui )"
# holder."
RESTRICT="!test? ( test ) mirror"
-S="${WORKDIR}/${PN}-${MY_PV}"
-
src_prepare() {
# giac-1.9.0.55 tries to compile a bundled version of FLTK for you
# if you pass --enable-fltk but the system version isn't detected.
@@ -79,12 +78,22 @@ src_prepare() {
# similar deal with gl2ps
rm src/gl2ps.[ch] || die
+ # These are executable (ARM) build artifacts that should not have
+ # been shipped. We remove them so they can be rebuilt properly.
+ rm src/mkjs doc/khicas.nwa || die
+
+ # Don't waste time eautoreconfing the bundled micropython that we
+ # never use.
+ sed -e 's/micropython-1.12//g' -i Makefile.am || die
+ sed -e '/micropython-1.12/d' -i configure.ac || die
+ rm -r micropython-1.12 || die
+
default
eautoreconf
}
src_configure() {
- append-cxxflags -std=c++14 # bug 788283
+ append-cxxflags -std=c++17 # bug 788283
if use gui; then
append-cppflags -I$(fltk-config --includedir)