unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#65856] [PATCH v2 1/2] gnu: scilab: Fix and hardcode script inputs.
@ 2023-09-10 17:43 Nicolas Graves via Guix-patches via
  2023-09-10 17:43 ` [bug#65857] [PATCH v2 2/2] gnu: scilab: Set SCIHOME default to respect XDG base dirs Nicolas Graves via Guix-patches via
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2023-09-10 17:43 UTC (permalink / raw)
  To: 65856; +Cc: ngraves, Andreas Enge, Efraim Flashner, Eric Bavier

* gnu/packages/maths.scm (scilab): Fix script inputs.
[inputs]: Reorder alphabetically. Add coreutils, grep, sed.
[arguments](phases): Add phase hardcode-script-inputs.
---
 gnu/packages/maths.scm | 51 +++++++++++++++++++++++++++++-------------
 1 file changed, 35 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 38e71e18f8..900a9f0fac 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8448,22 +8448,25 @@ (define-public scilab
         (base32 "0phg9pn24yw98hbh475ik84dnikf1225b2knh7qbhdbdx6fm2d57"))))
     (build-system gnu-build-system)
     (native-inputs (list pkg-config gfortran))
-    (inputs (list libxml2
+    (inputs (list arpack-ng
+                  coreutils
+                  curl
+                  fftw
+                  gettext-minimal
+                  grep
+                  hdf5-1.8
+                  lapack
+                  libxml2
+                  libx11
+                  matio
+                  openblas
                   `(,pcre "bin")
                   `(,pcre "out")
                   readline
-                  hdf5-1.8
-                  curl
-                  openblas
-                  lapack
-                  arpack-ng
-                  fftw
-                  gettext-minimal
+                  sed
                   suitesparse-3
                   tcl
-                  tk
-                  libx11
-                  matio))
+                  tk))
     (arguments
      `(#:tests? #f
        #:configure-flags
@@ -8499,10 +8502,6 @@ (define-public scilab
        ,#~(modify-phases %standard-phases
             (add-before 'build 'pre-build
               (lambda _
-                ;; Fix scilab script.
-                (substitute* "bin/scilab"
-                  (("\\/bin\\/ls")
-                   (which "ls")))
                 ;; Fix core.start.
                 (substitute* "modules/core/etc/core.start"
                   (("'SCI/modules")
@@ -8534,7 +8533,27 @@ (define-public scilab
                   (("if \\(array_size > 0\\)")
                    "if (*array_size > 0)"))
                 ;; Set SCIHOME to /tmp before macros compilation.
-                (setenv "SCIHOME" "/tmp"))))))
+                (setenv "SCIHOME" "/tmp")))
+            (add-after 'install 'hardcode-script-inputs
+              (lambda _
+                (substitute* (string-append #$output "/bin/scilab")
+                  (("grep")
+                   #$(file-append (this-package-input "grep") "/bin/grep"))
+                  (("\\| sed")
+                   (string-append
+                    "| " #$(file-append (this-package-input "sed") "/bin/sed")))
+                   (("/bin/ls")
+                    #$(file-append (this-package-input "coreutils")
+                                   "/bin/ls"))
+                  (("uname")
+                   #$(file-append (this-package-input "coreutils")
+                                  "/bin/uname"))
+                  (("dirname")
+                   #$(file-append (this-package-input "coreutils")
+                                  "/bin/dirname"))
+                  (("basename")
+                   #$(file-append (this-package-input "coreutils")
+                                  "/bin/basename"))))))))
     (home-page "https://scilab.org")
     (synopsis "Software for engineers and scientists")
     (description "This package provides the non-graphical version of the Scilab

base-commit: 2eb6df537c36da8bf8e81ff698421f6fb1bfd1ab
prerequisite-patch-id: eb618ab7b10483d917c308a38792af98baa517e2
prerequisite-patch-id: 40b6c9f09f27833367a71ec25d77afae4d2a835e
prerequisite-patch-id: c12968d02d99c253f858586a86b16fa32d41f1c1
prerequisite-patch-id: 09d995d48139f8e61183d5634cda13a01cdb50f7
prerequisite-patch-id: 86baa45ec2aad977c8c8135f7613aa391155de6d
prerequisite-patch-id: 3425fbbff6a603d60b4e143ea2141aabf4ddc92c
prerequisite-patch-id: c373c01aab5dcba3503a97d51c62a595147a041c
prerequisite-patch-id: cda857c790b88c681c4e713c5f71e40291970daf
prerequisite-patch-id: 8e234d0f4d93d2aad499eec8842be3d28da98707
prerequisite-patch-id: 5f664cb2fd995a53765c5ffc19a708ac795cc0c4
prerequisite-patch-id: ed447cba9cf9b7e1a1b47aa27acb14f8f2da0a8e
prerequisite-patch-id: 9f80c5bbbfb8cd3347951c4d57634e93ffa79924
prerequisite-patch-id: 1aaa9f0d466e2d6837f75844df48a98beb70ff24
prerequisite-patch-id: 34502820d8c0355b3ed2638c457084edeaba029d
prerequisite-patch-id: a96258da9e78cfb9ac9893cdcdeb38b69b75f134
prerequisite-patch-id: 536470ccb53bbb5672363863c14c082ecc0d5b0a
-- 
2.41.0





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

* [bug#65857] [PATCH v2 2/2] gnu: scilab: Set SCIHOME default to respect XDG base dirs.
  2023-09-10 17:43 [bug#65856] [PATCH v2 1/2] gnu: scilab: Fix and hardcode script inputs Nicolas Graves via Guix-patches via
@ 2023-09-10 17:43 ` Nicolas Graves via Guix-patches via
  2023-09-28 19:05   ` [bug#65857] [PATCH v2] " Nicolas Graves via Guix-patches via
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2023-09-10 17:43 UTC (permalink / raw)
  To: 65857; +Cc: ngraves, Andreas Enge, Efraim Flashner, Eric Bavier

* gnu/packages/maths.scm (scilab): Set SCIHOME default to respect XDG base dirs.
[arguments](phases): Add phase respect-xdg-base-dirs.
---
 gnu/packages/maths.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 900a9f0fac..8162ab95d1 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8553,7 +8553,14 @@ (define-public scilab
                                   "/bin/dirname"))
                   (("basename")
                    #$(file-append (this-package-input "coreutils")
-                                  "/bin/basename"))))))))
+                                  "/bin/basename")))))
+            (add-after 'hardcode-script-inputs 'respect-xdg-base-dirs
+              (lambda _
+                (substitute* (string-append #$output "/bin/scilab")
+                  (("IS_SCILAB_BINARY=0" all)
+                   (string-append all
+                                  "\n[ -n \"$SCIHOME\" ] &&\
+ SCIHOME=\"${XDG_STATE_HOME}/scilab\""))))))))
     (home-page "https://scilab.org")
     (synopsis "Software for engineers and scientists")
     (description "This package provides the non-graphical version of the Scilab
-- 
2.41.0





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

* [bug#65857] [PATCH v2] gnu: scilab: Set SCIHOME default to respect XDG base dirs.
  2023-09-10 17:43 ` [bug#65857] [PATCH v2 2/2] gnu: scilab: Set SCIHOME default to respect XDG base dirs Nicolas Graves via Guix-patches via
@ 2023-09-28 19:05   ` Nicolas Graves via Guix-patches via
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2023-09-28 19:05 UTC (permalink / raw)
  To: 65857; +Cc: ngraves, Andreas Enge, Efraim Flashner, Eric Bavier

* gnu/packages/maths.scm (scilab): Set SCIHOME default to respect XDG base dirs.
[arguments](phases): Add phase respect-xdg-base-dirs.
---
 gnu/packages/maths.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index f7e1de41f3..580d98417c 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8533,7 +8533,14 @@ (define-public scilab
                   (("dirname")
                    (search-inputs-file #$inputs "/bin/dirname"))
                   (("basename")
-                   (search-inputs-file #$inputs "/bin/basename"))))))))
+                   (search-inputs-file #$inputs "/bin/basename")))))
+            (add-after 'hardcode-script-inputs 'respect-xdg-base-dirs
+              (lambda _
+                (substitute* (string-append #$output "/bin/scilab")
+                  (("IS_SCILAB_BINARY=0" all)
+                   (string-append all
+                                  "\n[ -n \"$SCIHOME\" ] &&\
+ SCIHOME=\"${XDG_STATE_HOME:$HOME/.local/state}/scilab\""))))))))
     (home-page "https://scilab.org")
     (synopsis "Software for engineers and scientists")
     (description "This package provides the non-graphical version of the Scilab

base-commit: f9784991eb6c7ec1a20f76d080873a3319be0908
prerequisite-patch-id: 5ec00d550739652cba67dc8663fbde73ff268491
-- 
2.41.0





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

* [bug#65857] [PATCH v2 2/2] gnu: scilab: Set SCIHOME default to respect XDG base dirs.
  2023-10-05 14:51   ` [bug#65853] bug#65857: [PATCH v2 2/2] gnu: scilab: Set SCIHOME default to respect XDG base dirs Ludovic Courtès
@ 2023-10-05 15:09     ` Nicolas Graves via Guix-patches via
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2023-10-05 15:09 UTC (permalink / raw)
  To: Ludovic Courtès
  Cc: 65853, Eric Bavier, Andreas Enge, 65857, Efraim Flashner

On 2023-10-05 16:51, Ludovic Courtès wrote:

> Hi,
>
> Nicolas Graves <ngraves@ngraves.fr> skribis:
>
>> +            (add-after 'install 'hardcode-script-inputs
>> +              (lambda _
>> +                (substitute* (string-append #$output "/bin/scilab")
>> +                  (("grep")
>> +                   (search-inputs-file #$inputs "/bin/grep"))
>
> I’ll contradict Efraim, but hopefully they’ll pardon me: I’d write it
> like so:
>
>   (lambda* (#:key inputs #:allow-other-keys)
>     (substitute* …
>       (("grep")
>        (search-input-file inputs "/bin/grep"))))
>
> That way it’ll DTRT even when creating a variant of this package.
>
> (The code above had a typo too, with “inputs” as plural.)
>
> Could you send one last updated patch?

Yes, it also has to be rebased now that scilab is version 2023. 
>
> Thanks,
> Ludo’.

-- 
Best regards,
Nicolas Graves




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

* [bug#65857] [PATCH v2 2/2] gnu: scilab: Set SCIHOME default to respect XDG base dirs.
  2023-11-05 23:51 ` [bug#65853] [PATCH v3 0/8] Scilab: Big update Nicolas Graves via Guix-patches via
@ 2023-11-23 10:30   ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2023-11-23 10:30 UTC (permalink / raw)
  To: Nicolas Graves; +Cc: 65853-done, 65857-done

Hi Nicolas,

Nicolas Graves <ngraves@ngraves.fr> skribis:

>   gnu: scilab: Remove uneeded code.
>   gnu: scilab: Activate tests and disable failing tests.
>   gnu: scilab: Use gexp for tcl and tk libraries.
>   gnu: scilab: Add phase rewrap-scilab-cli.
>   gnu: scilab: Reindent.
>   gnu: scilab: Update to 2024.0.0.
>   gnu: scilab: Add phase set-version.
>   gnu: scilab: Set default SCIHOME value.

I added one commit log that was mostly missing and applied the whole
series.  Thank you!

Ludo’.




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

end of thread, other threads:[~2023-11-23 10:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-10 17:43 [bug#65856] [PATCH v2 1/2] gnu: scilab: Fix and hardcode script inputs Nicolas Graves via Guix-patches via
2023-09-10 17:43 ` [bug#65857] [PATCH v2 2/2] gnu: scilab: Set SCIHOME default to respect XDG base dirs Nicolas Graves via Guix-patches via
2023-09-28 19:05   ` [bug#65857] [PATCH v2] " Nicolas Graves via Guix-patches via
  -- strict thread matches above, loose matches on Subject: below --
2023-09-10 16:18 [bug#65853] [PATCH] gnu: scilab: Fix and hardcode script inputs Nicolas Graves via Guix-patches via
2023-09-28 19:03 ` [bug#65853] [PATCH v2] " Nicolas Graves via Guix-patches via
2023-10-05 14:51   ` [bug#65853] bug#65857: [PATCH v2 2/2] gnu: scilab: Set SCIHOME default to respect XDG base dirs Ludovic Courtès
2023-10-05 15:09     ` [bug#65857] " Nicolas Graves via Guix-patches via
2023-11-05 23:51 ` [bug#65853] [PATCH v3 0/8] Scilab: Big update Nicolas Graves via Guix-patches via
2023-11-23 10:30   ` [bug#65857] [PATCH v2 2/2] gnu: scilab: Set SCIHOME default to respect XDG base dirs Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).