[bug#39796] gnu: Add guile-websocket.
diff mbox series

Message ID 87o8tlewxf.fsf@gmail.com
State Accepted
Headers show
Series
  • [bug#39796] gnu: Add guile-websocket.
Related show

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Evan Straw Feb. 26, 2020, 5:31 a.m. UTC

Comments

Leo Famulari March 15, 2020, 6:36 p.m. UTC | #1
On Tue, Feb 25, 2020 at 09:31:56PM -0800, Evan Straw wrote:
> From ba695ba2cbf27014e1ed95da8a0620988f03fa54 Mon Sep 17 00:00:00 2001
> From: Evan Straw <evan.straw99@gmail.com>
> Date: Tue, 25 Feb 2020 12:08:46 -0800
> Subject: [PATCH] gnu: Add guile-websocket.
> 
> * gnu/packages/guile-xyz.scm (guile-websocket): New variable.

Thanks for this patch!

Overall looks good, but the hash of the source code is not correct for
me:

------
r:sha256 hash mismatch for /gnu/store/f4gz64dfsqmhbbg24ggzf9ffcr6k2znf-guile-websocket-0.1-checkout:
  expected hash: 10r8384frlyrljjdyzilrh8hzi60v9hisx4fxjs7rmg9g01cs77k
  actual hash:   1hymvsfrmq9qxr5cxnsgdz7y757yp1cpsgxmdp3f5wxxxpqgsmzx
hash mismatch for store item '/gnu/store/f4gz64dfsqmhbbg24ggzf9ffcr6k2znf-guile-websocket-0.1-checkout'
build of /gnu/store/n6kxplhzysqq4d82p1m2wa2y48lbgswb-guile-websocket-0.1-checkout.drv failed
------

My guess is that you already had something corresponding to the expected
hash in /gnu/store, and so Guix did not even try to clone the upstream
repo. Probably another commit of guile-websocket, assuming the package
did build for you.

Can you take a look and send a revised patch?
Ludovic Courtès March 24, 2020, 5:53 p.m. UTC | #2
Hello,

Leo Famulari <leo@famulari.name> skribis:

> On Tue, Feb 25, 2020 at 09:31:56PM -0800, Evan Straw wrote:
>> From ba695ba2cbf27014e1ed95da8a0620988f03fa54 Mon Sep 17 00:00:00 2001
>> From: Evan Straw <evan.straw99@gmail.com>
>> Date: Tue, 25 Feb 2020 12:08:46 -0800
>> Subject: [PATCH] gnu: Add guile-websocket.
>> 
>> * gnu/packages/guile-xyz.scm (guile-websocket): New variable.
>
> Thanks for this patch!
>
> Overall looks good, but the hash of the source code is not correct for
> me:
>
> ------
> r:sha256 hash mismatch for /gnu/store/f4gz64dfsqmhbbg24ggzf9ffcr6k2znf-guile-websocket-0.1-checkout:
>   expected hash: 10r8384frlyrljjdyzilrh8hzi60v9hisx4fxjs7rmg9g01cs77k
>   actual hash:   1hymvsfrmq9qxr5cxnsgdz7y757yp1cpsgxmdp3f5wxxxpqgsmzx
> hash mismatch for store item '/gnu/store/f4gz64dfsqmhbbg24ggzf9ffcr6k2znf-guile-websocket-0.1-checkout'
> build of /gnu/store/n6kxplhzysqq4d82p1m2wa2y48lbgswb-guile-websocket-0.1-checkout.drv failed
> ------
>
> My guess is that you already had something corresponding to the expected
> hash in /gnu/store, and so Guix did not even try to clone the upstream
> repo. Probably another commit of guile-websocket, assuming the package
> did build for you.
>
> Can you take a look and send a revised patch?

Also, it should be called “guile3.0-websocket”.

Evan, ping!  :-)

Ludo’.

Patch
diff mbox series

From ba695ba2cbf27014e1ed95da8a0620988f03fa54 Mon Sep 17 00:00:00 2001
From: Evan Straw <evan.straw99@gmail.com>
Date: Tue, 25 Feb 2020 12:08:46 -0800
Subject: [PATCH] gnu: Add guile-websocket.

* gnu/packages/guile-xyz.scm (guile-websocket): New variable.
---
 gnu/packages/guile-xyz.scm | 43 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 37a5198e4e..758ed5aa53 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -23,6 +23,7 @@ 
 ;;; Copyright © 2019 swedebugia <swedebugia@riseup.net>
 ;;; Copyright © 2019 Amar Singh <nly@disroot.org>
 ;;; Copyright © 2019 Timothy Sample <samplet@ngyro.com>
+;;; Copyright © 2020 Evan Straw <evan.straw99@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3109,3 +3110,45 @@  currently a re-implementation of the lentes library for Clojure.  Lenses
 provide composable procedures, which can be used to focus, apply functions
 over, or update a value in arbitrary data structures.")
       (license license:gpl3+))))
+
+(define-public guile-websocket
+  (let ((commit "c854e0f84a40d972cbd532bbb89c97ca0126a7cf"))
+    (package
+      (name "guile-websocket")
+      (version "0.1")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "git://dthompson.us/guile-websocket.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "10r8384frlyrljjdyzilrh8hzi60v9hisx4fxjs7rmg9g01cs77k"))))
+      (build-system gnu-build-system)
+      (arguments
+       '(#:make-flags
+         '("GUILE_AUTO_COMPILE=0")
+         #:phases
+         (modify-phases %standard-phases
+           ;; The package was developed for Guile 2.0 and has this version
+           ;; hardcoded in the configure.ac and Makefile.am files. Substitute
+           ;; 3.0 instead so it can support Guile 3.0.
+           (add-after 'unpack 'update-guile-version
+             (lambda _
+               (substitute* "configure.ac"
+                 (("2.0.9") "3.0.0"))
+               (substitute* "Makefile.am"
+                 (("2.0") "3.0"))
+               #t)))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)))
+      (inputs
+       `(("guile" ,guile-next)))
+      (synopsis "Websocket server/client for Guile")
+      (description "Guile-websocket provides an implementation of the
+WebSocket protocol as defined by RFC 6455.")
+      (home-page "https://git.dthompson.us/guile-websocket.git")
+      (license license:lgpl3+))))
-- 
2.20.1