1(use-modules
2 ((guix licenses) #:prefix license:)
3 (guix packages)
4 (guix download)
5 (guix gexp)
6 (guix git-download)
7 (guix build-system ruby)
8 (guix build-system copy)
9 (gnu packages databases)
10 (gnu packages rails)
11 (gnu packages ruby)
12 (gnu packages tls)
13 (ice-9 rdelim)
14 (ice-9 popen))
15
16(define-public ruby-guard-compat
17 (package
18 (name "ruby-guard-compat")
19 (version "1.2.1")
20 (source (origin
21 (method url-fetch)
22 (uri (rubygems-uri "guard-compat" version))
23 (sha256
24 (base32
25 "1zj6sr1k8w59mmi27rsii0v8xyy2rnsi09nqvwpgj1q10yq1mlis"))))
26 (build-system ruby-build-system)
27 (native-inputs (list ruby-rspec ruby-rubocop))
28 (synopsis "Helps creating valid Guard plugins and testing them")
29 (description "Helps creating valid Guard plugins and testing them")
30 (home-page "")
31 (license license:expat)))
32
33(define-public ruby-guard-rspec
34 (package
35 (name "ruby-guard-rspec")
36 (version "4.7.3")
37 (source (origin
38 (method url-fetch)
39 (uri (rubygems-uri "guard-rspec" version))
40 (sha256
41 (base32
42 "1jkm5xp90gm4c5s51pmf92i9hc10gslwwic6mvk72g0yplya0yx4"))))
43 (build-system ruby-build-system)
44 (propagated-inputs (list ruby-guard ruby-guard-compat ruby-rspec))
45 (synopsis
46 "Guard::RSpec automatically run your specs (much like autotest).")
47 (description
48 "Guard::RSpec automatically run your specs (much like autotest).")
49 (home-page "https://github.com/guard/guard-rspec")
50 (license license:expat)))
51
52(define-public ruby-blather
53 (package
54 (name "ruby-blather")
55 (version "03f9cda14ed3f93a80504c2538cd514d6b025d04")
56 (source
57 (origin
58 (method git-fetch)
59 ;; Download from GitHub because the rubygems version requires old
60 ;; version of bundler Rakefile.
61 (uri (git-reference
62 (url "https://github.com/adhearsion/blather")
63 (commit version)))
64 (file-name (git-file-name name version))
65 (sha256
66 (base32
67 "0r098lx4av8qywb521ilin8j4lvrb0pmcdb2l0dkljmzkb6lxa3i"))))
68 (build-system ruby-build-system)
69 (arguments
70 `(#:tests? #f #:phases
71 (modify-phases %standard-phases
72 (add-after 'extract-gemspec 'less-strict-dependencies
73 (lambda _
74 (substitute* "blather.gemspec"
75 ((".*guard-rspec.*") "\n")
76 ((".*bluecloth.*") "\n"))
77 #t)))))
78 (propagated-inputs
79 (list ruby-activesupport
80 ruby-eventmachine
81 ruby-niceogiri
82 ruby-nokogiri
83 ruby-sucker-punch))
84 (native-inputs
85 (list ruby-rspec
86 ruby-yard
87 ruby-countdownlatch
88 ruby-rb-fsevent
89 ruby-mocha))
90 (synopsis
91 "An XMPP DSL for Ruby written on top of EventMachine and Nokogiri")
92 (description
93 "An XMPP DSL for Ruby written on top of EventMachine and Nokogiri")
94 (home-page "http://adhearsion.com/blather")
95 (license license:expat)))
96
97(define-public ruby-hiredis
98 (package
99 (name "ruby-hiredis")
100 (version "0.6.3")
101 (source
102 (origin
103 (method url-fetch)
104 (uri (rubygems-uri "hiredis" version))
105 (sha256
106 (base32 "04jj8k7lxqxw24sp0jiravigdkgsyrpprxpxm71ba93x1wr2w1bz"))))
107 (build-system ruby-build-system)
108 (arguments
109 `(#:tests? #f
110 #:phases
111 (modify-phases %standard-phases
112 (add-after 'extract-gemspec 'set-cc
113 (lambda _
114 (putenv "CC=gcc"))))))
115 (native-inputs (list ruby-rake-compiler))
116 (synopsis
117 "Ruby wrapper for hiredis (protocol serialization/deserialization and blocking I/O)")
118 (description
119 "Ruby wrapper for hiredis (protocol serialization/deserialization and blocking
120I/O)")
121 (home-page "http://github.com/redis/hiredis-rb")
122 (license #f)))
123
124(define-public ruby-base64
125 (package
126 (name "ruby-base64")
127 (version "0.3.0")
128 (source (origin
129 (method url-fetch)
130 (uri (rubygems-uri "base64" version))
131 (sha256
132 (base32
133 "0yx9yn47a8lkfcjmigk79fykxvr80r4m1i35q82sxzynpbm7lcr7"))))
134 (build-system ruby-build-system)
135 (arguments
136 ;; No Rakefile
137 `(#:tests? #f))
138 (synopsis
139 "Support for encoding and decoding binary data using a Base64 representation.")
140 (description
141 "Support for encoding and decoding binary data using a Base64 representation.")
142 (home-page "https://github.com/ruby/base64")
143 (license #f)))
144
145(define-public ruby-mutex-m
146 (package
147 (name "ruby-mutex-m")
148 (version "0.3.0")
149 (source (origin
150 (method url-fetch)
151 (uri (rubygems-uri "mutex_m" version))
152 (sha256
153 (base32
154 "0l875dw0lk7b2ywa54l0wjcggs94vb7gs8khfw9li75n2sn09jyg"))))
155 (build-system ruby-build-system)
156 (arguments
157 ;; No Rakefile
158 `(#:tests? #f))
159 (synopsis "Mixin to extend objects to be handled like a Mutex.")
160 (description "Mixin to extend objects to be handled like a Mutex.")
161 (home-page "https://github.com/ruby/mutex_m")
162 (license #f)))
163
164(define-public ruby-eventmachine-openssl
165 (package
166 (inherit ruby-eventmachine)
167 (inputs `(("openssl" ,openssl)))))
168
169(define-public ruby-dhall
170 (package
171 (name "ruby-dhall")
172 (version "0.5.7")
173 (source
174 (origin
175 (method url-fetch)
176 (uri (rubygems-uri "dhall" version))
177 (sha256
178 (base32
179 "1fmd4jfd66sdyihqigc2vgdjzjy7gi513gjmwz07rds7f7x70fsq"))))
180 (build-system ruby-build-system)
181 (arguments
182 ;; No test in gem archive
183 `(#:tests? #f))
184 (propagated-inputs
185 `(("ruby-base32" ,ruby-base32)
186 ("ruby-cbor" ,ruby-cbor)
187 ("ruby-citrus" ,ruby-citrus)
188 ("ruby-lazy-object" ,ruby-lazy-object)
189 ("ruby-multihashes" ,ruby-multihashes)
190 ("ruby-promise.rb" ,ruby-promise-rb)
191 ("ruby-value-semantics" ,ruby-value-semantics)))
192 (synopsis
193 "This is a Ruby implementation of the Dhall configuration language. Dhall is a powerful, but safe and non-Turing-complete configuration language. For more information, see: https://dhall-lang.org")
194 (description
195 "This is a Ruby implementation of the Dhall configuration language. Dhall is a powerful, but safe and non-Turing-complete configuration language. For more information, see: https://dhall-lang.org")
196 (home-page
197 "https://git.sr.ht/~singpolyma/dhall-ruby")
198 (license license:gpl3)))
199
200(define-public ruby-socksify
201 (package
202 (name "ruby-socksify")
203 (version "1.8.1")
204 (source (origin
205 (method url-fetch)
206 (uri (rubygems-uri "socksify" version))
207 (sha256
208 (base32
209 "0mm8m7zfvszbf9l750c2x693p8100rrk6ckvcp6909631ir02ang"))))
210 (build-system ruby-build-system)
211 (arguments
212 ;; No rakefile
213 `(#:tests? #f))
214 (synopsis "Redirect all TCPSockets through a SOCKS5 proxy")
215 (description "Redirect all TCPSockets through a SOCKS5 proxy")
216 (home-page "https://github.com/astro/socksify-ruby")
217 (license #f)))
218
219(define-public ruby-wasabi
220 (package
221 (name "ruby-wasabi")
222 (version "3.7.0")
223 (source
224 (origin
225 (method url-fetch)
226 (uri (rubygems-uri "wasabi" version))
227 (sha256
228 (base32 "1mffdf7z1rmcs0k678vhzgnb080zcwhkk94hvj3hxjakys339ndb"))))
229 (build-system ruby-build-system)
230 (arguments
231 ;; No Rakefile
232 `(#:tests? #f))
233 (propagated-inputs (list ruby-addressable ruby-httpi ruby-nokogiri))
234 (synopsis "A simple WSDL parser")
235 (description "This package provides a simple WSDL parser.")
236 (home-page "https://github.com/savonrb/wasabi")
237 (license license:expat)))
238
239(define-public ruby-nkf
240 (package
241 (name "ruby-nkf")
242 (version "0.2.0")
243 (source
244 (origin
245 (method url-fetch)
246 (uri (rubygems-uri "nkf" version))
247 (sha256
248 (base32 "09piyp2pd74klb9wcn0zw4mb5l0k9wzwppxggxi1yi95l2ym3hgv"))))
249 (build-system ruby-build-system)
250 (native-inputs (list ruby-rake-compiler))
251 (synopsis "Ruby extension for Network Kanji Filter")
252 (description "Ruby extension for Network Kanji Filter.")
253 (home-page "https://github.com/ruby/nkf")
254 (license license:bsd-2)))
255
256(define-public ruby-httpi
257 (package
258 (name "ruby-httpi")
259 (version "2.5.0")
260 (source
261 (origin
262 (method url-fetch)
263 (uri (rubygems-uri "httpi" version))
264 (sha256
265 (base32 "0v8ah9indflp0w6jdzkzgs72xiwbam5v1c58migj0dkavkrai45h"))))
266 (build-system ruby-build-system)
267 (arguments ;; No Rakefile
268 `(#:tests? #f))
269 (propagated-inputs (list ruby-base64 ruby-mutex-m ruby-nkf ruby-rack))
270 (synopsis "Common interface for Ruby's HTTP libraries")
271 (description "Common interface for Ruby's HTTP libraries.")
272 (home-page "http://github.com/savonrb/httpi")
273 (license license:expat)))
274
275(define-public ruby-gyoku
276 (package
277 (name "ruby-gyoku")
278 (version "1.4.0")
279 (source
280 (origin
281 (method url-fetch)
282 (uri (rubygems-uri "gyoku" version))
283 (sha256
284 (base32 "1kd2q59xpm39hpvmmvyi6g3f1fr05xjbnxwkrdqz4xy7hirqi79q"))))
285 (build-system ruby-build-system)
286 (arguments
287 ;; Tests need a whole other set of dependencies
288 `(#:tests? #f))
289 (propagated-inputs (list ruby-builder ruby-rexml))
290 (synopsis "Gyoku translates Ruby Hashes to XML")
291 (description "Gyoku translates Ruby Hashes to XML.")
292 (home-page "https://github.com/savonrb/gyoku")
293 (license license:expat)))
294
295(define-public ruby-akami
296 (package
297 (name "ruby-akami")
298 (version "1.3.1")
299 (source
300 (origin
301 (method url-fetch)
302 (uri (rubygems-uri "akami" version))
303 (sha256
304 (base32 "168y57kd9wshzqqk127w7lknd8lr0b9k50wazw4c92zshq3sw2jd"))))
305 (build-system ruby-build-system)
306 (arguments
307 ;; No Rakefile
308 `(#:tests? #f))
309 (propagated-inputs (list ruby-base64 ruby-gyoku ruby-nokogiri))
310 (synopsis "Building Web Service Security")
311 (description "Building Web Service Security.")
312 (home-page "https://github.com/savonrb/akami")
313 (license license:expat)))
314
315(define-public ruby-savon
316 (package
317 (name "ruby-savon")
318 (version "2.14.0")
319 (source
320 (origin
321 (method url-fetch)
322 (uri (rubygems-uri "savon" version))
323 (sha256
324 (base32 "17fgsaprz5ihngmncl6f6qzja97rmfavmhhwhdspi7ql9hix5wyr"))))
325 (build-system ruby-build-system)
326 (native-inputs (list ruby-rspec))
327 (propagated-inputs (list ruby-akami
328 ruby-builder
329 ruby-gyoku
330 ruby-httpi
331 ruby-mail
332 ruby-nokogiri
333 ruby-nori
334 ruby-socksify
335 ruby-wasabi))
336 (synopsis "Heavy metal SOAP client")
337 (description "Heavy metal SOAP client.")
338 (home-page "http://savonrb.com")
339 (license license:expat)))
340
341(define-public ruby-em-hiredis
342 (package
343 (name "ruby-em-hiredis")
344 (version "0.3.1")
345 (source
346 (origin
347 (method url-fetch)
348 (uri (rubygems-uri "em-hiredis" version))
349 (sha256
350 (base32 "0lh276x6wngq9xy75fzzvciinmdlys93db7chy968i18japghk6z"))))
351 (build-system ruby-build-system)
352 (arguments '(#:tests? #f))
353 (propagated-inputs (list ruby-eventmachine ruby-hiredis))
354 (synopsis "Eventmachine redis client using hiredis native parser")
355 (description "Eventmachine redis client using hiredis native parser.")
356 (home-page "http://github.com/mloughran/em-hiredis")
357 (license #f)))
358
359
360(define-public ruby-amazing-print
361 (package
362 (name "ruby-amazing-print")
363 (version "1.5.0")
364 (source
365 (origin
366 (method url-fetch)
367 (uri (rubygems-uri "amazing_print" version))
368 (sha256
369 (base32 "0qik1igcs0ylw5b5dwx9npqac5r21d9fcv611h7klcspfari3x7r"))))
370 (build-system ruby-build-system)
371 (arguments '(#:tests? #f))
372 (synopsis
373 "Great Ruby debugging companion: pretty print Ruby objects to visualize their structure. Supports custom object formatting via plugins")
374 (description
375 "Great Ruby debugging companion: pretty print Ruby objects to visualize their
376structure. Supports custom object formatting via plugins.")
377 (home-page "https://github.com/amazing-print/amazing_print")
378 (license license:expat)))
379
380(define-public ruby-em-socksify
381 (package
382 (name "ruby-em-socksify")
383 (version "0.3.2")
384 (source (origin
385 (method url-fetch)
386 (uri (rubygems-uri "em-socksify" version))
387 (sha256
388 (base32
389 "0rk43ywaanfrd8180d98287xv2pxyl7llj291cwy87g1s735d5nk"))))
390 (build-system ruby-build-system)
391 (arguments
392 ;; Tests are broken
393 `(#:tests? #f))
394 (propagated-inputs (list ruby-eventmachine))
395 (synopsis "Transparent proxy support for any EventMachine protocol")
396 (description "Transparent proxy support for any EventMachine protocol")
397 (home-page "https://github.com/igrigorik/em-socksify")
398 (license license:expat)))
399
400(define-public ruby-cookiejar
401 (package
402 (name "ruby-cookiejar")
403 (version "0.3.3")
404 (source (origin
405 (method url-fetch)
406 (uri (rubygems-uri "cookiejar" version))
407 (sha256
408 (base32
409 "0q0kmbks9l3hl0wdq744hzy97ssq9dvlzywyqv9k9y1p3qc9va2a"))))
410 (build-system ruby-build-system)
411 (native-inputs
412 `(("ruby-rspec" ,ruby-rspec)
413 ("ruby-rspec-collection-matchers" ,ruby-rspec-collection-matchers)
414 ("ruby-yard" ,ruby-yard)))
415 (synopsis
416 "Allows for parsing and returning cookies in Ruby HTTP client code")
417 (description
418 "Allows for parsing and returning cookies in Ruby HTTP client code")
419 (home-page "http://alkaline-solutions.com")
420 (license #f)))
421
422(define-public ruby-em-http-request
423 (package
424 (name "ruby-em-http-request")
425 (version "b51f48fafa6443ad48c89930716c5c427561abd8")
426 (source
427 (origin
428 (method git-fetch)
429 (uri (git-reference
430 (url "https://github.com/singpolyma/em-http-request")
431 (commit version)))
432 (file-name (git-file-name name version))
433 (sha256
434 (base32
435 "1kbaghj1gqz1dpl2hikpa4xggfmavma2y442yzsgqk27gmfp9iqq"))))
436 (build-system ruby-build-system)
437 (arguments
438 ;; Tests need a whole other set of dependencies
439 `(#:tests? #f))
440 (propagated-inputs (list ruby-addressable ruby-cookiejar ruby-em-socksify
441 ruby-eventmachine ruby-http-parser.rb))
442 (synopsis "EventMachine based, async HTTP Request client")
443 (description "EventMachine based, async HTTP Request client")
444 (home-page "http://github.com/igrigorik/em-http-request")
445 (license license:expat)))
446
447(define-public ruby-promise-rb
448 (package
449 (name "ruby-promise-rb")
450 (version "0.7.4")
451 (source
452 (origin
453 (method url-fetch)
454 (uri (rubygems-uri "promise.rb" version))
455 (sha256
456 (base32 "0a819sikcqvhi8hck1y10d1nv2qkjvmmm553626fmrh51h2i089d"))))
457 (build-system ruby-build-system)
458 (arguments
459 ;; Depends on devtools, which has a crazy long dependency chain.
460 `(#:tests? #f))
461 (synopsis "Promises/A+ for Ruby")
462 (description "Promises/A+ for Ruby.")
463 (home-page "https://github.com/lgierth/promise")
464 (license license:unlicense)))
465
466(define-public ruby-em-promise-rb
467 (package
468 (name "ruby-em-promise-rb")
469 (version "0.0.5")
470 (source
471 (origin
472 (method url-fetch)
473 (uri (rubygems-uri "em_promise.rb" version))
474 (sha256
475 (base32 "00rkmacyf6i2gq0giaxzwr24ygrwwzndrq7kkbpqcq9glk01w692"))))
476 (build-system ruby-build-system)
477 (arguments
478 ;; No Rakefile
479 `(#:tests? #f))
480 (propagated-inputs (list ruby-eventmachine ruby-promise-rb))
481 (synopsis "A subclass of promise.rb Promise for EventMachine.")
482 (description
483 "This package provides a subclass of promise.rb Promise for @code{EventMachine}.")
484 (home-page "https://git.singpolyma.net/em_promise.rb")
485 (license license:agpl3)))
486(define-public ruby-ougai
487 (package
488 (name "ruby-ougai")
489 (version "2.0.0")
490 (source
491 (origin
492 (method url-fetch)
493 (uri (rubygems-uri "ougai" version))
494 (sha256
495 (base32 "0zmngsm3lrliscry7ljw7x5gnf3m4cn4kdgnxccaidhwj0mm539f"))))
496 (build-system ruby-build-system)
497 ;; Tests broken
498 (arguments
499 `(#:tests? #f))
500 (propagated-inputs (list ruby-oj))
501 (synopsis
502 " A structured logging system is capable of handling a message, custom data or an exception easily.
503 It has JSON formatters compatible with Bunyan or pino for Node.js and human readable formatter with Amazing Print for console.
504")
505 (description
506 "This package provides a structured logging system is capable of handling a
507message, custom data or an exception easily. It has JSON formatters compatible
508with Bunyan or pino for Node.js and human readable formatter with Amazing Print
509for console.")
510 (home-page "https://github.com/tilfin/ougai")
511 (license license:expat)))
512
513(define-public ruby-rspec-collection-matchers
514 (package
515 (name "ruby-rspec-collection-matchers")
516 (version "1.2.0")
517 (source (origin
518 (method url-fetch)
519 (uri (rubygems-uri "rspec-collection_matchers" version))
520 (sha256
521 (base32
522 "1864xlxl7mi6mvjyp85a0gc10cyvpf6bj8lc86sf8737wlzn12ks"))))
523 (build-system ruby-build-system)
524 (arguments
525 ;; No rakefile
526 `(#:tests? #f))
527 (propagated-inputs (list ruby-rspec-expectations))
528 (synopsis
529 "Collection cardinality matchers, extracted from rspec-expectations")
530 (description
531 "Collection cardinality matchers, extracted from rspec-expectations")
532 (home-page "https://github.com/rspec/rspec-collection_matchers")
533 (license license:expat)))
534
535;;;;
536
537(define %source-dir (dirname (current-filename)))
538(define %git-dir (string-append %source-dir "/.git"))
539
540; Bake a template by eval'ing the leaves
541(define-public (bake tmpl)
542 (list
543 (car tmpl)
544 (cons (caadr tmpl) (map
545 (lambda (x) (list (car x) (eval (cadr x) (current-module))))
546 (cdadr tmpl)))))
547
548; double-escaped template of the sgx-endstream sexp
549(define-public sgx-endstream-template
550 '((package-input-rewriting `((,ruby-eventmachine . ,ruby-eventmachine-openssl)))
551 (package
552 (name "sgx-endstream")
553 (version (read-line (open-pipe* OPEN_READ "git" "--git-dir" %git-dir "describe" "--always" "--dirty")))
554 (source
555 `(origin
556 (method git-fetch)
557 (uri (git-reference
558 (recursive? #t)
559 (url "https://git.singpolyma.net/sgx-endstream")
560 (commit ,(read-line (open-pipe* OPEN_READ "git" "--git-dir" %git-dir "rev-parse" "HEAD")))))
561 (file-name (git-file-name name version))
562 (sha256
563 (base32
564 ,(read-line (open-pipe* OPEN_READ "guix" "hash" "-rx" %source-dir))))))
565 (build-system 'copy-build-system)
566 (arguments
567 ''(#:install-plan '(("." "share/sgx-endstream"))
568 #:phases
569 (modify-phases %standard-phases
570 (add-after 'install 'wrap
571 (lambda* (#:key outputs #:allow-other-keys)
572 (use-modules (ice-9 ftw))
573 (let* ((out (assoc-ref outputs "out"))
574 (appdir (string-append out "/share/sgx-endstream/"))
575 (bindir (string-append out "/bin/")))
576 (mkdir-p bindir)
577 (let ((binstub (string-append bindir "sgx_endstream")))
578 (call-with-output-file binstub
579 (lambda (port)
580 (format port
581 "#!~a~%ENV['GEM_PATH'] = ['~a', ENV['GEM_PATH']].compact.join(':')~%Gem.clear_paths~%load '~a~a'~%"
582 (which "ruby")
583 (getenv "GEM_PATH")
584 appdir
585 "sgx_endstream.rb")))
586 (chmod binstub #o755)))
587 #t)))))
588 (propagated-inputs
589 '(list
590 ruby
591 ruby-amazing-print
592 ruby-blather
593 ruby-dhall
594 ruby-em-hiredis
595 ruby-em-http-request
596 ruby-em-promise-rb
597 ruby-eventmachine
598 ruby-ougai
599 ruby-savon
600 ruby-sentry))
601 (synopsis
602 "Endstream gateway component")
603 (description
604 "")
605 (home-page
606 "https://git.singpolyma.net/sgx-endstream")
607 (license 'license:agpl3))))
608
609; Baked version of sgx-endstream-template with leaves eval'd
610(define-public sgx-endstream-baked
611 (bake sgx-endstream-template))
612
613; Build clean from git the version from a local clone
614; To build whatever is sitting in local use:
615; guix build --with-source=$PWD -f guix.scm
616(eval sgx-endstream-baked (current-module))