unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: Nicolas Graves <ngraves@ngraves.fr>
Cc: 65853@debbugs.gnu.org, Andreas Enge <andreas@enge.fr>,
	Eric Bavier <bavier@posteo.net>
Subject: [bug#65853] [PATCH] gnu: scilab: Fix and hardcode script inputs.
Date: Thu, 28 Sep 2023 19:36:23 +0300	[thread overview]
Message-ID: <ZRWrh5B6M7acbiZj@3900XT> (raw)
In-Reply-To: <0852115dc8e706b80b05d57cfbfae64de79fdac5.1694362722.git.ngraves@ngraves.fr>

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

A couple of things I noticed:

On Sun, Sep 10, 2023 at 06:18:42PM +0200, Nicolas Graves wrote:
> * 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 | 43 ++++++++++++++++++++++++++++++------------
>  1 file changed, 31 insertions(+), 12 deletions(-)
> 
> diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
> index 38e71e18f8..40883d71c1 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

This can be coreutils-minimal

> +                  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
> @@ -8534,7 +8537,23 @@ (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"))

These can be (search-input-file #$inputs "/bin/grep") to make it easier
to swap out the packages for something else if people want.

> +                  (("sed")

I checked the script, it should be ((" sed ") since there are a couple
of instances of 'sed' in the script which aren't invocations of sed.

> +                   #$(file-append (this-package-input "sed") "/bin/sed"))
> +                  (("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"))))))))

Are there more binaries which should be substituted? I saw glxgears,
chcon, a couple instances of java, pwd, valgrind, docbook paths. And
then there's a couple of other scripts and binaries in the bin/ folder.
I think it'd be better to use wrap-script or wrap-program and then use
substitute* to strip the leading /usr/bin/ from the different calls to
the different binaries.

>      (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
> -- 
> 2.41.0
> 
> 
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-09-28 16:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-10 16:18 [bug#65853] [PATCH] gnu: scilab: Fix and hardcode script inputs Nicolas Graves via Guix-patches via
2023-09-28 16:36 ` Efraim Flashner [this message]
2023-09-28 18:30   ` 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-05 23:51   ` [bug#65853] [PATCH v3 1/8] gnu: scilab: Remove uneeded code Nicolas Graves via Guix-patches via
2023-11-05 23:51   ` [bug#65853] [PATCH v3 2/8] gnu: scilab: Activate tests and disable failing tests Nicolas Graves via Guix-patches via
2023-11-05 23:51   ` [bug#65853] [PATCH v3 3/8] gnu: scilab: Use gexp for tcl and tk libraries Nicolas Graves via Guix-patches via
2023-11-05 23:51   ` [bug#65853] [PATCH v3 4/8] gnu: scilab: Add phase rewrap-scilab-cli Nicolas Graves via Guix-patches via
2023-11-05 23:51   ` [bug#65853] [PATCH v3 5/8] gnu: scilab: Reindent Nicolas Graves via Guix-patches via
2023-11-05 23:51   ` [bug#65853] [PATCH v3 6/8] gnu: scilab: Update to 2024.0.0 Nicolas Graves via Guix-patches via
2023-11-05 23:51   ` [bug#65853] [PATCH v3 7/8] gnu: scilab: Add phase set-version Nicolas Graves via Guix-patches via
2023-11-05 23:51   ` [bug#65853] [PATCH v3 8/8] gnu: scilab: Set default SCIHOME value 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZRWrh5B6M7acbiZj@3900XT \
    --to=efraim@flashner.co.il \
    --cc=65853@debbugs.gnu.org \
    --cc=andreas@enge.fr \
    --cc=bavier@posteo.net \
    --cc=ngraves@ngraves.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).