unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 63942@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#63942] [PATCH 1/5] gnu: guile-fibers: Add 1.3.1.
Date: Wed,  7 Jun 2023 10:38:48 +0200	[thread overview]
Message-ID: <3a86e6815a5d5d160e17105095546f6c3ff0d95a.1686126946.git.ludo@gnu.org> (raw)
In-Reply-To: <cover.1686126946.git.ludo@gnu.org>

* gnu/packages/guile-xyz.scm (guile-fibers-1.3): New variable.
(guile-fibers-1.1): Inherit from it.
* gnu/packages/patches/guile-fibers-libevent-32-bit.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/guile-xyz.scm                    | 53 ++++++++++++++-----
 .../guile-fibers-libevent-32-bit.patch        | 18 +++++++
 3 files changed, 59 insertions(+), 13 deletions(-)
 create mode 100644 gnu/packages/patches/guile-fibers-libevent-32-bit.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f9afb433e6..f466f91746 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1317,6 +1317,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/guile-fibers-epoll-instance-is-dead.patch \
   %D%/packages/patches/guile-fibers-fd-finalizer-leak.patch	\
   %D%/packages/patches/guile-fibers-wait-for-io-readiness.patch \
+  %D%/packages/patches/guile-fibers-libevent-32-bit.patch	\
   %D%/packages/patches/guile-fix-invalid-unicode-handling.patch \
   %D%/packages/patches/guile-gdbm-ffi-support-gdbm-1.14.patch	\
   %D%/packages/patches/guile-git-adjust-for-libgit2-1.2.0.patch \
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index d8684bb818..43334eea0c 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -92,6 +92,7 @@ (define-module (gnu packages guile-xyz)
   #:use-module (gnu packages hurd)
   #:use-module (gnu packages image)
   #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages libunistring)
   #:use-module (gnu packages linux)
@@ -788,10 +789,10 @@ (define-public guile2.2-dsv
     (inputs (list guile-2.2))
     (propagated-inputs `(("guile-lib" ,guile2.2-lib)))))
 
-(define-public guile-fibers-1.1
+(define-public guile-fibers-1.3
   (package
     (name "guile-fibers")
-    (version "1.1.1")
+    (version "1.3.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -800,11 +801,9 @@ (define-public guile-fibers-1.1
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0ll63d7202clapg1k4bilbnlmfa4qvpjnsd7chbkka4kxf5klilc"))
+                "0wvdi4l58f9a5c9wi3cdc9l1bniscsixb6w2zj86mch7j7j814lc"))
               (patches
-               (search-patches "guile-fibers-wait-for-io-readiness.patch"
-                               "guile-fibers-epoll-instance-is-dead.patch"
-                               "guile-fibers-fd-finalizer-leak.patch"))))
+               (search-patches "guile-fibers-libevent-32-bit.patch"))))
     (build-system gnu-build-system)
     (arguments
      (list #:make-flags
@@ -822,17 +821,15 @@ (define-public guile-fibers-1.1
                      (substitute* "Makefile"
                        (("tests/speedup.scm") ""))))))))
     (native-inputs
-     (list texinfo pkg-config autoconf automake libtool
+     (list texinfo pkg-config autoconf-2.71 automake libtool
            guile-3.0            ;for 'guild compile
            ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS'
            gettext-minimal))
     (inputs
-     (list guile-3.0))                            ;for libguile-3.0.so
-    (supported-systems
-     ;; This version requires 'epoll' and is thus limited to Linux-based
-     ;; systems, but this may change soon:
-     ;; <https://github.com/wingo/fibers/pull/53>.
-     (filter (cut string-suffix? "-linux" <>) %supported-systems))
+     (append (list guile-3.0)                     ;for libguile-3.0.so
+             (if (hurd-target?)
+                 (list libevent)
+                 '())))
     (synopsis "Lightweight concurrency facility for Guile")
     (description
      "Fibers is a Guile library that implements a a lightweight concurrency
@@ -849,6 +846,36 @@ (define-public guile-fibers-1.1
     (properties '((upstream-name . "fibers")))
     (license license:lgpl3+)))
 
+(define-public guile-fibers-1.1
+  (package
+    (inherit guile-fibers-1.3)
+    (version "1.1.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/wingo/fibers")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name "guile-fibers" version))
+              (sha256
+               (base32
+                "0ll63d7202clapg1k4bilbnlmfa4qvpjnsd7chbkka4kxf5klilc"))
+              (patches
+               (search-patches "guile-fibers-wait-for-io-readiness.patch"
+                               "guile-fibers-epoll-instance-is-dead.patch"
+                               "guile-fibers-fd-finalizer-leak.patch"))))
+    (native-inputs
+     (list texinfo pkg-config autoconf automake libtool
+           guile-3.0            ;for 'guild compile
+           ;; Gettext brings 'AC_LIB_LINKFLAGS_FROM_LIBS'
+           gettext-minimal))
+    (inputs
+     (list guile-3.0))                            ;for libguile-3.0.so
+    (supported-systems
+     ;; This version requires 'epoll' and is thus limited to Linux-based
+     ;; systems, which is fixed in 1.2.0:
+     ;; <https://github.com/wingo/fibers/pull/53>.
+     (filter (cut string-suffix? "-linux" <>) %supported-systems))))
+
 (define-public guile-fibers-next
   (let ((commit "99fc3e38048f732de67c43fde52e949fa294aa7d")
         (revision "1"))
diff --git a/gnu/packages/patches/guile-fibers-libevent-32-bit.patch b/gnu/packages/patches/guile-fibers-libevent-32-bit.patch
new file mode 100644
index 0000000000..a1cc99fdbe
--- /dev/null
+++ b/gnu/packages/patches/guile-fibers-libevent-32-bit.patch
@@ -0,0 +1,18 @@
+This fixes a bug with the libevent backend on 32-bit platforms:
+
+  https://github.com/wingo/fibers/issues/86
+
+diff --git a/extensions/libevent.c b/extensions/libevent.c
+index 4f44de9..52c9d73 100644
+--- a/extensions/libevent.c
++++ b/extensions/libevent.c
+@@ -215,7 +215,8 @@ run_event_loop (void *p)
+     microsec = -1;
+   else if (data->timeout >= 0)
+     {
+-      microsec = data->timeout / time_units_per_microsec;
++      microsec = (time_units_per_microsec == 0)
++	? 0 : data->timeout / time_units_per_microsec;
+       tv.tv_sec = 0;
+       tv.tv_usec = microsec;
+     }
-- 
2.40.1





  reply	other threads:[~2023-06-07  8:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07  8:39 [bug#63943] [PATCH 0/5] Update Fibers to 1.3.1 Ludovic Courtès
2023-06-07  8:38 ` Ludovic Courtès [this message]
2023-06-07  8:41 ` [bug#63943] [PATCH 2/5] gnu: shepherd@0.10: Use guile-fibers 1.3.1 Ludovic Courtès
2023-06-07  8:41 ` [bug#63943] [PATCH 3/5] gnu: cuirass: " Ludovic Courtès
2023-06-07  8:41 ` [bug#63943] [PATCH 4/5] gnu: guile-fibers: Remove 'guile-fibers-next' Ludovic Courtès
2023-06-07  8:41 ` [bug#63943] [PATCH 5/5] gnu: gnunet-scheme: Use guile-fibers 1.3.1 Ludovic Courtès
2023-06-07  9:40 ` [bug#63943] The Shepherd on GNU/Hurd Ludovic Courtès
2023-06-07 10:34   ` Janneke Nieuwenhuizen
2023-06-08 11:45     ` Janneke Nieuwenhuizen
2023-06-10 12:23 ` [bug#63943] [PATCH 0/5] Update Fibers to 1.3.1 Christopher Baines
2023-06-14 21:50   ` bug#63943: " Ludovic Courtès

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=3a86e6815a5d5d160e17105095546f6c3ff0d95a.1686126946.git.ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=63942@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).