guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: gnu: fio: Don't bother wrapping scripts.


From: guix-commits
Subject: 01/03: gnu: fio: Don't bother wrapping scripts.
Date: Sat, 6 Nov 2021 12:52:05 -0400 (EDT)

mbakke pushed a commit to branch master
in repository guix.

commit 5e7c2eb7ae95064cb0c68e2ca6a9256a3b9f0b0d
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Fri Nov 5 23:56:36 2021 +0100

    gnu: fio: Don't bother wrapping scripts.
    
    fio comes with many scripts of varying utility.  Some require extra 
additional
    programs, which users can easily install as needed; there is little use in
    imposing all optional dependencies on all users of fio.
    
    * gnu/packages/benchmark.scm (fio)[arguments]: Remove patch-paths phase.
    Rewrite move-outputs to move all discovered scripts and not wrap any.
    [inputs]: Remove GNUPLOT, PYTHON-2, PYTHON2-NUMPY, and PYTHON2-PANDAS.  Add
    PYTHON.
---
 gnu/packages/benchmark.scm | 48 ++++++++++++++++------------------------------
 1 file changed, 16 insertions(+), 32 deletions(-)

diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm
index a422073..3cee5da 100644
--- a/gnu/packages/benchmark.scm
+++ b/gnu/packages/benchmark.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2016, 2017, 2021 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
@@ -63,22 +63,11 @@
                 "0ba9cnjrnm3nwcfbhh5x2sycr54j3yn1rqn76kjdyz40f3pdg3qm"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:test-target "test"
+     `(#:modules (,@%gnu-build-system-modules
+                  (ice-9 textual-ports))
+       #:test-target "test"
        #:phases
        (modify-phases %standard-phases
-         (add-after
-          'unpack 'patch-paths
-          (lambda* (#:key inputs outputs #:allow-other-keys)
-            (let ((out (assoc-ref outputs "out"))
-                  (gnuplot (string-append (assoc-ref inputs "gnuplot")
-                                          "/bin/gnuplot")))
-              (substitute* "tools/plot/fio2gnuplot"
-                (("/usr/share/fio") (string-append out "/share/fio"))
-                ;; FIXME (upstream): The 'gnuplot' executable is used inline
-                ;; in various os.system() calls mixed with *.gnuplot filenames.
-                (("; do gnuplot") (string-append "; do " gnuplot))
-                (("gnuplot mymath") (string-append gnuplot " mymath"))
-                (("gnuplot mygraph") (string-append gnuplot " mygraph"))))))
          (replace 'configure
            (lambda* (#:key outputs #:allow-other-keys)
              ;; The configure script doesn't understand some of the
@@ -87,32 +76,27 @@
                (invoke "./configure"
                        (string-append "--prefix=" out)))))
          ;; The main `fio` executable is fairly small and self contained.
-         ;; Moving the auxiliary python and gnuplot scripts to a separate
-         ;; output saves almost 400 MiB on the closure.
+         ;; Moving the auxiliary scripts to a separate output saves ~100 MiB
+         ;; on the closure.
          (add-after 'install 'move-outputs
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((oldbin (string-append (assoc-ref outputs "out") "/bin"))
-                   (newbin (string-append (assoc-ref outputs "utils") "/bin")))
+                   (newbin (string-append (assoc-ref outputs "utils") "/bin"))
+                   (script? (lambda* (file #:rest _)
+                              (call-with-input-file file
+                                (lambda (port)
+                                  (char=? #\# (peek-char port)))))))
                (mkdir-p newbin)
                (for-each (lambda (file)
-                           (let ((src (string-append oldbin "/" file))
-                                 (dst (string-append newbin "/" file)))
-                             (link src dst)
-                             (delete-file src)))
-                         '("fio2gnuplot"  "fiologparser_hist.py"
-                           "fiologparser.py"))
-               ;; Make sure numpy et.al is found.
-               (wrap-program (string-append newbin "/fiologparser_hist.py")
-                 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))))))))
+                           (link file (string-append newbin "/" (basename 
file)))
+                           (delete-file file))
+                         (find-files oldbin script?))))))))
     (outputs '("out" "utils"))
     (inputs
      `(("ceph" ,ceph "lib")
        ("libaio" ,libaio)
-       ("gnuplot" ,gnuplot)
-       ("zlib" ,zlib)
-       ("python-numpy" ,python2-numpy)
-       ("python-pandas" ,python2-pandas)
-       ("python" ,python-2)))
+       ("python" ,python)
+       ("zlib" ,zlib)))
     (home-page "https://github.com/axboe/fio";)
     (synopsis "Flexible I/O tester")
     (description



reply via email to

[Prev in Thread] Current Thread [Next in Thread]