guix-commits
[Top][All Lists]
Advanced

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

14/163: gnu: fio: Adjust for the new Guix PYTHONPATH.


From: guix-commits
Subject: 14/163: gnu: fio: Adjust for the new Guix PYTHONPATH.
Date: Mon, 25 Jan 2021 02:01:17 -0500 (EST)

apteryx pushed a commit to branch cu/farewell-to-pythonpath
in repository guix.

commit 999a4fb790d4f5f4acb0a6f7debc51f0a732c366
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Fri Jan 22 11:34:40 2021 -0500

    gnu: fio: Adjust for the new Guix PYTHONPATH.
    
    * gnu/packages/benchmark.scm (fio): Import required modules and adjust
    the wrap-program call to use guix-pythonpath instead of PYTHONPATH.  Delete
    trailing #t.
---
 gnu/packages/benchmark.scm | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm
index 3470f38..3152902 100644
--- a/gnu/packages/benchmark.scm
+++ b/gnu/packages/benchmark.scm
@@ -8,7 +8,7 @@
 ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;; Copyright © 2020 malte Frank Gerdes <malte.f.gerdes@gmail.com>
-;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2020 Greg Hogan <code@greghogan.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -61,7 +61,12 @@
                 "16r734an459cz1ax3jyhxc269i3syzdkll4qbv18wqaxpm5y34v6"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:test-target "test"
+     `(#:imported-modules ,(cons '(guix build python-build-system)
+                                 %gnu-build-system-modules)
+       #:modules ((guix build gnu-build-system)
+                  ((guix build python-build-system) #:select (guix-pythonpath))
+                  (guix build utils))
+       #:test-target "test"
        #:phases
        (modify-phases %standard-phases
          (add-after
@@ -76,23 +81,22 @@
                 ;; 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")))
-              #t)))
+                (("gnuplot mygraph") (string-append gnuplot " mygraph"))))))
          (replace 'configure
            (lambda* (#:key outputs #:allow-other-keys)
              ;; The configure script doesn't understand some of the
              ;; GNU options, so we can't use #:configure-flags.
              (let ((out (assoc-ref outputs "out")))
                (invoke "./configure"
-                       (string-append "--prefix=" out))
-               #t)))
+                       (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.
          (add-after 'install 'move-outputs
-           (lambda* (#:key outputs #:allow-other-keys)
+           (lambda* (#:key inputs 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"))
+                   (pythonpath (guix-pythonpath inputs)))
                (mkdir-p newbin)
                (for-each (lambda (file)
                            (let ((src (string-append oldbin "/" file))
@@ -103,8 +107,7 @@
                            "fiologparser.py"))
                ;; Make sure numpy et.al is found.
                (wrap-program (string-append newbin "/fiologparser_hist.py")
-                 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
-               #t))))))
+                 `(,pythonpath ":" prefix (,(getenv pythonpath))))))))))
     (outputs '("out" "utils"))
     (inputs
      `(("ceph" ,ceph "lib")



reply via email to

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