diff mbox series

[bug#60386] gnu: Add guile-proba.

Message ID nSZT0otTqh8SJirEUyeY-gOQrmjfQ5JSbI6MNIKZ0TlzwZ-8Xc0U_ggLZqI_exvM_hYXn5n9On7nl83zToicXU5HLgM8VpAENp0H4zKQ6po=@protonmail.com
State New
Headers show
Series [bug#60386] gnu: Add guile-proba. | expand

Commit Message

Luis Felipe Dec. 28, 2022, 6:07 p.m. UTC
Hi, a new package here.



---
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/

Comments

Ludovic Courtès Jan. 10, 2023, 10:48 a.m. UTC | #1
Hello!

Luis Felipe <luis.felipe.la@protonmail.com> skribis:

> From 332ea52f1f060a4fa1b8af7100b4cbd2f481f24b Mon Sep 17 00:00:00 2001
> From: Luis Felipe <luis.felipe.la@protonmail.com>
> Date: Wed, 28 Dec 2022 12:45:32 -0500
> Subject: [PATCH] gnu: Add guile-proba.
>
> * gnu/packages/check.scm (guile-proba): New variable.

[...]

> +    (native-inputs (list guile-3.0 texinfo))
> +    (propagated-inputs (list guile-3.0 guile-config guile-lib texinfo))

I don’t think ‘guile-3.0’ and ‘texinfo’ need to be propagated, do they?

Apart from that it LGTM, thanks!

Ludo’.
Luis Felipe Jan. 13, 2023, 3:41 p.m. UTC | #2
On Tuesday, January 10th, 2023 at 10:48, Ludovic Courtès <ludo@gnu.org> wrote:

> I don’t think ‘guile-3.0’ and ‘texinfo’ need to be propagated, do they?

They do? If I don't propagate them, running the "proba" script fails because the "proba" library can't be found and running "info guile-proba" the info command is not found (I just tried in a foreign distro and also using a pure shell on my Guix system). 


Things only work as expected if I propagate "guile-3.0" and "texinfo" or if I don't propagate them but tell users to install them themselves (guix install guile-proba guile texinfo).

So I'm not sure what I should do...
Ludovic Courtès Jan. 17, 2023, 1:50 p.m. UTC | #3
Hi!

Luis Felipe <luis.felipe.la@protonmail.com> skribis:

> On Tuesday, January 10th, 2023 at 10:48, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> I don’t think ‘guile-3.0’ and ‘texinfo’ need to be propagated, do they?
>
> They do? If I don't propagate them, running the "proba" script fails because the "proba" library can't be found and running "info guile-proba" the info command is not found (I just tried in a foreign distro and also using a pure shell on my Guix system). 

Check out the section on search paths (info "(guix) Search Paths").

In essence, INFOPATH won’t be set if you don’t have an Info reader
(‘info-reader’ or ‘emacs’) in the profile, because then you’d have no
way to read the Info file.  Yet, you shouldn’t force a specific Info
reader on the user via ‘propagated-inputs’.

The story is similar for ‘guile-3.0’.  Here, you should wrap or modify
the ‘proba’ script such that it automatically adds its own
$PKG/share/guile/site/3.0 to its .scm search path (and likewise for .go
files).

See for example the ‘mcron’ or ‘shepherd’ script of the same-named
packages, or see the ‘wrap-guilescript’ phase of the ‘guilescript’
package.

HTH!

Ludo’.
diff mbox series

Patch

From 332ea52f1f060a4fa1b8af7100b4cbd2f481f24b Mon Sep 17 00:00:00 2001
From: Luis Felipe <luis.felipe.la@protonmail.com>
Date: Wed, 28 Dec 2022 12:45:32 -0500
Subject: [PATCH] gnu: Add guile-proba.

* gnu/packages/check.scm (guile-proba): New variable.
---
 gnu/packages/check.scm | 51 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index aaa41777dc..3967a22f76 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -41,6 +41,7 @@ 
 ;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
 ;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
+;;; Copyright © 2022 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -70,6 +71,8 @@  (define-module (gnu packages check)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages golang)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages guile)
+  #:use-module (gnu packages guile-xyz)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -78,6 +81,7 @@  (define-module (gnu packages check)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages python-science)
+  #:use-module (gnu packages texinfo)
   #:use-module (gnu packages time)
   #:use-module (gnu packages xml)
   #:use-module (guix utils)
@@ -90,6 +94,7 @@  (define-module (gnu packages check)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
+  #:use-module (guix build-system guile)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system pyproject)
   #:use-module (guix build-system python)
@@ -3455,3 +3460,49 @@  (define-public python-pytest-regressions
 tables by saving expected data in a data directory (courtesy of pytest-datadir)
 that can be used to verify that future runs produce the same data.")
     (license license:expat)))
+
+(define-public guile-proba
+  (package
+    (name "guile-proba")
+    (version "0.2.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://codeberg.org/luis-felipe/guile-proba")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "04si01wzhc9c8rqy9vr12fpkf8gnlx7crkph8djy80s2c7b1lvr7"))))
+    (build-system guile-build-system)
+    (native-inputs (list guile-3.0 texinfo))
+    (propagated-inputs (list guile-3.0 guile-config guile-lib texinfo))
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'build 'check
+            (lambda _
+              (invoke "guile" "proba.scm" "run" "tests")))
+          (add-after 'install 'install-script-and-manual
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (bin-dir (string-append out "/bin"))
+                     (info-dir (string-append out "/share/info"))
+                     (script (string-append bin-dir "/proba")))
+                (mkdir-p bin-dir)
+                (mkdir-p info-dir)
+                (copy-file "proba.scm" script)
+                (chmod script #o555)
+                (invoke "makeinfo" "manual/main.texi")
+                (install-file "guile-proba" info-dir)))))
+      #:not-compiled-file-regexp
+      "((packages|tests)\\/.*.scm|(proba|manifest).scm)$"))
+    (home-page "https://luis-felipe.gitlab.io/guile-proba/")
+    (synopsis "Testing tools for GNU Guile projects with SRFI 64 test suites")
+    (description
+     "This software is a set of testing tools for GNU Guile projects
+with SRFI 64-based test suites.  It comes with a command-line interface
+to run test collections, and a library that includes a test runner and
+helpers for writing tests.")
+    (license license:public-domain)))

base-commit: fc5dc3e04789a15d80a7b35987adaefc1a94b97c
-- 
2.38.1