guix_mirror_bot pushed a commit to branch go-team
in repository guix.

commit 0a91875c5e18c12f78006fcae9d574d1500519f7
Author: Maxim Cournoyer <maxim.courno...@gmail.com>
AuthorDate: Mon Jun 2 08:28:01 2025 +0900

    gnu: go-github-com-jbenet-go-context: Apply patch to fix crash.
    
    * 
gnu/packages/patches/go-github-com-jbenet-go-context-fix-import-error.patch:
    New file.
    * gnu/local.mk (dist_patch_DATA): Register it.
    * gnu/packages/golang-xyz.scm (go-github-com-jbenet-go-context)
    [source]: Apply it.
    [propagated-inputs]: Delete field.
    
    Change-Id: Id63ff5a78788eb85055e89f352f6b68ada4c0c0a
    Signed-off-by: Sharlatan Hellseher <sharlata...@gmail.com>
---
 gnu/local.mk                                       |   1 +
 gnu/packages/golang-xyz.scm                        |   9 +-
 ...ub-com-jbenet-go-context-fix-import-error.patch | 137 +++++++++++++++++++++
 3 files changed, 142 insertions(+), 5 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 68a4b9eaa2..a4c4563071 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1525,6 +1525,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/go-fix-script-tests.patch                       \
   %D%/packages/patches/go-gopkg-in-yaml-v3-32bit.patch         \
   %D%/packages/patches/go-github-com-golang-snappy-32bit-test.patch \
+  %D%/packages/patches/go-github-com-jbenet-go-context-fix-import-error.patch  
\
   %D%/packages/patches/go-github-com-skip2-go-qrcode-fix-tests.patch \
   %D%/packages/patches/go-github-com-warpfork-go-wish-fix-tests.patch \
   %D%/packages/patches/go-github-com-wraparound-wrap-free-fonts.patch \
diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm
index e4c735c9cd..7d3c88f46b 100644
--- a/gnu/packages/golang-xyz.scm
+++ b/gnu/packages/golang-xyz.scm
@@ -9797,13 +9797,12 @@ that might only rarely be reached.")
              (commit (go-version->git-ref version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0q91f5549n81w3z5927n4a1mdh220bdmgl42zi3h992dcc4ls0sl"))))
+        (base32 "0q91f5549n81w3z5927n4a1mdh220bdmgl42zi3h992dcc4ls0sl"))
+       (patches (search-patches
+                 "go-github-com-jbenet-go-context-fix-import-error.patch"))))
     (build-system go-build-system)
     (arguments
-     (list
-      #:import-path "github.com/jbenet/go-context"))
-    (propagated-inputs
-     (list go-golang-org-x-net))
+     (list #:import-path "github.com/jbenet/go-context"))
     (home-page "https://github.com/jbenet/go-context/";)
     (synopsis "@code{jbenet's} context extensions")
     (description
diff --git 
a/gnu/packages/patches/go-github-com-jbenet-go-context-fix-import-error.patch 
b/gnu/packages/patches/go-github-com-jbenet-go-context-fix-import-error.patch
new file mode 100644
index 0000000000..26a3db2fab
--- /dev/null
+++ 
b/gnu/packages/patches/go-github-com-jbenet-go-context-fix-import-error.patch
@@ -0,0 +1,137 @@
+Retrieved from
+<https://patch-diff.githubusercontent.com/raw/jbenet/go-context/pull/3.patch>.
+
+From a55d3832cfe7bb061123c7e90ed3c6195d8ce890 Mon Sep 17 00:00:00 2001
+From: Prudhvi Surapaneni <p...@supr.io>
+Date: Wed, 13 Mar 2019 16:29:55 -0500
+Subject: [PATCH] No-longer necessary to import context package
+
+---
+ dag/dagctx.go        |  3 +--
+ dag/dagctx_test.go   |  3 +--
+ frac/fracctx.go      |  3 +--
+ frac/fracctx_test.go | 12 +++++++-----
+ io/ctxio.go          |  3 +--
+ io/ctxio_test.go     |  3 +--
+ 6 files changed, 12 insertions(+), 15 deletions(-)
+
+diff --git a/dag/dagctx.go b/dag/dagctx.go
+index 521390b..17a9090 100644
+--- a/dag/dagctx.go
++++ b/dag/dagctx.go
+@@ -1,10 +1,9 @@
+ package ctxext
+ 
+ import (
++      "context"
+       "sync"
+       "time"
+-
+-      context "golang.org/x/net/context"
+ )
+ 
+ // WithParents returns a Context that listens to all given
+diff --git a/dag/dagctx_test.go b/dag/dagctx_test.go
+index 30a27e2..8692f54 100644
+--- a/dag/dagctx_test.go
++++ b/dag/dagctx_test.go
+@@ -1,11 +1,10 @@
+ package ctxext
+ 
+ import (
++      "context"
+       "math/rand"
+       "testing"
+       "time"
+-
+-      context "golang.org/x/net/context"
+ )
+ 
+ func TestWithParentsSingle(t *testing.T) {
+diff --git a/frac/fracctx.go b/frac/fracctx.go
+index 60938c0..d1ee94a 100644
+--- a/frac/fracctx.go
++++ b/frac/fracctx.go
+@@ -2,9 +2,8 @@
+ package ctxext
+ 
+ import (
++      "context"
+       "time"
+-
+-      context "golang.org/x/net/context"
+ )
+ 
+ // WithDeadlineFraction returns a Context with a fraction of the
+diff --git a/frac/fracctx_test.go b/frac/fracctx_test.go
+index c6dd10d..8de81be 100644
+--- a/frac/fracctx_test.go
++++ b/frac/fracctx_test.go
+@@ -1,11 +1,10 @@
+ package ctxext
+ 
+ import (
++      "context"
+       "os"
+       "testing"
+       "time"
+-
+-      context "golang.org/x/net/context"
+ )
+ 
+ // this test is on the context tool itself, not our stuff. it's for sanity on 
ours.
+@@ -14,7 +13,8 @@ func TestDeadline(t *testing.T) {
+               t.Skip("timeouts don't work reliably on travis")
+       }
+ 
+-      ctx, _ := context.WithTimeout(context.Background(), 5*time.Millisecond)
++      ctx, cncl := context.WithTimeout(context.Background(), 
5*time.Millisecond)
++      defer cncl()
+ 
+       select {
+       case <-ctx.Done():
+@@ -46,8 +46,10 @@ func TestDeadlineFractionHalf(t *testing.T) {
+               t.Skip("timeouts don't work reliably on travis")
+       }
+ 
+-      ctx1, _ := context.WithTimeout(context.Background(), 
10*time.Millisecond)
+-      ctx2, _ := WithDeadlineFraction(ctx1, 0.5)
++      ctx1, cncl1 := context.WithTimeout(context.Background(), 
10*time.Millisecond)
++      defer cncl1()
++      ctx2, cncl2 := WithDeadlineFraction(ctx1, 0.5)
++      defer cncl2()
+ 
+       select {
+       case <-ctx1.Done():
+diff --git a/io/ctxio.go b/io/ctxio.go
+index b4f2454..b27689b 100644
+--- a/io/ctxio.go
++++ b/io/ctxio.go
+@@ -11,9 +11,8 @@
+ package ctxio
+ 
+ import (
++      "context"
+       "io"
+-
+-      context "golang.org/x/net/context"
+ )
+ 
+ type ioret struct {
+diff --git a/io/ctxio_test.go b/io/ctxio_test.go
+index 884e090..bc4a0e9 100644
+--- a/io/ctxio_test.go
++++ b/io/ctxio_test.go
+@@ -2,11 +2,10 @@ package ctxio
+ 
+ import (
+       "bytes"
++      "context"
+       "io"
+       "testing"
+       "time"
+-
+-      context "golang.org/x/net/context"
+ )
+ 
+ func TestReader(t *testing.T) {

Reply via email to