summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-09 14:30:51 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-28 22:22:33 -0400
commit486cbf33785159b132a0e6693b061e790fb42648 (patch)
tree5a0141ef5c024bab14517200e33bc71993eb22f4 /gnu
parent34ada4a7a536b32750fb262332f8725678ac3b34 (diff)
downloadguix-486cbf33785159b132a0e6693b061e790fb42648.tar.gz
gnu: Add ruby-websocket-native.
* gnu/packages/ruby.scm (ruby-websocket-native): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/ruby.scm29
1 files changed, 29 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 57e5e3d575..943c31e4c5 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -10169,6 +10169,35 @@ checking for the right Ruby version in software.")
     (home-page "https://github.com/janlelis/ruby_version")
     (license license:expat)))
 
+(define-public ruby-websocket-native
+  (package
+    (name "ruby-websocket-native")
+    (version "1.0.0")
+    (source (origin
+              (method url-fetch)
+              (uri (rubygems-uri "websocket-native" version))
+              (sha256
+               (base32
+                "1kgvd3gyzh7hk0ddzn85jrs4csxm54qnvla95ldyn6rzgfbjchdn"))))
+    (build-system ruby-build-system)
+    (arguments
+     (list #:test-target "spec"
+           #:phases #~(modify-phases %standard-phases
+                        (add-before 'check 'disable-problematic-tests
+                          (lambda _
+                            (substitute* "spec/websocket_spec.rb"
+                              (("it \"should have mask_native defined\"" all)
+                               (string-append "x" all)))))
+                        (add-after 'build 'compile
+                          (lambda _
+                            (invoke "rake" "compile"))))))
+    (native-inputs (list ruby-rake-compiler ruby-rspec))
+    (synopsis "Native Ruby extension for the WebSocket gem")
+    (description "This package provides a native extension that can increase
+performance by about 25% compared to the pure Ruby WebSocket implementation.")
+    (home-page "https://github.com/imanel/websocket-ruby-native")
+    (license license:expat)))
+
 (define-public ruby-websocket-driver
   (package
    (name "ruby-websocket-driver")