all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tomas Volf <~@wolfsden.cz>
To: 69380@debbugs.gnu.org
Cc: Tomas Volf <~@wolfsden.cz>
Subject: [bug#69380] [PATCH] gnu: guile-irregex: Update to 0.9.11.
Date: Sun, 25 Feb 2024 14:26:08 +0100	[thread overview]
Message-ID: <3ad16a6c2b1f0a7213c491570f438db81f3fe863.1708867568.git.~@wolfsden.cz> (raw)

Since upstream now provides tests for guile, they are executed, both before
install (testing the internals) and after install (making sure the guile
module and everything works well).

Guile 2.0 for some reason cannot load "foo.scm" using (load-from-path "foo"),
so symlinks are created to work around that.

* gnu/packages/guile-xyz.scm (guile-irregex)[version]: Update to 0.9.11.
[arguments]: Convert to gexp.
<#:phases>{'move-files-around}: Copy files instead of moving.
{'check, 'check-installed}: New phases.
(guile2.0-irregex)[arguments]: Add 'create-symlinks phase.

Change-Id: Ib9d4e9c24475aa8e7fc1e70b868b690eaf6ad42e
---
 gnu/packages/guile-xyz.scm | 78 +++++++++++++++++++++++++++++---------
 1 file changed, 60 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index b34472d5bd..9d683199ac 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -2895,7 +2895,7 @@ (define-public guile2.2-minikanren
 (define-public guile-irregex
   (package
     (name "guile-irregex")
-    (version "0.9.6")
+    (version "0.9.11")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -2903,25 +2903,46 @@ (define-public guile-irregex
                     version ".tar.gz"))
               (sha256
                (base32
-                "1ia3m7dp3lcxa048q0gqbiwwsyvn99baw6xkhb4bhhzn4k7bwyqq"))))
+                "026kzl96pmwbjqdc7kh8rdh8ng813sjvdsik0dag5acza20sjm19"))))
     (build-system guile-build-system)
     (arguments
-     '(#:phases (modify-phases %standard-phases
-                  (add-after 'unpack 'move-files-around
-                    (lambda _
-                      ;; Move the relevant source files to src/ and create the
-                      ;; rx/ directory to match the expected module hierarchy.
-                      (mkdir-p "src/rx/source")
-                      (rename-file "irregex-guile.scm"
-                                   "src/rx/irregex.scm")
-                      (rename-file "irregex.scm"
-                                   "src/rx/source/irregex.scm")
-                      ;; Not really reachable via guile's packaging system,
-                      ;; but nice to have around.
-                      (rename-file "irregex-utils.scm"
-                                   "src/rx/source/irregex-utils.scm")
-                      #t)))
-       #:source-directory "src"))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'move-files-around
+            (lambda _
+              ;; Copy the relevant source files to src/ and create the
+              ;; rx/ directory to match the expected module hierarchy.
+              (mkdir-p "src/rx/source")
+              (copy-file "irregex-guile.scm"
+                         "src/rx/irregex.scm")
+              (copy-file "irregex.scm"
+                         "src/rx/source/irregex.scm")
+
+              (mkdir-p "src/rx/irregex")
+              (copy-file "irregex-utils-guile.scm"
+                         "src/rx/irregex/utils.scm")
+              (copy-file "irregex-utils.scm"
+                         "src/rx/source/irregex-utils.scm")))
+          (add-after 'build 'check
+            (lambda _
+              (for-each (lambda (f)
+                          (invoke "guile" "--no-auto-compile" "-L" "." "-s" f))
+                        (find-files "tests" "^guile-.*\\.scm"))))
+          (add-after 'install 'check-installed
+            (lambda _
+              (define-values (scm go) (target-guile-scm+go #$output))
+              (for-each
+               (lambda (f)
+                 (substitute* f
+                   (("\\(load-from-path \"irregex\"\\)")
+                    "(use-modules (rx irregex))")
+                   (("\\(load-from-path \"irregex-utils\"\\)")
+                    "(use-modules (rx irregex utils))"))
+                 (invoke "guile" "-L" scm "-C" go "-L" "tests" f))
+               (delete "tests/guile-cset.scm" ; Tests non-exported API
+                       (find-files "tests" "^guile-.*\\.scm"))))))
+      #:source-directory "src"))
     (native-inputs
      (list guile-3.0))
     (home-page "https://synthcode.com/scheme/irregex")
@@ -2936,6 +2957,27 @@ (define-public guile2.0-irregex
   (package
     (inherit guile-irregex)
     (name "guile2.0-irregex")
+    (arguments
+     (substitute-keyword-arguments (package-arguments guile-irregex)
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            ;; For some reason guile 2.0 cannot load foo.scm using
+            ;; (load-from-path "foo").  So create symlinks to work around it.
+            (add-before 'check 'create-symlinks
+              (lambda _
+                (use-modules (ice-9 regex))
+                (for-each
+                 (lambda (f)
+                   (symlink (regexp-substitute #f (string-match "/([^/]+)$" f)
+                                               1 ".scm")
+                            f))
+                 '("tests/guile/test-support"
+                   "tests/test-cset"
+                   "tests/test-irregex"
+                   "tests/test-irregex-from-gauche"
+                   "tests/test-irregex-pcre"
+                   "tests/test-irregex-scsh"
+                   "tests/test-irregex-utf8"))))))))
     (native-inputs (list guile-2.0))))
 
 (define-public guile2.2-irregex

base-commit: aefc7428203203ae88c64cc4769113453c01a185
-- 
2.41.0





             reply	other threads:[~2024-02-25 13:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-25 13:26 Tomas Volf [this message]
2024-03-02 16:13 ` bug#69380: [PATCH] gnu: guile-irregex: Update to 0.9.11 Ludovic Courtès
2024-03-03 16:57   ` [bug#69380] " Tomas Volf

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

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

  git send-email \
    --in-reply-to='3ad16a6c2b1f0a7213c491570f438db81f3fe863.1708867568.git.~@wolfsden.cz' \
    --to=~@wolfsden.cz \
    --cc=69380@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.