guix.scm

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