Subject: bug#55118: closed (Re: bug#55118: [PATCH] gnu: Add phoronix-test-suite.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 07 Jul 2022 21:47:01 +0000

Your bug report

#55118: [PATCH] gnu: Add phoronix-test-suite.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
55118: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55118
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#55118: [PATCH] gnu: Add phoronix-test-suite.
From: Maxim Cournoyer <[email-masked]>
To: phodina <[email-masked]>
Cc: [email-masked]
Date: Thu, 07 Jul 2022 17:46:42 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi!

phodina <[email-masked]> writes:

> Hi,
>
> I've packaged Phoronix test suite. Hopefully all inputs are wrapped.

I had missed this contribution and contributed it myself in
92121b8e9db9541b0fdf0e6e0b17e28e03a01277; apologies!

Closing.

Maxim

Subject: [PATCH] gnu: Add phoronix-test-suite.
From: phodina <[email-masked]>
To: Guix Patches <[email-masked]>
Date: Tue, 26 Apr 2022 03:53:57 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I've packaged Phoronix test suite. Hopefully all inputs are wrapped.

----
Petr

From 7af9ee1fe5ca48b15156c591d5d6d77ac64ff2bc Mon Sep 17 00:00:00 2001
From: Petr Hodina <[email-masked]>
Date: Tue, 26 Apr 2022 05:48:11 +0200
Subject: [PATCH] gnu: Add phoronix-test-suite.

* gnu/packages/benchmark.scm (phoronix-test-suite): New variable.

diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm
index ce137d845e..ee51d0cd83 100644
--- a/gnu/packages/benchmark.scm
+++ b/gnu/packages/benchmark.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <[email-masked]>
 ;;; Copyright © 2020 Greg Hogan <[email-masked]>
 ;;; Copyright © 2021 Arun Isaac <[email-masked]>
+;;; Copyright © 2022 Petr Hodina <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -34,14 +35,17 @@ (define-module (gnu packages benchmark)
   #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
@@ -51,6 +55,7 @@ (define-module (gnu packages benchmark)
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages opencl)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages php)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-science)
@@ -262,6 +267,77 @@ (define-public bonnie++
 file metadata operations that can be performed per second.")
     (license license:gpl2)))   ;GPL 2 only, see copyright.txt
 
+(define-public phoronix-test-suite
+  (package
+    (name "phoronix-test-suite")
+    (version "10.8.3")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url
+                     "https://github.com/phoronix-test-suite/phoronix-test-suite")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1q509piv5r8lkx82n9qgma19wd01f5ihy1ks1604865fwah1jg19"))))
+    (build-system copy-build-system)
+    (arguments
+     (let ((pts "pts-core/external-test-dependencies")
+           (usr (string-append "usr/share/phoronix-test-suite/"
+                               "pts-core/external-test-dependencies")))
+       (list #:install-plan
+             #~`((,(string-append #$pts
+                   "/dependency-handlers/arch_dependency_handler.php")
+                  ,(string-append #$usr
+                   "/dependency-handlers/arch_dependency_handler.php"))
+                 (,(string-append #$pts "/scripts/install-arch-packages.sh")
+                  ,(string-append #$usr "/scripts/install-arch-packages.sh"))
+                 (,(string-append #$pts "/xml/arch-packages.xml")
+                  ,(string-append #$usr
+                   "/pts-core/external-test-dependencies/xml/arch-packages.xml"))
+                 (,(string-append #$pts "/xml/generic-packages.xml")
+                  ,(string-append #$usr "/xml/generic-packages.xml")))
+             #:phases
+             #~(modify-phases %standard-phases
+                 (add-before 'install 'executable-link
+                   (lambda* (#:key inputs outputs #:allow-other-keys)
+                     (setenv "HOME" "/tmp")
+                     (invoke "./install-sh"
+                             (string-append #$output "/usr"))
+                     (mkdir-p (string-append #$output "/bin"))
+                     (wrap-program
+                      (string-append #$output
+                        "/usr/bin/phoronix-test-suite")
+                       `("PATH" ":" prefix
+                         ,(map (lambda (dir)
+                                 (string-append dir "/bin:" dir
+                                                "/sbin"))
+                               (list #$(this-package-input "php")
+                                     #$(this-package-input "sed")
+                                     #$(this-package-input "which")))))
+                     (symlink (string-append #$output
+                                             "/usr/bin/phoronix-test-suite")
+                              (string-append #$output "/bin/pts"))
+                     (delete-file-recursively
+                      (string-append #$output
+                                     "/usr/share/phoronix-test-suite/deploy"))
+                     (with-directory-excursion
+                      (string-append #$output "/" #$usr)
+                        (for-each (lambda (dir)
+                                    (delete-file-recursively
+                                     dir))
+                                  (list
+                                   "dependency-handlers"
+                                   "scripts" "xml")))))))))
+    (inputs (list bash-minimal sed which xdg-utils))
+    (propagated-inputs (list php))
+    (home-page "https://github.com/phoronix-test-suite/phoronix-test-suite")
+    (synopsis "Automated testing/benchmarking software")
+    (description "This package provides automated testing/benchmarking
+software.")
+    (license license:gpl3+)))
+
 (define-public python-locust
   (package
     (name "python-locust")
-- 
2.35.1