Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@××××××.net>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-mathematics/giac/files/, sci-mathematics/giac/
Date: Fri, 29 Jan 2021 11:15:21
Message-Id: 1611918916.8b84c4eeee61faa734bffdd0fe39fa3319ddbfe3.andrewammerlaan@gentoo
1 commit: 8b84c4eeee61faa734bffdd0fe39fa3319ddbfe3
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
3 AuthorDate: Fri Jan 29 11:14:32 2021 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
5 CommitDate: Fri Jan 29 11:15:16 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=8b84c4ee
7
8 sci-mathematics/giac: fix SRC_URI
9
10 thanks to @kiwifb and the sage-on-gentoo overlay
11
12 Package-Manager: Portage-3.0.14, Repoman-3.0.2
13 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>
14
15 .../giac/files/giac-1.6.0.17-gsl_lapack.patch | 84 ++++++++++++++
16 sci-mathematics/giac/files/pari_2_11.patch | 17 +++
17 sci-mathematics/giac/giac-1.6.0.47.ebuild | 121 +++++++++++++++++++++
18 sci-mathematics/giac/giac-1.6.0.ebuild | 75 -------------
19 sci-mathematics/giac/metadata.xml | 17 ++-
20 5 files changed, 233 insertions(+), 81 deletions(-)
21
22 diff --git a/sci-mathematics/giac/files/giac-1.6.0.17-gsl_lapack.patch b/sci-mathematics/giac/files/giac-1.6.0.17-gsl_lapack.patch
23 new file mode 100644
24 index 000000000..24d6c8f56
25 --- /dev/null
26 +++ b/sci-mathematics/giac/files/giac-1.6.0.17-gsl_lapack.patch
27 @@ -0,0 +1,84 @@
28 +diff --git a/configure.ac b/configure.ac
29 +index 1e38e50..6625bc7 100644
30 +--- a/configure.ac
31 ++++ b/configure.ac
32 +@@ -38,6 +38,7 @@ AC_LANG([C++])
33 + AC_PROG_LIBTOOL
34 + AC_PROG_YACC
35 + AM_PROG_LEX
36 ++PKG_PROG_PKG_CONFIG
37 + AC_C_BIGENDIAN
38 +
39 + dnl Check for standard C+headers
40 +@@ -145,47 +146,17 @@ AC_CHECK_SIZEOF(long)
41 + AC_CHECK_SIZEOF(long long)
42 +
43 + dnl Checking for Gnu Sci Lib
44 +-CONFIG_GSL="yes"
45 +-AC_ARG_ENABLE([gsl],[
46 +- AS_HELP_STRING([--enable-gsl], [Use GNU scientific library [[default=yes]]])],
47 +- [ if test "x$enableval" = "xno"; then CONFIG_GSL="no"; fi], [])
48 +-
49 +-if test "$CONFIG_GSL" = "yes"; then
50 +- AC_CHECK_HEADERS(gsl/gsl_blas.h)
51 +- AC_CHECK_HEADERS(gsl/gsl_eigen.h)
52 +- if test "$ac_cv_header_gsl_gsl_blas_h" != "yes" -o "$ac_cv_header_gsl_gsl_eigen_h" != "yes"; then
53 +- CONFIG_GSL="no"
54 +- fi
55 +-fi
56 +-if test "$CONFIG_GSL" = "yes"; then
57 +- save_LIBS="$LIBS"
58 +- AC_CHECK_LIB(gslcblas, main, [], [CONFIG_GSL="no"])
59 +- AC_CHECK_LIB(gsl, gsl_sf_gamma, [], [CONFIG_GSL="no"])
60 +- LIBS="$save_LIBS"
61 +- fi
62 +-GSL_LIBS=""
63 +-if test "$CONFIG_GSL" = "yes"; then
64 +- GSL_LIBS="-lgsl -lgslcblas"
65 +- fi
66 +-AC_SUBST(CONFIG_GSL)
67 +-AC_SUBST(GSL_LIBS)
68 +-AM_CONDITIONAL(CONFIG_GSL, [test "$CONFIG_GSL" = "yes"])
69 +-
70 +-CONFIG_LAPACK="yes"
71 +-AC_ARG_ENABLE([lapack],
72 +- [AS_HELP_STRING([--enable-lapack], [Use LAPACK [[default=yes]]])],
73 +- [ if test "$enableval" = "no"; then CONFIG_LAPACK="no"; fi], [])
74 +-
75 +-if test "$CONFIG_LAPACK" = "yes"; then
76 +-# AC_CHECK_LIB(f2c, main, [], [CONFIG_LAPACK="no"])
77 +-# AC_CHECK_LIB(blas, main, [], [CONFIG_LAPACK="no"])
78 +-# AC_CHECK_LIB(tmglib, main, [], [CONFIG_LAPACK="no"])
79 +- AC_CHECK_LIB(gfortran, main)
80 +- AC_CHECK_LIB(blas, main)
81 +- AC_CHECK_LIB(lapack, main, [], [CONFIG_LAPACK="no"])
82 +-# AX_BLAS([have_blas=yes],[have_blas=no])
83 +-# AX_LAPACK([have_lapack=yes],[have_lapack=no])
84 +-fi
85 ++PKG_CHECK_MODULES([GSL], [gsl],[
86 ++ AC_DEFINE(HAVE_LIBGSL,1, [Define if gsl is installed])
87 ++ AC_SUBST(GSL_LIBS)])
88 ++
89 ++PKG_CHECK_MODULES([LAPACK], [lapack],[
90 ++ AC_DEFINE(HAVE_LIBLAPACK,1,[Define if LAPACK is installed])
91 ++ AC_SUBST(LAPACK_LIBS)])
92 ++
93 ++PKG_CHECK_MODULES([BLAS], [blas],[
94 ++ AC_DEFINE(HAVE_BLAS,1,[Define if BLAS is installed])
95 ++ AC_SUBST(BLAS_LIBS)])
96 +
97 + CONFIG_PARI="yes"
98 + AC_ARG_ENABLE([pari],
99 +diff --git a/src/Makefile.am b/src/Makefile.am
100 +index a142067..2ebcce0 100644
101 +--- a/src/Makefile.am
102 ++++ b/src/Makefile.am
103 +@@ -14,7 +14,7 @@ libgiac_la_SOURCES = input_lexer.ll sym2poly.cc gausspol.cc threaded.cc \
104 + help.cc lpsolve.cc optimization.cc signalprocessing.cc \
105 + graphe.cc graphtheory.cc nautywrapper.c markup.cc kdisplay.cc kadd.cc # Ugh..
106 +
107 +-libgiac_la_LIBADD = $(NTL_LIBS) $(COCOA_LIBS) $(PARI_LIBS) $(GSL_LIBS)
108 ++libgiac_la_LIBADD = $(NTL_LIBS) $(COCOA_LIBS) $(PARI_LIBS) $(GSL_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS)
109 +
110 + giacincludedir = $(includedir)/giac
111 + giacinclude_HEADERS = dispatch.h fraction.h gen.h desolve.h misc.h ti89.h \
112
113 diff --git a/sci-mathematics/giac/files/pari_2_11.patch b/sci-mathematics/giac/files/pari_2_11.patch
114 new file mode 100644
115 index 000000000..24142257a
116 --- /dev/null
117 +++ b/sci-mathematics/giac/files/pari_2_11.patch
118 @@ -0,0 +1,17 @@
119 +Change test output for PARI 2.11
120 +
121 +See https://trac.sagemath.org/ticket/25567
122 +and https://xcas.univ-grenoble-alpes.fr/forum/viewtopic.php?f=4&t=2102
123 +
124 +diff -ru a/check/TP11-sol.cas.out1 b/check/TP11-sol.cas.out1
125 +--- a/check/TP11-sol.cas.out1 2014-10-21 10:51:48.000000000 +0200
126 ++++ b/check/TP11-sol.cas.out1 2018-08-07 17:04:12.528052773 +0200
127 +@@ -10,7 +10,7 @@
128 + 1073741824000000000000000000061203284109000000000000000000000000008409,
129 + 2^3*3*389*733*156904374622257604823879982847602392900751802349981470895277241,
130 + "Done",
131 +-matrix[[2,7,1],[3,2,1],[389,2,1],[733,2,1],[156904374622257604823879982847602392900751802349981470895277241,2,matrix[[2,13,1],[3,3,1],[5,2,1],[7,2,1],[56467,2,1],[6553084925887974620811527,2,matrix[[2,5,1],[19,2,1],[71,2,1],[126823,2,1]]]]]],
132 ++1,
133 + 0,
134 + [],
135 + 1,
136
137 diff --git a/sci-mathematics/giac/giac-1.6.0.47.ebuild b/sci-mathematics/giac/giac-1.6.0.47.ebuild
138 new file mode 100644
139 index 000000000..aeb36f76f
140 --- /dev/null
141 +++ b/sci-mathematics/giac/giac-1.6.0.47.ebuild
142 @@ -0,0 +1,121 @@
143 +# Copyright 1999-2021 Gentoo Authors
144 +# Distributed under the terms of the GNU General Public License v2
145 +
146 +EAPI=7
147 +
148 +inherit autotools flag-o-matic xdg
149 +
150 +MY_PV="$(ver_rs 3-4 -)"
151 +
152 +DESCRIPTION="A free C++ CAS (Computer Algebra System) library and its interfaces"
153 +HOMEPAGE="https://www-fourier.ujf-grenoble.fr/~parisse/giac.html"
154 +SRC_URI="https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/${PN}_${MY_PV}.tar.gz -> ${P}.tar.gz"
155 +
156 +LICENSE="GPL-2"
157 +SLOT="0"
158 +KEYWORDS="~amd64 ~x86"
159 +
160 +# French documentation is not GPL, and is subject to a non commercial use license, so skipping it.
161 +LANGS="el en es pt"
162 +IUSE="ao doc +ecm examples gc +glpk gui static-libs test"
163 +for X in ${LANGS} ; do
164 + IUSE="${IUSE} l10n_${X}"
165 +done
166 +
167 +RDEPEND="
168 + dev-libs/gmp:=[cxx]
169 + sys-libs/readline:=
170 + gui? (
171 + >=x11-libs/fltk-1.1.9
172 + media-libs/libpng:=
173 + )
174 + ao? ( media-libs/libao )
175 + dev-libs/mpfr:=
176 + sci-libs/mpfi
177 + sci-libs/gsl:=
178 + >=sci-mathematics/pari-2.7:=[threads]
179 + dev-libs/ntl:=
180 + virtual/lapack
181 + virtual/blas
182 + net-misc/curl
183 + >=sci-mathematics/nauty-2.6.7
184 + ecm? ( >=sci-mathematics/gmp-ecm-7.0.0 )
185 + glpk? ( sci-mathematics/glpk )
186 + gc? ( dev-libs/boehm-gc )"
187 +
188 +DEPEND="${RDEPEND}"
189 +
190 +BDEPEND="
191 + dev-tex/hevea
192 + virtual/pkgconfig
193 + virtual/yacc
194 +"
195 +
196 +PATCHES=(
197 + "${FILESDIR}"/${PN}-1.6.0.17-gsl_lapack.patch
198 + "${FILESDIR}"/pari_2_11.patch
199 + )
200 +
201 +REQUIRED_USE="test? ( gui )"
202 +RESTRICT="!test? ( test )"
203 +
204 +S="${WORKDIR}/${PN}-$(ver_cut 1-3)"
205 +
206 +src_prepare(){
207 + default
208 +
209 + eautoreconf
210 +}
211 +
212 +src_configure(){
213 + if use gui; then
214 + append-cppflags -I$(fltk-config --includedir)
215 + append-lfs-flags
216 + append-libs $(fltk-config --ldflags | sed -e 's/\(-L\S*\)\s.*/\1/') || die
217 + fi
218 +
219 + # Using libsamplerate is currently broken
220 + econf \
221 + --enable-gmpxx \
222 + --disable-samplerate \
223 + $(use_enable static-libs static) \
224 + $(use_enable gui) \
225 + $(use_enable gui png) \
226 + $(use_enable ao) \
227 + $(use_enable ecm) \
228 + $(use_enable glpk) \
229 + $(use_enable gc)
230 +}
231 +
232 +src_install() {
233 + emake install DESTDIR="${D}"
234 + dodoc AUTHORS ChangeLog INSTALL NEWS README TROUBLES
235 + if !(use gui); then
236 + rm -rf \
237 + "${ED}"/usr/bin/x* \
238 + "${ED}"/usr/share/application-registry \
239 + "${ED}"/usr/share/applications \
240 + "${ED}"/usr/share/icons
241 + fi
242 +
243 + if use !doc; then
244 + rm -R "${ED}"/usr/share/doc/giac* "${ED}"/usr/share/giac/doc/ || die
245 + else
246 + for lang in ${LANGS}; do
247 + if use l10n_$lang; then
248 + ln "${ED}"/usr/share/giac/doc/aide_cas "${ED}"/usr/share/giac/doc/"${lang}"/aide_cas || die
249 + else
250 + rm -rf "${ED}"/usr/share/giac/doc/"${lang}"
251 + fi
252 + done
253 + # Deleting French documentation for copyright reasons
254 + rm -rf "${ED}"/usr/share/giac/doc/fr
255 + fi
256 +
257 + if use !examples; then
258 + rm -R "${ED}"/usr/share/giac/examples || die
259 + fi
260 +
261 + # remove .la file
262 + find "${ED}" -name '*.la' -delete || die
263 +}
264
265 diff --git a/sci-mathematics/giac/giac-1.6.0.ebuild b/sci-mathematics/giac/giac-1.6.0.ebuild
266 deleted file mode 100644
267 index c8d28b51a..000000000
268 --- a/sci-mathematics/giac/giac-1.6.0.ebuild
269 +++ /dev/null
270 @@ -1,75 +0,0 @@
271 -# Copyright 1999-2021 Gentoo Authors
272 -# Distributed under the terms of the GNU General Public License v2
273 -
274 -EAPI=7
275 -
276 -DESCRIPTION="A free C++ CAS (Computer Algebra System) library and its interfaces"
277 -HOMEPAGE="https://www-fourier.ujf-grenoble.fr/~parisse/giac.html"
278 -SRC_URI="https://www-fourier.ujf-grenoble.fr/~parisse/giac/${P}.tar.gz"
279 -
280 -LICENSE="GPL-2"
281 -SLOT="0"
282 -KEYWORDS="~amd64 ~x86"
283 -
284 -IUSE="doc examples fltk"
285 -
286 -inherit flag-o-matic pax-utils xdg
287 -
288 -RDEPEND="
289 - >=dev-libs/gmp-3
290 - >=sys-libs/readline-4.2
291 - fltk? ( >=x11-libs/fltk-1.1.9 )
292 - dev-libs/mpfr
293 - sci-libs/gsl
294 - >=sci-mathematics/pari-2.3
295 - >=dev-libs/ntl-5.2
296 -"
297 -BDEPEND="dev-tex/hevea"
298 -
299 -src_prepare(){
300 - sed -e "s:\$(prefix)/share:\$(DESTDIR)\$(prefix)/share:g" \
301 - -e "s:config.h \$(includedir)/giac:config.h \$(DESTDIR)\$(includedir)/giac:g" \
302 - -e "s:\$(DESTDIR)\$(DESTDIR):\$(DESTDIR):g" \
303 - -e "s:\$(DESTDIR)/\$(DESTDIR):\$(DESTDIR):g" \
304 - -i `find -name Makefile\*` || die
305 - if use !fltk; then
306 - sed -e "s: gl2ps\.[chlo]*::g" -i src/Makefile.* || die
307 - fi
308 - default
309 -}
310 -
311 -src_configure(){
312 - if use fltk
313 - then
314 - append-cppflags -I$(fltk-config --includedir)
315 - append-lfs-flags
316 - append-libs $(fltk-config --ldflags | sed -e 's/\(-L\S*\)\s.*/\1/') || die
317 - fi
318 - econf $(use_enable fltk gui)
319 -}
320 -
321 -src_install() {
322 - emake install DESTDIR="${D}"
323 - dobin src/aide
324 - rm "${D}"/usr/bin/*cas_help || die
325 - dodoc AUTHORS ChangeLog INSTALL NEWS README TROUBLES
326 - if use !fltk; then
327 - rm "${D}"/usr/bin/x* || die
328 - elif host-is-pax; then
329 - pax-mark -m "${D}"/usr/bin/x*
330 - fi
331 - if use !doc; then
332 - rm -R "${D}"/usr/share/doc "${D}"/usr/share/giac/doc/ || die
333 - else
334 - for LANG in el en es fr pt; do
335 - if echo ${LINGUAS} | grep -v "$LANG" &> /dev/null; then
336 - rm -R "${D}"/usr/share/giac/doc/"$LANG"
337 - else
338 - ln "${D}"/usr/share/giac/doc/aide_cas "${D}"/usr/share/giac/doc/"$LANG"/aide_cas || die
339 - fi
340 - done
341 - fi
342 - if use !examples; then
343 - rm -R "${D}"/usr/share/giac/examples || die
344 - fi
345 -}
346
347 diff --git a/sci-mathematics/giac/metadata.xml b/sci-mathematics/giac/metadata.xml
348 index 60502e1d7..7b8a11df2 100644
349 --- a/sci-mathematics/giac/metadata.xml
350 +++ b/sci-mathematics/giac/metadata.xml
351 @@ -6,10 +6,15 @@
352 <name>Gentoo Mathematics Project</name>
353 </maintainer>
354 <longdescription>
355 -Giac is a free computer algebra system that can be used to perform
356 -computer algebra, function graphs, interactive geometry (2-d and 3-d),
357 -spreadsheet and statistics, programmation. It may be used as a replacement
358 -for high end graphic calculators for example on netbooks (for about
359 -the same price as a calculator but with much more performances).
360 -</longdescription>
361 + Giac is a free computer algebra system that can be used to perform
362 + computer algebra, function graphs, interactive geometry (2-d and 3-d),
363 + spreadsheet and statistics, programmation. It may be used as a replacement
364 + for high end graphic calculators for example on netbooks (for about
365 + the same price as a calculator but with much more performances).
366 + </longdescription>
367 + <use>
368 + <flag name="glpk">Enable the use of <pkg>sci-mathematics/glpk</pkg></flag>
369 + <flag name="ecm">Enable the use of <pkg>sci-mathematics/gmp-ecm</pkg></flag>
370 + <flag name="gc">Enable garbage collection support via <pkg>dev-libs/boehm-gc</pkg></flag>
371 + </use>
372 </pkgmetadata>