all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu packages maxima: Update to 5.34.1 and fix dependencies
@ 2014-09-23 16:18 Federico Beffa
  2014-09-24  7:45 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Federico Beffa @ 2014-09-23 16:18 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

I would like to propose the attached patch for maxima.
This updates it to version 5.34.1 which fixes an upstream bug in
plot2d and friends. Also it fixes dependencies to gnuplot and tk.

In preparing the patch I've observed the following:

The build procedure (make) generates some temporary files. When I
build the package with guix, guix extracts the program tar.gz archive
in the temporary directory

/tmp/nix-build-maxima-5.34.1.drv-0

However, maxima attempts to create temporary files in

/tmp/nix-build-maxima-5.34.1

and fails. To correct for this I've explicitly passed "TMPDIR=/tmp" to
make. Is this the expected behavior?

Regards,
Fede

[-- Attachment #2: 0001-gnu-packages-maxima-Update-to-5.34.1-and-fix-depende.patch --]
[-- Type: text/x-patch, Size: 2794 bytes --]

From 998303ea042361727837baf38193462148c07565 Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Tue, 23 Sep 2014 16:20:02 +0200
Subject: [PATCH] gnu packages maxima: Update to 5.34.1 and fix dependencies

* gnu/packages/maths.scm(maxima): Update to 5.34.1 which fixes a bug in the
  plotting capabilities (plot2d, ...) present in the previous version
  (5.33.0).  Add the 'gnuplot' depencency which is required to generate plots.
  Add 'tcl' and 'tk' as dependencies: they are required by the 'xmaxima'
  command.
---
 gnu/packages/maths.scm | 33 ++++++++++++++++++++++++---------
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index af9feff..0321929 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -58,6 +58,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages tcsh)
+  #:use-module (gnu packages tcl)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages texlive)
   #:use-module (gnu packages xml))
@@ -836,7 +837,7 @@ to BMP, JPEG or PNG image formats.")
 (define-public maxima
   (package
     (name "maxima")
-    (version "5.33.0")
+    (version "5.34.1")
     (source
      (origin
        (method url-fetch)
@@ -844,19 +845,33 @@ to BMP, JPEG or PNG image formats.")
                            version "-source/" name "-" version ".tar.gz"))
        (sha256
         (base32
-         "13axm11xw0f3frx5b0qdidi7igkn1524fzz77s9rbpl2yy2nrbz2"))))
+         "1dw9vfzldpj7lv303xbw0wpyn6ra6i2yzwlrjbcx7j0jm5n43ji0"))))
     (build-system gnu-build-system)
-    (arguments
-     `(#:phases (alist-cons-before
-                 'check 'pre-check
-                 (lambda _ 
-                   (chmod "src/maxima" #o555))
-                 %standard-phases)))
     (inputs 
-     `(("gcl" ,gcl)))
+     `(("gcl" ,gcl)
+       ("gnuplot" ,gnuplot)
+       ("tcl" ,tcl)
+       ("tk" ,tk)))
     (native-inputs 
      `(("texinfo" ,texinfo)
        ("perl" ,perl)))
+    (arguments
+     `(#:configure-flags 
+       (list "--enable-gcl"
+	     (string-append "--with-posix-shell="
+			    (assoc-ref %build-inputs "bash")
+			    "/bin/sh")
+	     (string-append "--with-wish="
+			    (assoc-ref %build-inputs "tk")
+			    "/bin/wish"
+			    (let ((v ,(package-version tk)))
+			      (string-take v (string-index-right v #\.)))))
+       #:make-flags (list "TMPDIR=/tmp")
+       #:phases (alist-cons-before
+		 'check 'pre-check
+		 (lambda _ 
+		   (chmod "src/maxima" #o555))
+		 %standard-phases)))
     (home-page "http://maxima.sourceforge.net")
     (synopsis "Numeric and symbolic expression manipulation")
     (description "Maxima is a system for the manipulation of symbolic and
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu packages maxima: Update to 5.34.1 and fix dependencies
  2014-09-23 16:18 [PATCH] gnu packages maxima: Update to 5.34.1 and fix dependencies Federico Beffa
@ 2014-09-24  7:45 ` Ludovic Courtès
  2014-09-25 17:01   ` Federico Beffa
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2014-09-24  7:45 UTC (permalink / raw)
  To: Federico Beffa; +Cc: guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> The build procedure (make) generates some temporary files. When I
> build the package with guix, guix extracts the program tar.gz archive
> in the temporary directory
>
> /tmp/nix-build-maxima-5.34.1.drv-0
>
> However, maxima attempts to create temporary files in
>
> /tmp/nix-build-maxima-5.34.1
>
> and fails. To correct for this I've explicitly passed "TMPDIR=/tmp" to
> make. Is this the expected behavior?

No, it looks like Maxima’s build system erroneously strips out part of
the directory name.  In that case, passing TMPDIR=/tmp seems right.

> From 998303ea042361727837baf38193462148c07565 Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> Date: Tue, 23 Sep 2014 16:20:02 +0200
> Subject: [PATCH] gnu packages maxima: Update to 5.34.1 and fix dependencies
>
> * gnu/packages/maths.scm(maxima): Update to 5.34.1 which fixes a bug in the
>   plotting capabilities (plot2d, ...) present in the previous version
>   (5.33.0).  Add the 'gnuplot' depencency which is required to generate plots.
>   Add 'tcl' and 'tk' as dependencies: they are required by the 'xmaxima'
>   command.

Pushed with some tweaks: I’ve added a copyright line for you (let me
know if it’s wrong), replaced tabs with spaces (if you use Emacs, the
.dir-locals.el normally ensures that), and moved parts of the commit log
above to comments in the source (info "(standards) Change Log
Concepts").

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu packages maxima: Update to 5.34.1 and fix dependencies
  2014-09-24  7:45 ` Ludovic Courtès
@ 2014-09-25 17:01   ` Federico Beffa
  2014-09-25 19:12     ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Federico Beffa @ 2014-09-25 17:01 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 707 bytes --]

On Wed, Sep 24, 2014 at 9:45 AM, Ludovic Courtès <ludo@gnu.org> wrote:
> Pushed with some tweaks: I’ve added a copyright line for you (let me
> know if it’s wrong), replaced tabs with spaces (if you use Emacs, the
> .dir-locals.el normally ensures that), and moved parts of the commit log
> above to comments in the source (info "(standards) Change Log
> Concepts").
>
> Thank you!

Some more improvements:

I've found that the doc and emacs ".el" files were not installed in
the right place. Also
I've worked out how to set the full gnuplot path in the default
startup configuration file.
Now plotting works without the user having to install gnuplot in his profile.

Regards,
Fede

[-- Attachment #2: 0001-maxima-Fix-default-gnuplot-path-doc-and-emacs-locati.patch --]
[-- Type: text/x-patch, Size: 3732 bytes --]

From ab8a0e9f8f50370b4e9e7ca63d8bef1408a05da6 Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Thu, 25 Sep 2014 17:04:13 +0200
Subject: [PATCH] maxima: Fix default gnuplot path, doc and emacs location

* gnu/packages/maths.scm(maxima): Configure the default gnuplot path. Make doc and
  emacs files reachable from their expected standard location.
---
 gnu/packages/maths.scm | 36 +++++++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index c11d1ef..4f0db4c 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -850,8 +850,7 @@ to BMP, JPEG or PNG image formats.")
     (inputs
      `(("gcl" ,gcl)
        ("gnuplot" ,gnuplot)                       ;for plots
-       ("tcl" ,tcl)                               ;Tcl/Tk is used by 'xmaxima'
-       ("tk" ,tk)))
+       ("tk" ,tk)))                               ;Tcl/Tk is used by 'xmaxima'
     (native-inputs
      `(("texinfo" ,texinfo)
        ("perl" ,perl)))
@@ -866,18 +865,41 @@ to BMP, JPEG or PNG image formats.")
                             "/bin/wish"
                             (let ((v ,(package-version tk)))
                               (string-take v (string-index-right v #\.)))))
-
        ;; By default Maxima attempts to write temporary files to
        ;; '/tmp/nix-build-maxima-5.34.1', which doesn't exist.  Work around
        ;; that.
        #:make-flags (list "TMPDIR=/tmp")
-
        #:phases (alist-cons-before
                  'check 'pre-check
                  (lambda _
                    (chmod "src/maxima" #o555))
-                 %standard-phases)))
-
+                 ;; Make sure the doc and emacs files are found in the
+                 ;; standard location.  Also configure maxima to find gnuplot
+                 ;; without having it on the PATH.
+                 (alist-cons-after
+                  'install 'post-install
+                  (lambda* (#:key outputs inputs #:allow-other-keys)
+                    (let ((gnuplot (assoc-ref inputs "gnuplot"))
+                          (out (assoc-ref outputs "out")))
+                      (with-directory-excursion out
+                        (mkdir-p "share/emacs")
+                        (mkdir-p "share/doc")
+                        (symlink 
+                         (string-append out "/share/maxima/" ,version "/emacs/")
+                         (string-append out "/share/emacs/site-lisp"))
+                         (symlink 
+                          (string-append out "/share/maxima/" ,version "/doc/")
+                          (string-append out "/share/doc/maxima"))
+                         (with-atomic-file-replacement
+                             (string-append out "/share/maxima/"
+                                            ,version "/share/maxima-init.lisp")
+                           (lambda (in out)
+                             (begin
+                               (format out "~a ~s~a~%"
+                                       "(setf $gnuplot_command "
+                                       (string-append gnuplot "/bin/gnuplot") ")")
+                               (dump-port in out)))))))
+                  %standard-phases))))
     (home-page "http://maxima.sourceforge.net")
     (synopsis "Numeric and symbolic expression manipulation")
     (description "Maxima is a system for the manipulation of symbolic and
@@ -889,4 +911,4 @@ point numbers")
     ;; version (which implicitly means gpl1+).
     ;; At least one file (src/maxima.asd) says "version 2."
     ;; GPLv2 only is therefore the smallest subset.
-    (license license:gpl2))) 
+    (license license:gpl2)))
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu packages maxima: Update to 5.34.1 and fix dependencies
  2014-09-25 17:01   ` Federico Beffa
@ 2014-09-25 19:12     ` Ludovic Courtès
  2014-09-26 16:59       ` Federico Beffa
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2014-09-25 19:12 UTC (permalink / raw)
  To: Federico Beffa; +Cc: guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> I've found that the doc and emacs ".el" files were not installed in
> the right place. Also
> I've worked out how to set the full gnuplot path in the default
> startup configuration file.
> Now plotting works without the user having to install gnuplot in his profile.

Nice.

> From ab8a0e9f8f50370b4e9e7ca63d8bef1408a05da6 Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> Date: Thu, 25 Sep 2014 17:04:13 +0200
> Subject: [PATCH] maxima: Fix default gnuplot path, doc and emacs location
>
> * gnu/packages/maths.scm(maxima): Configure the default gnuplot path. Make doc and
>   emacs files reachable from their expected standard location.

Should be something like:

  * gnu/packages/maths.scm (maxima): Remove Tcl from 'inputs'.  Add
    'post-install' phase.

The idea is that it’s just a “conceptual undo list”, as the GCS calls it.

> +                 ;; Make sure the doc and emacs files are found in the
> +                 ;; standard location.  Also configure maxima to find gnuplot
> +                 ;; without having it on the PATH.
> +                 (alist-cons-after
> +                  'install 'post-install
> +                  (lambda* (#:key outputs inputs #:allow-other-keys)
> +                    (let ((gnuplot (assoc-ref inputs "gnuplot"))
> +                          (out (assoc-ref outputs "out")))

Since $out/share/maxima/$version is used a lot, please change the ‘let’
to:

  (let* ((gnuplot (assoc-ref inputs "gnuplot"))
         (out     (assoc-ref outputs "out"))
         (datadir (string-append out "/share/maxima/" ,version)))

and then use ‘datadir’.

> +                      (with-directory-excursion out
> +                        (mkdir-p "share/emacs")
> +                        (mkdir-p "share/doc")
> +                        (symlink 
> +                         (string-append out "/share/maxima/" ,version "/emacs/")
> +                         (string-append out "/share/emacs/site-lisp"))
> +                         (symlink 

The second ‘symlink’ call should be aligned with the first one.

> +                          (string-append out "/share/maxima/" ,version "/doc/")
> +                          (string-append out "/share/doc/maxima"))
> +                         (with-atomic-file-replacement
> +                             (string-append out "/share/maxima/"
> +                                            ,version "/share/maxima-init.lisp")
> +                           (lambda (in out)
> +                             (begin

‘begin’ is unnecessary here.

> -    (license license:gpl2))) 
> +    (license license:gpl2)))

Whitespace change?

Could you send an updated patch?

Thanks in advance,
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu packages maxima: Update to 5.34.1 and fix dependencies
  2014-09-25 19:12     ` Ludovic Courtès
@ 2014-09-26 16:59       ` Federico Beffa
  2014-09-27  9:24         ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Federico Beffa @ 2014-09-26 16:59 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 3091 bytes --]

On Thu, Sep 25, 2014 at 9:12 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Federico Beffa <beffa@ieee.org> skribis:
>
>> I've found that the doc and emacs ".el" files were not installed in
>> the right place. Also
>> I've worked out how to set the full gnuplot path in the default
>> startup configuration file.
>> Now plotting works without the user having to install gnuplot in his profile.
>
> Nice.
>
>> From ab8a0e9f8f50370b4e9e7ca63d8bef1408a05da6 Mon Sep 17 00:00:00 2001
>> From: Federico Beffa <beffa@fbengineering.ch>
>> Date: Thu, 25 Sep 2014 17:04:13 +0200
>> Subject: [PATCH] maxima: Fix default gnuplot path, doc and emacs location
>>
>> * gnu/packages/maths.scm(maxima): Configure the default gnuplot path. Make doc and
>>   emacs files reachable from their expected standard location.
>
> Should be something like:
>
>   * gnu/packages/maths.scm (maxima): Remove Tcl from 'inputs'.  Add
>     'post-install' phase.
>
> The idea is that it’s just a “conceptual undo list”, as the GCS calls it.
>
>> +                 ;; Make sure the doc and emacs files are found in the
>> +                 ;; standard location.  Also configure maxima to find gnuplot
>> +                 ;; without having it on the PATH.
>> +                 (alist-cons-after
>> +                  'install 'post-install
>> +                  (lambda* (#:key outputs inputs #:allow-other-keys)
>> +                    (let ((gnuplot (assoc-ref inputs "gnuplot"))
>> +                          (out (assoc-ref outputs "out")))
>
> Since $out/share/maxima/$version is used a lot, please change the ‘let’
> to:
>
>   (let* ((gnuplot (assoc-ref inputs "gnuplot"))
>          (out     (assoc-ref outputs "out"))
>          (datadir (string-append out "/share/maxima/" ,version)))
>
> and then use ‘datadir’.
>

OK, makes sense.

>> +                      (with-directory-excursion out
>> +                        (mkdir-p "share/emacs")
>> +                        (mkdir-p "share/doc")
>> +                        (symlink
>> +                         (string-append out "/share/maxima/" ,version "/emacs/")
>> +                         (string-append out "/share/emacs/site-lisp"))
>> +                         (symlink
>
> The second ‘symlink’ call should be aligned with the first one.
>
>> +                          (string-append out "/share/maxima/" ,version "/doc/")
>> +                          (string-append out "/share/doc/maxima"))
>> +                         (with-atomic-file-replacement
>> +                             (string-append out "/share/maxima/"
>> +                                            ,version "/share/maxima-init.lisp")
>> +                           (lambda (in out)
>> +                             (begin
>
> ‘begin’ is unnecessary here.
>
>> -    (license license:gpl2)))
>> +    (license license:gpl2)))
>
> Whitespace change?

yes.

>
> Could you send an updated patch?
>
> Thanks in advance,
> Ludo’.

Please find attached the updated patch.

Regards,
Fede

[-- Attachment #2: 0001-maxima-Remove-Tcl-from-inputs-.-Add-post-install-pha.patch --]
[-- Type: text/x-patch, Size: 3591 bytes --]

From 9bea9402675314a9ed5e74bc23919db423795663 Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Thu, 25 Sep 2014 17:04:13 +0200
Subject: [PATCH] maxima: Remove Tcl from 'inputs'.  Add 'post-install' phase

* gnu/packages/maths.scm(maxima): Remove Tcl from 'inputs'.  Add
  'post-install' phase.
---
 gnu/packages/maths.scm |   35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index c11d1ef..a46c9ef 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -850,8 +850,7 @@ to BMP, JPEG or PNG image formats.")
     (inputs
      `(("gcl" ,gcl)
        ("gnuplot" ,gnuplot)                       ;for plots
-       ("tcl" ,tcl)                               ;Tcl/Tk is used by 'xmaxima'
-       ("tk" ,tk)))
+       ("tk" ,tk)))                               ;Tcl/Tk is used by 'xmaxima'
     (native-inputs
      `(("texinfo" ,texinfo)
        ("perl" ,perl)))
@@ -866,18 +865,40 @@ to BMP, JPEG or PNG image formats.")
                             "/bin/wish"
                             (let ((v ,(package-version tk)))
                               (string-take v (string-index-right v #\.)))))
-
        ;; By default Maxima attempts to write temporary files to
        ;; '/tmp/nix-build-maxima-5.34.1', which doesn't exist.  Work around
        ;; that.
        #:make-flags (list "TMPDIR=/tmp")
-
        #:phases (alist-cons-before
                  'check 'pre-check
                  (lambda _
                    (chmod "src/maxima" #o555))
-                 %standard-phases)))
-
+                 ;; Make sure the doc and emacs files are found in the
+                 ;; standard location.  Also configure maxima to find gnuplot
+                 ;; without having it on the PATH.
+                 (alist-cons-after
+                  'install 'post-install
+                  (lambda* (#:key outputs inputs #:allow-other-keys)
+                    (let* ((gnuplot (assoc-ref inputs "gnuplot"))
+                          (out (assoc-ref outputs "out"))
+                          (datadir (string-append out "/share/maxima/" ,version)))
+                      (with-directory-excursion out
+                        (mkdir-p "share/emacs")
+                        (mkdir-p "share/doc")
+                        (symlink 
+                         (string-append datadir "/emacs/")
+                         (string-append out "/share/emacs/site-lisp"))
+                        (symlink 
+                         (string-append datadir "/doc/")
+                         (string-append out "/share/doc/maxima"))
+                        (with-atomic-file-replacement
+                         (string-append datadir "/share/maxima-init.lisp")
+                         (lambda (in out)
+                           (format out "~a ~s~a~%"
+                                   "(setf $gnuplot_command "
+                                   (string-append gnuplot "/bin/gnuplot") ")")
+                           (dump-port in out))))))
+                  %standard-phases))))
     (home-page "http://maxima.sourceforge.net")
     (synopsis "Numeric and symbolic expression manipulation")
     (description "Maxima is a system for the manipulation of symbolic and
@@ -889,4 +910,4 @@ point numbers")
     ;; version (which implicitly means gpl1+).
     ;; At least one file (src/maxima.asd) says "version 2."
     ;; GPLv2 only is therefore the smallest subset.
-    (license license:gpl2))) 
+    (license license:gpl2)))
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu packages maxima: Update to 5.34.1 and fix dependencies
  2014-09-26 16:59       ` Federico Beffa
@ 2014-09-27  9:24         ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2014-09-27  9:24 UTC (permalink / raw)
  To: Federico Beffa; +Cc: guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> From 9bea9402675314a9ed5e74bc23919db423795663 Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> Date: Thu, 25 Sep 2014 17:04:13 +0200
> Subject: [PATCH] maxima: Remove Tcl from 'inputs'.  Add 'post-install' phase
>
> * gnu/packages/maths.scm(maxima): Remove Tcl from 'inputs'.  Add
>   'post-install' phase.

Thanks, applied with minor tweaks to the log (the subject line should be
a high-level description, whereas the body is the actual change log.)

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-09-27  9:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-23 16:18 [PATCH] gnu packages maxima: Update to 5.34.1 and fix dependencies Federico Beffa
2014-09-24  7:45 ` Ludovic Courtès
2014-09-25 17:01   ` Federico Beffa
2014-09-25 19:12     ` Ludovic Courtès
2014-09-26 16:59       ` Federico Beffa
2014-09-27  9:24         ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.