commit:     99d068bcd512389b60a972d53c95f22571ed3537
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 24 21:35:49 2021 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Thu Mar 25 14:35:26 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99d068bc

sci-mathematics/maxima: re-enable ECL package.

The ECL package needed for USE=ecls got dropped from the ebuild
because the patch it requires no longer applied. We take François
Bissey's patch from the sage-on-gentoo overlay and re-enable it.

Closes: https://bugs.gentoo.org/732776
Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 sci-mathematics/maxima/files/ecls-4.patch            | 16 ++++++++++++++++
 ...{maxima-5.44.0.ebuild => maxima-5.44.0-r1.ebuild} | 20 +++++++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/sci-mathematics/maxima/files/ecls-4.patch 
b/sci-mathematics/maxima/files/ecls-4.patch
new file mode 100644
index 00000000000..7c597c22333
--- /dev/null
+++ b/sci-mathematics/maxima/files/ecls-4.patch
@@ -0,0 +1,16 @@
+diff --git a/src/maxima.system b/src/maxima.system
+index ee7ca0f..85ec36f 100644
+--- a/src/maxima.system
++++ b/src/maxima.system
+@@ -75,6 +75,11 @@
+                            ;; Convert dir/foo.fas to dir/foo.o
+                            (make-pathname :type "o" :defaults p))
+                        files)))
++        (c::build-fasl "binary-ecl/maxima" :lisp-files obj
++                       :ld-flags
++                       (let ((x (symbol-value (find-symbol 
"*AUTOCONF-LD-FLAGS*"
++                                                           (find-package 
"MAXIMA")))))
++                         (if (and x (not (string= x ""))) (list x))))
+       (c::build-program "binary-ecl/maxima" :lisp-files obj
+                         :ld-flags
+                         (let ((x (symbol-value (find-symbol 
"*AUTOCONF-LD-FLAGS*"

diff --git a/sci-mathematics/maxima/maxima-5.44.0.ebuild 
b/sci-mathematics/maxima/maxima-5.44.0-r1.ebuild
similarity index 88%
rename from sci-mathematics/maxima/maxima-5.44.0.ebuild
rename to sci-mathematics/maxima/maxima-5.44.0-r1.ebuild
index 6588716b494..4cb02071d12 100644
--- a/sci-mathematics/maxima/maxima-5.44.0.ebuild
+++ b/sci-mathematics/maxima/maxima-5.44.0-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
 
-inherit autotools elisp-common eutils xdg-utils
+inherit autotools elisp-common eutils flag-o-matic xdg-utils
 
 DESCRIPTION="Free computer algebra environment based on Macsyma"
 HOMEPAGE="http://maxima.sourceforge.net/";
@@ -20,7 +20,7 @@ SUPP_RL=(   .    .     y               .    .         y     )
 # . - just --enable-<lisp>, <flag> - --enable-<flag>
 CONF_FLAG=( .    .     .               ecl  ccl       .     )
 # patch file version; . - no patch
-PATCH_V=(   2    1     .               .    3         1     )
+PATCH_V=(   2    1     .               4    3         1     )
 
 IUSE="emacs tk nls unicode X test ${LISPS[*]}"
 RESTRICT="!test? ( test )"
@@ -142,7 +142,14 @@ src_configure() {
                done
        fi
 
+       # Using raw-ldflags fixes the error,
+       #
+       #   x86_64-pc-linux-gnu/bin/ld: fatal error: -O1 -Wl: invalid option
+       #   value (expected an integer): 1 -Wl
+       #
+       # when building the maxima.fas library for ECL.
        econf ${CONFS} \
+               LDFLAGS="$(raw-ldflags)" \
                $(use_with tk wish) \
                $(use_enable emacs) \
                --with-lispdir="${EPREFIX}/${SITELISP}/${PN}"
@@ -188,6 +195,13 @@ src_install() {
                doins interfaces/emacs/imaxima/README
                doins -r interfaces/emacs/imaxima/imath-example
        fi
+
+       if use ecls; then
+               # Use ECL to find the path where it expects to load packages 
from.
+               ECLLIB=$(ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval 
"(quit)")
+               insinto "${ECLLIB#${EPREFIX}}"
+               doins src/binary-ecl/maxima.fas
+       fi
 }
 
 pkg_postinst() {

Reply via email to