jmp-pay.scm

  1(define-module (jmp-pay)
  2  #:use-module ((guix licenses) #:prefix license:)
  3  #:use-module (guix packages)
  4  #:use-module (guix download)
  5  #:use-module (guix git-download)
  6  #:use-module (guix build-system ruby)
  7  #:use-module (guix build-system copy)
  8  #:use-module (gnu packages ruby)
  9  #:use-module (gnu packages databases)
 10  #:use-module (ice-9 rdelim)
 11  #:use-module (ice-9 popen)
 12)
 13
 14(define-public ruby-sucker-punch
 15  (package
 16    (name "ruby-sucker-punch")
 17    (version "2.0.0")
 18    (source
 19      (origin
 20        (method url-fetch)
 21        (uri (rubygems-uri "sucker_punch" version))
 22        (sha256
 23          (base32
 24            "008vv7gpv2nm5n1njzvabd3aagbywc240y23vifvq6plir53ybay"))))
 25    (build-system ruby-build-system)
 26    (arguments
 27     `(#:phases
 28       (modify-phases %standard-phases
 29         (add-after 'extract-gemspec 'less-strict-dependencies
 30           (lambda _
 31             (substitute* "sucker_punch.gemspec"
 32               (("1.0.0") "1.0"))
 33             #t)))))
 34    (propagated-inputs
 35      `(("ruby-concurrent" ,ruby-concurrent)))
 36    (native-inputs
 37     `(("ruby-pry" ,ruby-pry)))
 38    (synopsis
 39      "Asynchronous processing library for Ruby")
 40    (description
 41      "Asynchronous processing library for Ruby")
 42    (home-page
 43      "https://github.com/brandonhilkert/sucker_punch")
 44    (license license:expat)))
 45
 46(define-public ruby-niceogiri
 47  (package
 48    (name "ruby-niceogiri")
 49    (version "1.1.2")
 50    (source
 51      (origin
 52        (method url-fetch)
 53        (uri (rubygems-uri "niceogiri" version))
 54        (sha256
 55          (base32
 56            "1ha93211bc9cvh23s9w89zz7rq8irpf64ccd9arvg8v1sxg2798a"))))
 57    (build-system ruby-build-system)
 58    (arguments
 59     `(#:test-target "spec"
 60       #:phases
 61       (modify-phases %standard-phases
 62         (add-after 'extract-gemspec 'less-strict-dependencies
 63           (lambda _
 64             (substitute* "niceogiri.gemspec"
 65               (("2.7") "3.8")
 66               ((".*guard-rspec.*") "\n"))
 67             #t)))))
 68    (propagated-inputs
 69      `(("ruby-nokogiri" ,ruby-nokogiri)))
 70    (native-inputs
 71     `(("ruby-rspec" ,ruby-rspec)
 72       ("ruby-yard" ,ruby-yard)))
 73    (synopsis "Make dealing with XML less painful")
 74    (description
 75      "Make dealing with XML less painful")
 76    (home-page
 77      "https://github.com/benlangfeld/Niceogiri")
 78    (license license:expat)))
 79
 80(define-public ruby-countdownlatch
 81  (package
 82    (name "ruby-countdownlatch")
 83    (version "1.0.0")
 84    (source
 85      (origin
 86        (method url-fetch)
 87        (uri (rubygems-uri "countdownlatch" version))
 88        (sha256
 89          (base32
 90            "1v6pbay6z07fp7yvnba1hmyacbicvmjndd8rn2h1b5rmpcb5s0j3"))))
 91    (build-system ruby-build-system)
 92    (synopsis
 93      "A synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes")
 94    (description
 95      "This package provides a synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes")
 96    (home-page
 97      "https://github.com/benlangfeld/countdownlatch")
 98    (license license:expat)))
 99
100(define-public ruby-blather
101  (package
102    (name "ruby-blather")
103    (version "2.0.0")
104    (source
105      (origin
106        (method url-fetch)
107        (uri (rubygems-uri "blather" version))
108        (sha256
109          (base32
110            "05ry2x835fj4pzk61282pcz86n018cr39zbgwbi213md74i90s7c"))))
111    (build-system ruby-build-system)
112    (arguments
113     `(#:phases
114       (modify-phases %standard-phases
115         (add-after 'extract-gemspec 'less-strict-dependencies
116           (lambda _
117             (substitute* "blather.gemspec"
118               ((".*guard-rspec.*") "\n")
119                ((".*bluecloth.*") "\n"))
120             #t)))))
121    (propagated-inputs
122      `(("ruby-activesupport" ,ruby-activesupport)
123        ("ruby-eventmachine" ,ruby-eventmachine)
124        ("ruby-niceogiri" ,ruby-niceogiri)
125        ("ruby-nokogiri" ,ruby-nokogiri)
126        ("ruby-sucker-punch" ,ruby-sucker-punch)))
127    (native-inputs
128     `(("ruby-rspec" ,ruby-rspec)
129       ("ruby-yard" ,ruby-yard)
130       ("ruby-countdownlatch" ,ruby-countdownlatch)
131       ("ruby-rb-fsevent" ,ruby-rb-fsevent)
132       ("ruby-mocha" ,ruby-mocha)))
133    (synopsis
134      "An XMPP DSL for Ruby written on top of EventMachine and Nokogiri")
135    (description
136      "An XMPP DSL for Ruby written on top of EventMachine and Nokogiri")
137    (home-page "http://adhearsion.com/blather")
138    (license license:expat)))
139
140(define-public ruby-braintree
141  (package
142    (name "ruby-braintree")
143    (version "4.4.0")
144    (source
145     (origin
146       (method git-fetch)
147       ;; Download from GitHub because the rubygems version does not contain
148       ;; Rakefile.
149       (uri (git-reference
150             (url "https://github.com/braintree/braintree_ruby")
151             (commit version)))
152       (file-name (git-file-name name version))
153       (sha256
154        (base32
155         "0dzf26yhmlf65464nranvqg5rzhrc8gfaqbg3p4ld3abz8ccnw08"))))
156    (build-system ruby-build-system)
157    (arguments
158     `(#:test-target "test:unit"
159       #:phases
160       (modify-phases %standard-phases
161         (add-after 'unpack 'less-strict-dependencies
162           (lambda _
163             (substitute* "Gemfile"
164               (("gem \"libxml-ruby\", \"3.2.0\"") "gem \"libxml-ruby\", \"~> 3.0.0\"")
165               (("gem \"rspec\", \"3.9.0\"") "gem \"rspec\", \"~> 3.8.0\"")
166               (("gem \"rubocop\", \"~>1.12.0\"") "gem \"rubocop\", \"~> 1.10.0\""))
167             #t)))))
168    (propagated-inputs
169      `(("ruby-builder" ,ruby-builder)
170        ("ruby-rexml" ,ruby-rexml)))
171    (native-inputs
172     `(("ruby-rspec" ,ruby-rspec)
173       ("ruby-libxml" ,ruby-libxml)
174       ("ruby-pry" ,ruby-pry)
175       ("ruby-rake" ,ruby-rake)
176       ("ruby-webrick" ,ruby-webrick)
177       ("ruby-rubocop" ,ruby-rubocop)))
178    (synopsis
179      "Resources and tools for developers to integrate Braintree's global payments platform.")
180    (description
181      "Resources and tools for developers to integrate Braintree's global payments platform.")
182    (home-page "https://www.braintreepayments.com/")
183    (license license:expat)))
184
185(define-public ruby-value-semantics
186  (package
187    (name "ruby-value-semantics")
188    (version "3.6.1")
189    (source
190      (origin
191        (method url-fetch)
192        (uri (rubygems-uri "value_semantics" version))
193        (sha256
194          (base32
195            "1vdwai8wf6r1fkvdpyz1vzxm89q7ghjvb3pqpg2kvwibwzd99dnx"))))
196    (build-system ruby-build-system)
197    (arguments
198     `(#:phases
199       (modify-phases %standard-phases
200         (replace 'check
201           (lambda _
202             (invoke "rspec")
203             #t)))))
204    (native-inputs
205     `(("ruby-rspec" ,ruby-rspec)))
206    (synopsis
207      "
208    Generates modules that provide conventional value semantics for a given set of attributes.
209    The behaviour is similar to an immutable `Struct` class,
210    plus extensible, lightweight validation and coercion.
211  ")
212    (description
213      "
214    Generates modules that provide conventional value semantics for a given set of attributes.
215    The behaviour is similar to an immutable `Struct` class,
216    plus extensible, lightweight validation and coercion.
217  ")
218    (home-page
219      "https://github.com/tomdalling/value_semantics")
220    (license license:expat)))
221
222(define-public ruby-promise.rb
223  (package
224    (name "ruby-promise.rb")
225    (version "0.7.4")
226    (source
227      (origin
228        (method url-fetch)
229        (uri (rubygems-uri "promise.rb" version))
230        (sha256
231          (base32
232            "0a819sikcqvhi8hck1y10d1nv2qkjvmmm553626fmrh51h2i089d"))))
233    (build-system ruby-build-system)
234    (arguments
235     `(#:test-target "spec"
236       #:phases
237       (modify-phases %standard-phases
238         (add-after 'extract-gemspec 'less-strict-dependencies
239           (lambda _
240             (substitute* "Rakefile"
241               (("if Gem.ruby_version.*") "if false\n"))
242             (substitute* "spec/spec_helper.rb"
243               ((".*devtools/spec_helper.*") "\n"))
244             #t)))))
245    (native-inputs
246     `(("ruby-rspec" ,ruby-rspec)
247       ("ruby-rspec-its" ,ruby-rspec-its)
248       ("ruby-awesome-print" ,ruby-awesome-print)
249       ("ruby-fuubar" ,ruby-fuubar)))
250    (synopsis "Promises/A+ for Ruby")
251    (description "Promises/A+ for Ruby")
252    (home-page "https://github.com/lgierth/promise")
253    (license license:unlicense)))
254
255(define-public ruby-multicodecs
256  (package
257    (name "ruby-multicodecs")
258    (version "0.2.1")
259    (source
260      (origin
261        (method url-fetch)
262        (uri (rubygems-uri "multicodecs" version))
263        (sha256
264          (base32
265            "0drq267di57l9zqw6zvqqimilz42rbc8z7392dwkk8wslq30s7v8"))))
266    (build-system ruby-build-system)
267    (synopsis
268      "This gem provides a PORO of the multicodec table for use with other
269    multiformat ruby gems.")
270    (description
271      "This gem provides a PORO of the multicodec table for use with other
272    multiformat ruby gems.")
273    (home-page
274      "https://github.com/SleeplessByte/ruby-multicodec")
275    (license license:expat)))
276
277(define-public ruby-multihashes
278  (package
279    (name "ruby-multihashes")
280    (version "0.2.0")
281    (source
282      (origin
283        (method url-fetch)
284        (uri (rubygems-uri "multihashes" version))
285        (sha256
286          (base32
287            "17wiyy3fiv8rpgdv9ca01yncsmaaf8yg15bg18wc7m9frss1vgqg"))))
288    (build-system ruby-build-system)
289    (propagated-inputs
290      `(("ruby-multicodecs" ,ruby-multicodecs)))
291    (synopsis
292      "A simple, low-level multihash (https://github.com/jbenet/multihash) implementation for ruby.")
293    (description
294      "This package provides a simple, low-level multihash (https://github.com/jbenet/multihash) implementation for ruby.")
295    (home-page
296      "https://github.com/neocities/ruby-multihashes")
297    (license license:expat)))
298
299(define-public ruby-lazy-object
300  (package
301    (name "ruby-lazy-object")
302    (version "0.0.3")
303    (source
304      (origin
305        (method url-fetch)
306        (uri (rubygems-uri "lazy_object" version))
307        (sha256
308          (base32
309            "08px15lahc28ik9smvw1hgamf792gd6gq0s4k94yq1h7jq25wjn8"))))
310    (build-system ruby-build-system)
311    (arguments
312     '(#:test-target "spec"))
313    (synopsis
314      "It's an object wrapper that forwards all calls to the reference object. This object is not created until the first method dispatch.")
315    (description
316      "It's an object wrapper that forwards all calls to the reference object.  This object is not created until the first method dispatch.")
317    (home-page "")
318    (license license:expat)))
319
320(define-public ruby-citrus
321  (package
322    (name "ruby-citrus")
323    (version "3.0.2")
324    (source
325     (origin
326       (method git-fetch)
327       ;; Download from GitHub because the rubygems version does not contain
328       ;; files needed for tests
329       (uri (git-reference
330             (url "https://github.com/mjackson/citrus")
331             (commit (string-append "v" version))))
332       (file-name (git-file-name name version))
333       (sha256
334        (base32
335         "197wrgqrddgm1xs3yvjvd8vkvil4h4mdrcp16jmd4b57rxrrr769"))))
336    (build-system ruby-build-system)
337    (synopsis "Parsing Expressions for Ruby")
338    (description "Parsing Expressions for Ruby")
339    (home-page "http://mjackson.github.io/citrus")
340    (license license:expat)))
341
342(define-public ruby-cbor
343  (package
344    (name "ruby-cbor")
345    (version "0.5.9.6")
346    (source
347      (origin
348        (method url-fetch)
349        (uri (rubygems-uri "cbor" version))
350        (sha256
351          (base32
352            "0511idr8xps9625nh3kxr68sdy6l3xy2kcz7r57g47fxb1v18jj3"))))
353    (build-system ruby-build-system)
354    (arguments
355     '(#:test-target "spec"))
356    (native-inputs
357     `(("ruby-rspec" ,ruby-rspec)
358       ("ruby-rake-compiler" ,ruby-rake-compiler)
359       ("ruby-yard" ,ruby-yard)))
360    (synopsis
361      "CBOR is a library for the CBOR binary object representation format, based on Sadayuki Furuhashi's MessagePack library.")
362    (description
363      "CBOR is a library for the CBOR binary object representation format, based on Sadayuki Furuhashi's MessagePack library.")
364    (home-page "http://cbor.io/")
365    (license license:asl2.0)))
366
367(define-public ruby-gem-release
368  (package
369    (name "ruby-gem-release")
370    (version "2.2.2")
371    (source
372      (origin
373        (method url-fetch)
374        (uri (rubygems-uri "gem-release" version))
375        (sha256
376          (base32
377            "108rrfaiayi14zrqbb6z0cbwcxh8n15am5ry2a86v7c8c3niysq9"))))
378    (build-system ruby-build-system)
379    (arguments
380     ;; No rakefile
381     `(#:tests? #f))
382    (synopsis
383      "Release your ruby gems with ease. (What a bold statement for such a tiny plugin ...)")
384    (description
385      "Release your ruby gems with ease. (What a bold statement for such a tiny plugin ...)")
386    (home-page
387    "https://github.com/svenfuchs/gem-release")
388    (license license:expat)))
389
390(define-public ruby-base32
391  (package
392    (name "ruby-base32")
393    (version "0.3.4")
394    (source
395      (origin
396        (method url-fetch)
397        (uri (rubygems-uri "base32" version))
398        (sha256
399          (base32
400            "1fjs0l3c5g9qxwp43kcnhc45slx29yjb6m6jxbb2x1krgjmi166b"))))
401    (build-system ruby-build-system)
402    (native-inputs
403     `(("ruby-gem-release" ,ruby-gem-release)))
404    (synopsis
405      "Ruby extension for base32 encoding and decoding")
406    (description
407      "Ruby extension for base32 encoding and decoding")
408    (home-page "https://github.com/stesla/base32")
409    (license license:expat)))
410
411(define-public ruby-dhall
412  (package
413    (name "ruby-dhall")
414    (version "0.5.2")
415    (source
416      (origin
417        (method url-fetch)
418        (uri (rubygems-uri "dhall" version))
419        (sha256
420          (base32
421            "09wcq8xc1ynld04r2f332bx8cn7rjc4afaq8hm1dr2fc35jlpn6m"))))
422    (build-system ruby-build-system)
423    (arguments
424     ;; No test in gem archive
425     `(#:tests? #f))
426    (propagated-inputs
427      `(("ruby-base32" ,ruby-base32)
428        ("ruby-cbor" ,ruby-cbor)
429        ("ruby-citrus" ,ruby-citrus)
430        ("ruby-lazy-object" ,ruby-lazy-object)
431        ("ruby-multihashes" ,ruby-multihashes)
432        ("ruby-promise.rb" ,ruby-promise.rb)
433        ("ruby-value-semantics" ,ruby-value-semantics)))
434    (synopsis
435      "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")
436    (description
437      "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")
438    (home-page
439      "https://git.sr.ht/~singpolyma/dhall-ruby")
440    (license license:gpl3)))
441
442(define-public ruby-money
443  (package
444    (name "ruby-money")
445    (version "6.16.0")
446    (source
447      (origin
448        (method url-fetch)
449        (uri (rubygems-uri "money" version))
450        (sha256
451          (base32
452            "0jkmsj5ymadik7bvl670bqwmvhsdyv7hjr8gq9z293hq35gnyiyg"))))
453    (build-system ruby-build-system)
454    (arguments
455     ;; No rakefile
456     `(#:tests? #f))
457    (propagated-inputs `(("ruby-i18n" ,ruby-i18n)))
458    (synopsis
459      "A Ruby Library for dealing with money and currency conversion.")
460    (description
461      "This package provides a Ruby Library for dealing with money and currency conversion.")
462    (home-page "https://rubymoney.github.io/money")
463    (license license:expat)))
464
465(define-public ruby-monetize
466  (package
467    (name "ruby-monetize")
468    (version "1.11.0")
469    (source
470      (origin
471        (method url-fetch)
472        (uri (rubygems-uri "monetize" version))
473        (sha256
474          (base32
475            "0cna2myxdbwfq0gn6k2hgrh368dq7wld3jklm96443ysykd0difn"))))
476    (build-system ruby-build-system)
477    (arguments
478     '(#:test-target "spec"))
479    (native-inputs
480     `(("ruby-rspec" ,ruby-rspec)))
481    (propagated-inputs `(("ruby-money" ,ruby-money)))
482    (synopsis
483      "A library for converting various objects into `Money` objects.")
484    (description
485      "This package provides a library for converting various objects into `Money` objects.")
486    (home-page
487      "https://github.com/RubyMoney/monetize")
488    (license license:expat)))
489
490(define-public ruby-money-open-exchange-rates
491  (package
492    (name "ruby-money-open-exchange-rates")
493    (version "1.4.0")
494    (source
495     (origin
496       (method git-fetch)
497       ;; Download from GitHub because the rubygems version does not contain
498       ;; Rakefile.
499       (uri (git-reference
500             (url "https://github.com/spk/money-open-exchange-rates")
501             (commit (string-append "v" version))))
502       (file-name (git-file-name name version))
503       (sha256
504        (base32
505         "11xwqli8snr19k48yh8h77sal5vxd4snzq9gxg08v61f0574m3gw"))))
506    (build-system ruby-build-system)
507    (propagated-inputs `(("ruby-money" ,ruby-money)))
508    (native-inputs
509     `(("ruby-minitest" ,ruby-minitest)
510       ("ruby-mocha" ,ruby-mocha)
511       ("ruby-timecop" ,ruby-timecop)
512       ("ruby-webmock" ,ruby-webmock)
513       ("ruby-monetize" ,ruby-monetize)
514       ("ruby-rake" ,ruby-rake)
515       ("ruby-rubocop" ,ruby-rubocop)))
516    (synopsis
517      "A gem that calculates the exchange rate using published rates from open-exchange-rates. Compatible with the money gem.")
518    (description
519      "This package provides a gem that calculates the exchange rate using published rates from open-exchange-rates.  Compatible with the money gem.")
520    (home-page
521      "http://github.com/spk/money-open-exchange-rates")
522    (license license:expat)))
523
524(define-public ruby-roda
525  (package
526    (name "ruby-roda")
527    (version "3.47.0")
528    (source
529      (origin
530        (method url-fetch)
531        (uri (rubygems-uri "roda" version))
532        (sha256
533          (base32
534            "1g3zs4bk8hqii15ci1hsykcsya88vr2qv63gp1qbcx4bm14l8lkl"))))
535    (build-system ruby-build-system)
536    (arguments
537     ;; No rakefile
538     `(#:tests? #f))
539    (propagated-inputs `(("ruby-rack" ,ruby-rack)))
540    (synopsis "Routing tree web toolkit")
541    (description "Routing tree web toolkit")
542    (home-page "http://roda.jeremyevans.net")
543    (license license:expat)))
544
545(define-public ruby-nori
546  (package
547    (name "ruby-nori")
548    (version "2.6.0")
549    (source
550      (origin
551        (method url-fetch)
552        (uri (rubygems-uri "nori" version))
553        (sha256
554          (base32
555            "066wc774a2zp4vrq3k7k8p0fhv30ymqmxma1jj7yg5735zls8agn"))))
556    (build-system ruby-build-system)
557    (arguments
558     ;; Tests require too old version of rspec
559     `(#:tests? #f))
560    (native-inputs
561     `(("ruby-rspec" ,ruby-rspec)
562       ("ruby-rake" ,ruby-rake)
563       ("ruby-nokogiri" ,ruby-nokogiri)))
564    (synopsis "XML to Hash translator")
565    (description "XML to Hash translator")
566    (home-page "https://github.com/savonrb/nori")
567    (license license:expat)))
568
569(define-public ruby-faraday-middleware
570  (package
571    (name "ruby-faraday-middleware")
572    (version "1.1.0")
573    (source
574      (origin
575        (method url-fetch)
576        (uri (rubygems-uri "faraday_middleware" version))
577        (sha256
578          (base32
579            "0kgcphf7n74l3wlcvxafcp6a4l18b1bf4qslvz5dqj6v3gc8h8j4"))))
580    (build-system ruby-build-system)
581    (arguments
582     ;; No rakefile
583     `(#:tests? #f))
584    (propagated-inputs
585      `(("ruby-faraday" ,ruby-faraday)))
586    (synopsis "Various middleware for Faraday")
587    (description "Various middleware for Faraday")
588    (home-page
589      "https://github.com/lostisland/faraday_middleware")
590    (license license:expat)))
591
592(define-public ruby-bandwidth-iris
593  (package
594    (name "ruby-bandwidth-iris")
595    (version "4.0.0")
596    (source
597      (origin
598        (method url-fetch)
599        (uri (rubygems-uri "ruby-bandwidth-iris" version))
600        (sha256
601          (base32
602            "16bbx6y0ni3jl190ddr6xfbi2rbcikqfm2ghzr53445fpk6g12zc"))))
603    (build-system ruby-build-system)
604    (arguments
605     ; Tests don't require helper for some reason, so all fail...
606     '(#:tests? #f))
607    (propagated-inputs
608      `(("ruby-activesupport" ,ruby-activesupport)
609        ("ruby-builder" ,ruby-builder)
610        ("ruby-faraday" ,ruby-faraday)
611        ("ruby-faraday-middleware"
612         ,ruby-faraday-middleware)
613        ("ruby-nori" ,ruby-nori)))
614    (native-inputs
615     `(("ruby-rspec" ,ruby-rspec)
616       ("ruby-yard" ,ruby-yard)))
617    (synopsis
618      "Gem for integrating to Bandwidth's Iris API")
619    (description
620      "Gem for integrating to Bandwidth's Iris API")
621    (home-page
622      "https://github.com/bandwidthcom/ruby-bandwidth-iris")
623    (license license:expat)))
624
625(define-public ruby-sentry-core
626  (package
627    (name "ruby-sentry-core")
628    (version "4.3.1")
629    (source
630      (origin
631        (method url-fetch)
632        (uri (rubygems-uri "sentry-ruby-core" version))
633        (sha256
634          (base32
635            "13z35s9mflh3v775a0scsnqhscz9q46kaak38y7zmx32z7sg2a3a"))))
636    (build-system ruby-build-system)
637    (arguments
638     ; No rakefile in gem
639     '(#:tests? #f))
640    (propagated-inputs
641      `(("ruby-concurrent" ,ruby-concurrent)
642        ("ruby-faraday" ,ruby-faraday)))
643    (synopsis
644      "A gem that provides a client interface for the Sentry error logger")
645    (description
646      "This package provides a gem that provides a client interface for the Sentry error logger")
647    (home-page
648      "https://github.com/getsentry/sentry-ruby")
649    (license license:expat)))
650
651(define-public ruby-sentry
652  (package
653    (name "ruby-sentry")
654    (version "4.3.1")
655    (source
656      (origin
657        (method url-fetch)
658        (uri (rubygems-uri "sentry-ruby" version))
659        (sha256
660          (base32
661            "101q3141xfkmh7vi8h4sjqqmxcx90xhyq51lmfnhfiwgii7cn9k8"))))
662    (build-system ruby-build-system)
663    (arguments
664     ; No rakefile in gem
665     '(#:tests? #f))
666    (propagated-inputs
667      `(("ruby-concurrent" ,ruby-concurrent)
668        ("ruby-faraday" ,ruby-faraday)
669        ("ruby-sentry-core" ,ruby-sentry-core)))
670    (synopsis
671      "A gem that provides a client interface for the Sentry error logger")
672    (description
673      "This package provides a gem that provides a client interface for the Sentry error logger")
674    (home-page
675      "https://github.com/getsentry/sentry-ruby")
676    (license license:expat)))
677
678(define-public ruby-webrick
679  (package
680    (name "ruby-webrick")
681    (version "1.7.0")
682    (source
683      (origin
684        (method url-fetch)
685        (uri (rubygems-uri "webrick" version))
686        (sha256
687          (base32
688            "1d4cvgmxhfczxiq5fr534lmizkhigd15bsx5719r5ds7k7ivisc7"))))
689    (build-system ruby-build-system)
690    (synopsis
691      "WEBrick is an HTTP server toolkit that can be configured as an HTTPS server, a proxy server, and a virtual-host server.")
692    (description
693      "WEBrick is an HTTP server toolkit that can be configured as an HTTPS server, a proxy server, and a virtual-host server.")
694    (home-page "https://github.com/ruby/webrick")
695    (license (list #f #f))))
696
697(define-public ruby-interception
698  (package
699    (name "ruby-interception")
700    (version "0.5")
701    (source
702      (origin
703        (method url-fetch)
704        (uri (rubygems-uri "interception" version))
705        (sha256
706          (base32
707            "01vrkn28psdx1ysh5js3hn17nfp1nvvv46wc1pwqsakm6vb1hf55"))))
708    (build-system ruby-build-system)
709    (native-inputs
710     `(("ruby-rspec" ,ruby-rspec)))
711    (synopsis
712      "Provides a cross-platform ability to intercept all exceptions as they are raised.")
713    (description
714      "This package provides a cross-platform ability to intercept all exceptions as they are raised.")
715    (home-page
716      "http://github.com/ConradIrwin/interception")
717    (license license:expat)))
718
719(define-public ruby-pry-rescue
720  (package
721    (name "ruby-pry-rescue")
722    (version "1.5.2")
723    (source
724      (origin
725        (method url-fetch)
726        (uri (rubygems-uri "pry-rescue" version))
727        (sha256
728          (base32
729            "1wn72y8y3d3g0ng350ld92nyjln012432q2z2iy9lhwzjc4dwi65"))))
730    (build-system ruby-build-system)
731    (arguments
732     `(#:phases
733       (modify-phases %standard-phases
734         (add-after 'unpack 'nuke-bad-test
735           (lambda _
736             (substitute* "spec/source_location_spec.rb"
737               (("time = Time.now") "skip"))
738             #t)))))
739    (propagated-inputs
740      `(("ruby-interception" ,ruby-interception)
741        ("ruby-pry" ,ruby-pry)))
742    (native-inputs
743     `(("ruby-rspec" ,ruby-rspec)
744       ("ruby-pry-stack-explorer" ,ruby-pry-stack-explorer)))
745    (synopsis
746      "Allows you to wrap code in Pry::rescue{ } to open a pry session at any unhandled exceptions")
747    (description
748      "Allows you to wrap code in Pry::rescue{ } to open a pry session at any unhandled exceptions")
749    (home-page
750      "https://github.com/ConradIrwin/pry-rescue")
751    (license license:expat)))
752
753(define-public ruby-rantly
754  (package
755    (name "ruby-rantly")
756    (version "2.0.0")
757    (source
758      (origin
759        (method url-fetch)
760        (uri (rubygems-uri "rantly" version))
761        (sha256
762          (base32
763            "11407cg0dzz83jsschnrpi9cqwz8b04q6bj6qj3m70ay52y222ix"))))
764    (build-system ruby-build-system)
765    (native-inputs
766     `(("ruby-rubocop" ,ruby-rubocop)
767       ("ruby-simplecov" ,ruby-simplecov)))
768    (synopsis
769      "Ruby Imperative Random Data Generator and Quickcheck")
770    (description
771      "Ruby Imperative Random Data Generator and Quickcheck")
772    (home-page "https://github.com/rantly-rb/rantly")
773    (license license:expat)))
774
775(define %source-dir (dirname (current-filename)))
776(define %git-dir (string-append %source-dir "/.git"))
777
778;;;;
779
780; double-escaped template of the jmp-pay sexp
781; This allows us to bake the expression without doing a full eval to a record,
782; so it can be written
783(define-public jmp-pay-template
784  '(package
785    (name "jmp-pay")
786    (version (read-line (open-pipe* OPEN_READ "git" "--git-dir" %git-dir "describe" "--always" "--dirty")))
787    (source
788     `(origin
789       (method git-fetch)
790       (uri (git-reference
791             (recursive? #t)
792             (url "https://git.singpolyma.net/jmp-pay")
793             (commit ,(read-line (open-pipe* OPEN_READ "git" "--git-dir" %git-dir "rev-parse" "HEAD")))))
794       (file-name (git-file-name name version))
795       (sha256
796        (base32
797         ,(read-line (open-pipe* OPEN_READ "guix" "hash" "-rx" %source-dir))))))
798    (build-system 'copy-build-system)
799    (arguments
800     ''(#:install-plan '(("." "share/jmp-pay"))
801       #:phases
802       (modify-phases %standard-phases
803         (add-after 'install 'wrap
804           (lambda* (#:key outputs #:allow-other-keys)
805             (use-modules (ice-9 ftw))
806             (let* ((out (assoc-ref outputs "out"))
807                    (appbindir (string-append out "/share/jmp-pay/bin/"))
808                    (bindir (string-append out "/bin/")))
809               (for-each (lambda (bin)
810                 (mkdir-p bindir)
811                 (let ((binstub (string-append bindir bin)))
812                   (call-with-output-file binstub
813                     (lambda (port)
814                       (format port
815                         "#!~a~%ENV['GEM_PATH'] = ['~a', ENV['GEM_PATH']].compact.join(':')~%Gem.clear_paths~%load '~a~a'~%"
816                         (which "ruby")
817                         (getenv "GEM_PATH")
818                         appbindir
819                         bin)))
820                   (chmod binstub #o755)))
821                 (scandir appbindir
822                   (lambda (f) (eq? 'regular (stat:type (stat (string-append appbindir f))))))))
823             #t))
824         (add-before 'install 'check
825           (lambda _
826             (invoke "rake" "test")
827             #t)))))
828    (propagated-inputs
829      '`(("ruby-blather" ,ruby-blather)
830        ("ruby-braintree" ,ruby-braintree)
831        ("ruby-dhall" ,ruby-dhall)
832        ("ruby-money-open-exchange-rates" ,ruby-money-open-exchange-rates)
833        ("ruby-pg" ,ruby-pg)
834        ("ruby-redis" ,ruby-redis)
835        ("ruby-roda" ,ruby-roda)
836        ("ruby-bandwidth-iris" ,ruby-bandwidth-iris)
837        ("ruby-sentry" ,ruby-sentry)
838        ("ruby" ,ruby) ;; Normally ruby-build-system adds this for us
839        ("ruby-slim" ,ruby-slim)))
840    (native-inputs
841     '`(("ruby-rantly" ,ruby-rantly)
842       ("ruby-rake" ,ruby-rake)
843       ("ruby-webmock" ,ruby-webmock)))
844    (synopsis
845      "Payment infrastructure for JMP.chat")
846    (description
847      "Web service and cronjobs for payment handling")
848    (home-page
849      "https://git.singpolyma.net/jmp-pay")
850    (license 'license:agpl3)))
851
852; Baked version of jmp-pay-template with leaves eval'd
853(define-public jmp-pay-baked
854 (cons
855  (car jmp-pay-template)
856  (map
857   (lambda (x) (list (car x) (eval (cadr x) (current-module))))
858   (cdr jmp-pay-template))))
859
860; Build clean from git the version from a local clone
861; To build whatever is sitting in local use:
862; guix build --with-source="jmp-pay@$(git describe --always --dirty)=$(pwd)" -L . jmp-pay
863(define-public jmp-pay
864  (eval jmp-pay-baked (current-module)))