Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/giac/files/, sci-mathematics/giac/
Date: Thu, 01 Apr 2021 21:49:01
Message-Id: 1617313717.320334104e3e56e4fff1f1f821e74f7a122dfd57.mjo@gentoo
1 commit: 320334104e3e56e4fff1f1f821e74f7a122dfd57
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 31 12:42:19 2021 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 1 21:48:37 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32033410
7
8 sci-mathematics/giac: new package for the Giac/Xcas math systems.
9
10 We have bugzilla requests for this package going back to 2005! The
11 SageMath suite has recently gained the ability to use Giac from the
12 system, so now is an especially good time to add it to the tree.
13 François Bissey has been maintaining this package for years in the
14 sage-on-gentoo overlay and contributing fixes upstream, so the ebuild
15 required only minor changes at this point. I personally thank him and
16 you should too.
17
18 Closes: https://bugs.gentoo.org/94539
19 Closes: https://bugs.gentoo.org/94542
20 Closes: https://bugs.gentoo.org/760684
21 Package-Manager: Portage-3.0.13, Repoman-3.0.2
22 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
23
24 sci-mathematics/giac/Manifest | 1 +
25 .../giac/files/giac-1.6.0-pari-2.11.patch | 17 +++
26 .../giac/files/giac-1.7.0.1-gsl_lapack.patch | 84 +++++++++++
27 sci-mathematics/giac/giac-1.7.0.1.ebuild | 163 +++++++++++++++++++++
28 sci-mathematics/giac/metadata.xml | 39 +++++
29 5 files changed, 304 insertions(+)
30
31 diff --git a/sci-mathematics/giac/Manifest b/sci-mathematics/giac/Manifest
32 new file mode 100644
33 index 00000000000..a0c47413436
34 --- /dev/null
35 +++ b/sci-mathematics/giac/Manifest
36 @@ -0,0 +1 @@
37 +DIST giac_1.7.0-1.tar.gz 82118267 BLAKE2B a9bb4cb260bfc7ba187907d054c737aa8f5de7baf132913dac2a054e886ec632d9077a52fb1e837a1db623223199592407734857725ee4b22c775f928893bb9d SHA512 05565ee22f4d81a4149935df9a32dc78ac07d06db1555a3d951169d184c746c61cd4d57407eabeb982fb8cb5b4a82726b5a553e6a9e689517a241eb0a8726929
38
39 diff --git a/sci-mathematics/giac/files/giac-1.6.0-pari-2.11.patch b/sci-mathematics/giac/files/giac-1.6.0-pari-2.11.patch
40 new file mode 100644
41 index 00000000000..24142257a34
42 --- /dev/null
43 +++ b/sci-mathematics/giac/files/giac-1.6.0-pari-2.11.patch
44 @@ -0,0 +1,17 @@
45 +Change test output for PARI 2.11
46 +
47 +See https://trac.sagemath.org/ticket/25567
48 +and https://xcas.univ-grenoble-alpes.fr/forum/viewtopic.php?f=4&t=2102
49 +
50 +diff -ru a/check/TP11-sol.cas.out1 b/check/TP11-sol.cas.out1
51 +--- a/check/TP11-sol.cas.out1 2014-10-21 10:51:48.000000000 +0200
52 ++++ b/check/TP11-sol.cas.out1 2018-08-07 17:04:12.528052773 +0200
53 +@@ -10,7 +10,7 @@
54 + 1073741824000000000000000000061203284109000000000000000000000000008409,
55 + 2^3*3*389*733*156904374622257604823879982847602392900751802349981470895277241,
56 + "Done",
57 +-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]]]]]],
58 ++1,
59 + 0,
60 + [],
61 + 1,
62
63 diff --git a/sci-mathematics/giac/files/giac-1.7.0.1-gsl_lapack.patch b/sci-mathematics/giac/files/giac-1.7.0.1-gsl_lapack.patch
64 new file mode 100644
65 index 00000000000..073762ec6a4
66 --- /dev/null
67 +++ b/sci-mathematics/giac/files/giac-1.7.0.1-gsl_lapack.patch
68 @@ -0,0 +1,84 @@
69 +diff --git a/configure.ac b/configure.ac
70 +index 44fd519..0a6bad7 100644
71 +--- a/configure.ac
72 ++++ b/configure.ac
73 +@@ -38,6 +38,7 @@ AC_LANG([C++])
74 + AC_PROG_LIBTOOL
75 + AC_PROG_YACC
76 + AM_PROG_LEX
77 ++PKG_PROG_PKG_CONFIG
78 + AC_C_BIGENDIAN
79 +
80 + dnl Check for standard C+headers
81 +@@ -225,47 +226,17 @@ AC_CHECK_SIZEOF(long)
82 + AC_CHECK_SIZEOF(long long)
83 +
84 + dnl Checking for Gnu Sci Lib
85 +-CONFIG_GSL="yes"
86 +-AC_ARG_ENABLE([gsl],[
87 +- AS_HELP_STRING([--enable-gsl], [Use GNU scientific library [[default=yes]]])],
88 +- [ if test "x$enableval" = "xno"; then CONFIG_GSL="no"; fi], [])
89 +-
90 +-if test "$CONFIG_GSL" = "yes"; then
91 +- AC_CHECK_HEADERS(gsl/gsl_blas.h)
92 +- AC_CHECK_HEADERS(gsl/gsl_eigen.h)
93 +- if test "$ac_cv_header_gsl_gsl_blas_h" != "yes" -o "$ac_cv_header_gsl_gsl_eigen_h" != "yes"; then
94 +- CONFIG_GSL="no"
95 +- fi
96 +-fi
97 +-if test "$CONFIG_GSL" = "yes"; then
98 +- save_LIBS="$LIBS"
99 +- AC_CHECK_LIB(gslcblas, main, [], [CONFIG_GSL="no"])
100 +- AC_CHECK_LIB(gsl, gsl_sf_gamma, [], [CONFIG_GSL="no"])
101 +- LIBS="$save_LIBS"
102 +- fi
103 +-GSL_LIBS=""
104 +-if test "$CONFIG_GSL" = "yes"; then
105 +- GSL_LIBS="-lgsl -lgslcblas"
106 +- fi
107 +-AC_SUBST(CONFIG_GSL)
108 +-AC_SUBST(GSL_LIBS)
109 +-AM_CONDITIONAL(CONFIG_GSL, [test "$CONFIG_GSL" = "yes"])
110 +-
111 +-CONFIG_LAPACK="yes"
112 +-AC_ARG_ENABLE([lapack],
113 +- [AS_HELP_STRING([--enable-lapack], [Use LAPACK [[default=yes]]])],
114 +- [ if test "$enableval" = "no"; then CONFIG_LAPACK="no"; fi], [])
115 +-
116 +-if test "$CONFIG_LAPACK" = "yes"; then
117 +-# AC_CHECK_LIB(f2c, main, [], [CONFIG_LAPACK="no"])
118 +-# AC_CHECK_LIB(blas, main, [], [CONFIG_LAPACK="no"])
119 +-# AC_CHECK_LIB(tmglib, main, [], [CONFIG_LAPACK="no"])
120 +- AC_CHECK_LIB(gfortran, main)
121 +- AC_CHECK_LIB(blas, main)
122 +- AC_CHECK_LIB(lapack, main, [], [CONFIG_LAPACK="no"])
123 +-# AX_BLAS([have_blas=yes],[have_blas=no])
124 +-# AX_LAPACK([have_lapack=yes],[have_lapack=no])
125 +-fi
126 ++PKG_CHECK_MODULES([GSL], [gsl],[
127 ++ AC_DEFINE(HAVE_LIBGSL,1, [Define if gsl is installed])
128 ++ AC_SUBST(GSL_LIBS)])
129 ++
130 ++PKG_CHECK_MODULES([LAPACK], [lapack],[
131 ++ AC_DEFINE(HAVE_LIBLAPACK,1,[Define if LAPACK is installed])
132 ++ AC_SUBST(LAPACK_LIBS)])
133 ++
134 ++PKG_CHECK_MODULES([BLAS], [blas],[
135 ++ AC_DEFINE(HAVE_BLAS,1,[Define if BLAS is installed])
136 ++ AC_SUBST(BLAS_LIBS)])
137 +
138 + dnl if test "$CONFIG_PARI" = "yes"; then
139 + dnl AC_MSG_CHECKING([whether PARI is configured with pthreads])
140 +diff --git a/src/Makefile.am b/src/Makefile.am
141 +index bb77986..d385fd0 100644
142 +--- a/src/Makefile.am
143 ++++ b/src/Makefile.am
144 +@@ -16,7 +16,7 @@ libgiac_la_SOURCES = input_lexer.ll sym2poly.cc gausspol.cc threaded.cc \
145 + caseval.c cutils.c graphic.c libbf.c libregexp.c libunicode.c \
146 + qjsgiac.c quickjs.c quickjs-libc.c js.c
147 +
148 +-libgiac_la_LIBADD = $(NTL_LIBS) $(COCOA_LIBS) $(PARI_LIBS) $(GSL_LIBS)
149 ++libgiac_la_LIBADD = $(NTL_LIBS) $(COCOA_LIBS) $(PARI_LIBS) $(GSL_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS)
150 +
151 + giacincludedir = $(includedir)/giac
152 + giacinclude_HEADERS = dispatch.h fraction.h gen.h desolve.h misc.h ti89.h \
153
154 diff --git a/sci-mathematics/giac/giac-1.7.0.1.ebuild b/sci-mathematics/giac/giac-1.7.0.1.ebuild
155 new file mode 100644
156 index 00000000000..78894fa8a1e
157 --- /dev/null
158 +++ b/sci-mathematics/giac/giac-1.7.0.1.ebuild
159 @@ -0,0 +1,163 @@
160 +# Copyright 1999-2021 Gentoo Authors
161 +# Distributed under the terms of the GNU General Public License v2
162 +
163 +EAPI=7
164 +
165 +inherit autotools flag-o-matic xdg-utils
166 +
167 +FETCH_P="${PN}_"$(ver_rs 3 '-')
168 +MY_PV=$(ver_cut 1-3)
169 +DESCRIPTION="A free C++ Computer Algebra System library and its interfaces"
170 +HOMEPAGE="https://www-fourier.ujf-grenoble.fr/~parisse/giac.html"
171 +SRC_URI="https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/${FETCH_P}.tar.gz"
172 +LICENSE="GPL-2"
173 +
174 +SLOT="0"
175 +KEYWORDS="~amd64 ~x86"
176 +LANGS="el en es pt"
177 +IUSE="ao doc +ecm examples gc +glpk gui static-libs test"
178 +for X in ${LANGS} ; do
179 + IUSE="${IUSE} l10n_${X}"
180 +done
181 +
182 +# nauty and cliquer are automagical dependencies
183 +RDEPEND="dev-libs/gmp:=[cxx]
184 + sys-libs/readline:=
185 + gui? ( x11-libs/fltk
186 + media-libs/libpng:= )
187 + ao? ( media-libs/libao )
188 + dev-libs/mpfr:=
189 + sci-libs/mpfi
190 + sci-libs/gsl:=
191 + sci-mathematics/pari:=[threads]
192 + dev-libs/ntl:=
193 + virtual/lapack
194 + virtual/blas
195 + net-misc/curl
196 + sci-mathematics/cliquer
197 + sci-mathematics/nauty
198 + ecm? ( sci-mathematics/gmp-ecm )
199 + glpk? ( sci-mathematics/glpk )
200 + gc? ( dev-libs/boehm-gc )"
201 +
202 +DEPEND="${RDEPEND}"
203 +
204 +BDEPEND="dev-tex/hevea
205 + virtual/pkgconfig
206 + virtual/yacc"
207 +
208 +PATCHES=(
209 + "${FILESDIR}/${PN}-1.7.0.1-gsl_lapack.patch"
210 + "${FILESDIR}/${PN}-1.6.0-pari-2.11.patch"
211 +)
212 +
213 +REQUIRED_USE="test? ( gui )"
214 +
215 +# The mirror restriction is due to the French documentation for which
216 +# "Other kind of redistributions require the consent of the copyright
217 +# holder."
218 +RESTRICT="!test? ( test ) mirror"
219 +
220 +S="${WORKDIR}/${PN}-${MY_PV}"
221 +
222 +src_prepare(){
223 + default
224 + eautoreconf
225 +}
226 +
227 +src_configure(){
228 + if use gui; then
229 + append-cppflags -I$(fltk-config --includedir)
230 + append-lfs-flags
231 +
232 + # Get the big-L flags from fltk's LDFLAGS.
233 + append-ldflags $(fltk-config --ldflags | sed -e 's/\(-L\S*\)\s.*/\1/')
234 + fi
235 +
236 + # Using libsamplerate is currently broken
237 + #
238 + # The giac build system supports --docdir, but the path /usr/share/giac/doc
239 + # is hard-coded throughout the source code, so passing anything else to
240 + # ./configure --docdir just causes problems. Later, we'll put things right.
241 + #
242 + # micropython is for specific use in an upstream project
243 + econf \
244 + --enable-gmpxx \
245 + --disable-samplerate \
246 + --disable-micropy \
247 + --docdir=/usr/share/giac/doc \
248 + $(use_enable static-libs static) \
249 + $(use_enable gui) \
250 + $(use_enable gui png) \
251 + $(use_enable ao) \
252 + $(use_enable ecm) \
253 + $(use_enable glpk) \
254 + $(use_enable gc)
255 +
256 +}
257 +
258 +src_install() {
259 + docompress -x "/usr/share/doc/${PF}/"{aide_cas,doc,examples}
260 + emake install DESTDIR="${D}"
261 +
262 + # Move all of /usr/share/giac (which contains only documentation) to
263 + # its /usr/share/doc/${PF} counterpart.
264 + dodir /usr/share/doc
265 + mv "${ED}"/usr/share/giac "${ED}/usr/share/doc/${PF}" || die
266 +
267 + # and create a symlink from the original location to the new one
268 + dosym "./doc/${PF}" /usr/share/giac
269 +
270 + # This is duplicated in ${ED}/usr/share/doc/${PF}/examples
271 + rm -r "${ED}/usr/share/doc/${PF}/doc/Exemples" || die
272 +
273 + # These aren't supposed to be installed at all.
274 + find "${ED}/usr/share/doc/${PF}" -type f -name 'Makefile*' -delete || die
275 +
276 + # The French docs are not freely licensed according to the README.
277 + rm -r "${ED}/usr/share/doc/${PF}/doc/fr" || die
278 +
279 + dodoc AUTHORS ChangeLog INSTALL NEWS README TROUBLES
280 + if ! use gui; then
281 + rm -rf \
282 + "${ED}"/usr/bin/x* \
283 + "${ED}"/usr/share/application-registry \
284 + "${ED}"/usr/share/applications \
285 + "${ED}"/usr/share/icons \
286 + || die "failed to clean up fltk files"
287 + fi
288 +
289 + if ! use doc; then
290 + rm -r "${ED}/usr/share/doc/${PF}/doc" || die "failed to remove doc directory"
291 + else
292 + for lang in ${LANGS}; do
293 + if use l10n_$lang; then
294 + dosym ../aide_cas "/usr/share/doc/${PF}/doc/${lang}/aide_cas"
295 + else
296 + rm -r "${ED}/usr/share/giac/doc/${lang}" \
297 + || die "failed to remove ${lang} documentation"
298 + fi
299 + done
300 + fi
301 +
302 + if ! use examples; then
303 + rm -r "${ED}/usr/share/doc/${PF}/examples" \
304 + || die "failed to remove examples"
305 + fi
306 +
307 + find "${ED}" -type f -name '*.la' -delete || die
308 +}
309 +
310 +pkg_postinst(){
311 + if use gui; then
312 + xdg_desktop_database_update
313 + xdg_icon_cache_update
314 + fi
315 +}
316 +
317 +pkg_postrm(){
318 + if use gui; then
319 + xdg_desktop_database_update
320 + xdg_icon_cache_update
321 + fi
322 +}
323
324 diff --git a/sci-mathematics/giac/metadata.xml b/sci-mathematics/giac/metadata.xml
325 new file mode 100644
326 index 00000000000..3fadb3c53b0
327 --- /dev/null
328 +++ b/sci-mathematics/giac/metadata.xml
329 @@ -0,0 +1,39 @@
330 +<?xml version="1.0" encoding="UTF-8"?>
331 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
332 +<pkgmetadata>
333 +
334 + <maintainer type="person">
335 + <email>mjo@g.o</email>
336 + </maintainer>
337 +
338 + <maintainer type="person" proxied="yes">
339 + <email>frp.bissey@×××××.com</email>
340 + <name>Francois Bissey</name>
341 + </maintainer>
342 +
343 + <maintainer type="project" proxied="proxy">
344 + <email>proxy-maint@g.o</email>
345 + <name>Proxy Maintainers</name>
346 + </maintainer>
347 +
348 + <maintainer type="project">
349 + <email>sci-mathematics@g.o</email>
350 + <name>Gentoo Mathematics Project</name>
351 + </maintainer>
352 +
353 + <longdescription>
354 + Giac is a free computer algebra system that can be used to perform
355 + computer algebra, function graphs, interactive geometry (2-d and
356 + 3-d), spreadsheet and statistics, programmation. It may be used as
357 + a replacement for high end graphic calculators for example on
358 + netbooks (for about the same price as a calculator but with much
359 + more performances).
360 + </longdescription>
361 +
362 + <use>
363 + <flag name="glpk">Enable the use of <pkg>sci-mathematics/glpk</pkg></flag>
364 + <flag name="ecm">Enable the use of <pkg>sci-mathematics/gmp-ecm</pkg></flag>
365 + <flag name="gc">Enable garbage collection support via <pkg>dev-libs/boehm-gc</pkg></flag>
366 + </use>
367 +
368 +</pkgmetadata>