gnu: ruby-concurrent: Remove dependencies.
[jackhill/guix/guix.git] / gnu / packages / ruby.scm
index 877f229..fbf8d98 100644 (file)
@@ -908,13 +908,13 @@ Ruby Gems.")
 (define-public ruby-ffi
   (package
     (name "ruby-ffi")
-    (version "1.9.10")
+    (version "1.9.14")
     (source (origin
               (method url-fetch)
               (uri (rubygems-uri "ffi" version))
               (sha256
                (base32
-                "1m5mprppw0xcrv2mkim5zsk70v089ajzqiq5hpyb0xg96fcyzyxj"))))
+                "1nkcrmxqr0vb1y4rwliclwlj2ajsi4ddpdx2gvzjy0xbkk5iqzfp"))))
     (build-system ruby-build-system)
     ;; FIXME: Before running tests the build system attempts to build libffi
     ;; from sources.
@@ -1909,37 +1909,48 @@ to reproduce user environments.")
 (define-public ruby-nokogiri
   (package
     (name "ruby-nokogiri")
-    (version "1.6.7.2")
+    (version "1.6.8")
     (source (origin
               (method url-fetch)
               (uri (rubygems-uri "nokogiri" version))
               (sha256
                (base32
-                "11sbmpy60ynak6s3794q32lc99hs448msjy8rkp84ay7mq7zqspv"))))
+                "17pjhvm4yigriizxbbpx266nnh6nckdm33m3j4ws9dcg99daz91p"))))
     (build-system ruby-build-system)
     (arguments
      ;; Tests fail because Nokogiri can only test with an installed extension,
      ;; and also because many test framework dependencies are missing.
-     '(#:tests? #f
+     `(#:tests? #f
        #:gem-flags (list "--" "--use-system-libraries"
                          (string-append "--with-xml2-include="
                                         (assoc-ref %build-inputs "libxml2")
                                         "/include/libxml2" ))
        #:phases
        (modify-phases %standard-phases
-         (add-after 'extract-gemspec 'update-dependency
-           (lambda _
-             (substitute* ".gemspec" (("2.0.0.rc2") "2.0"))
+         (add-before 'build 'patch-extconf
+           ;; 'pkg-config' is not included in the GEM_PATH during
+           ;; installation, so we add it directly to the load path.
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((pkg-config (assoc-ref inputs "ruby-pkg-config"))
+                    (pkg-config-home (gem-home pkg-config
+                                               ,(package-version ruby))))
+               (substitute* "ext/nokogiri/extconf.rb"
+                 (("gem 'pkg-config'.*")
+                  (string-append "$:.unshift '"
+                                 pkg-config-home
+                                 "/gems/pkg-config-"
+                                 ,(package-version ruby-pkg-config)
+                                 "/lib'\n"))))
              #t)))))
     (native-inputs
-     `(("ruby-hoe" ,ruby-hoe)
-       ("ruby-rake-compiler" ,ruby-rake-compiler)))
+     `(("ruby-hoe" ,ruby-hoe)))
     (inputs
      `(("zlib" ,zlib)
        ("libxml2" ,libxml2)
        ("libxslt" ,libxslt)))
     (propagated-inputs
-     `(("ruby-mini-portile" ,ruby-mini-portile-2)))
+     `(("ruby-mini-portile" ,ruby-mini-portile-2)
+       ("ruby-pkg-config" ,ruby-pkg-config)))
     (synopsis "HTML, XML, SAX, and Reader parser for Ruby")
     (description "Nokogiri (鋸) parses and searches XML/HTML, and features
 both CSS3 selector and XPath 1.0 support.")
@@ -2525,22 +2536,26 @@ you about the changes.")
 (define-public ruby-activesupport
   (package
     (name "ruby-activesupport")
-    (version "4.2.4")
+    (version "5.0.0")
     (source
      (origin
        (method url-fetch)
        (uri (rubygems-uri "activesupport" version))
        (sha256
         (base32
-         "19n38rj6r1gyxgka18qvcxyla0fwan8a5p3ghq0pp8aj93sbmr6f"))))
+         "0k7zhnz0aw1ym8phs10r85f91ja45vsd058fm9v0h2k0igw12cpf"))))
     (build-system ruby-build-system)
     (arguments
-     '(#:tests? #f)) ; no tests
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             ;; There is no tests, instead attempt to load the library.
+             (zero? (system* "ruby" "-Ilib" "-r" "active_support")))))))
     (propagated-inputs
-     `(("ruby-i18n" ,ruby-i18n)
-       ("ruby-json" ,ruby-json)
+     `(("ruby-concurrent" ,ruby-concurrent)
+       ("ruby-i18n" ,ruby-i18n)
        ("ruby-minitest" ,ruby-minitest)
-       ("ruby-thread-safe" ,ruby-thread-safe)
        ("ruby-tzinfo" ,ruby-tzinfo)
        ("ruby-tzinfo-data" ,ruby-tzinfo-data)))
     (synopsis "Ruby on Rails utility library")
@@ -2971,14 +2986,14 @@ implementations to parse '.feature' files.")
 (define-public ruby-cucumber-core
   (package
     (name "ruby-cucumber-core")
-    (version "1.3.0")
+    (version "1.5.0")
     (source
      (origin
        (method url-fetch)
        (uri (rubygems-uri "cucumber-core" version))
        (sha256
         (base32
-         "12mrzf0s96izpq0k10lahlkgwc4fjs0zfs344rh8r8h3w3jyppr8"))))
+         "0qj2fsqvp94nggnikbnrfvnmzr1pl6ifmdsxj69kdw1kkab30jjr"))))
     (build-system ruby-build-system)
     (propagated-inputs
      `(("ruby-gherkin3" ,ruby-gherkin3)))
@@ -3942,7 +3957,7 @@ part of the Prawn PDF generator.")
 (define-public ruby-puma
   (package
     (name "ruby-puma")
-    (version "3.4.0")
+    (version "3.6.0")
     (source
      (origin
        (method url-fetch)
@@ -3952,14 +3967,22 @@ part of the Prawn PDF generator.")
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "10svyj2jk949y1dmkxyzipk1ddzl4iz9limrcws1zhpganpvq3j8"))
-       ;; Ignore broken test reported upstream.
+         "08aws79n9slcr50d9lwm011cp1pxvr1409c2jmyjxywvrc0a30v1"))
+       ;; Ignore broken tests reported upstream.
        ;; https://github.com/puma/puma/issues/995
+       ;; https://github.com/puma/puma/issues/1044
        (patches (search-patches "ruby-puma-ignore-broken-test.patch"))))
     (build-system ruby-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'delete-integration-tests
+           (lambda _
+             ;; One broken test in this file cannot be easily removed in
+             ;; isolation, it probably causes race conditions.  So we delete
+             ;; the entire file.
+             (delete-file "test/test_integration.rb")
+             #t))
          (add-before 'build 'fix-gemspec
            (lambda _
              (substitute* "puma.gemspec"
@@ -4050,7 +4073,7 @@ associated records.")
        ("ruby-minitest-rg" ,ruby-minitest-rg)
        ("ruby-mocha" ,ruby-mocha)
        ("ruby-activesupport" ,ruby-activesupport)))
-    (synopsis "Test mocks for time-dependent functions.")
+    (synopsis "Test mocks for time-dependent functions")
     (description
      "Timecop provides \"time travel\" and \"time freezing\" capabilities,
 making it easier to test time-dependent code.  It provides a unified method to
@@ -4102,12 +4125,17 @@ call.")
          (add-before 'check 'rake-compile
            ;; Fix the test error described at
            ;; https://github.com/ruby-concurrency/concurrent-ruby/pull/408
-           (lambda _ (zero? (system* "rake" "compile")))))))
+           (lambda _ (zero? (system* "rake" "compile"))))
+         (add-before 'check 'remove-timecop-dependency
+           ;; Remove timecop-dependent tests as having timecop as a depedency
+           ;; causes circular depedencies.
+           (lambda _
+             (delete-file "spec/concurrent/executor/timer_set_spec.rb")
+             (delete-file "spec/concurrent/scheduled_task_spec.rb")
+             #t)))))
     (native-inputs
      `(("ruby-rake-compiler" ,ruby-rake-compiler)
-       ("ruby-yard" ,ruby-yard)
-       ("ruby-rspec" ,ruby-rspec)
-       ("ruby-timecop" ,ruby-timecop)))
+       ("ruby-rspec" ,ruby-rspec)))
     (synopsis "Concurrency tools for Ruby")
     (description
      "This library provides modern concurrency tools including agents,
@@ -4117,3 +4145,24 @@ patterns.")
     (home-page "http://www.concurrent-ruby.com")
     (license license:expat)))
 
+(define-public ruby-pkg-config
+  (package
+    (name "ruby-pkg-config")
+    (version "1.1.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "pkg-config" version))
+       (sha256
+        (base32
+         "0lljiqnm0b4z6iy87lzapwrdfa6ps63x2z5zbs038iig8dqx2g0z"))))
+    (build-system ruby-build-system)
+    (arguments
+     ;; Tests require extra files not included in the gem.
+     `(#:tests? #f))
+    (synopsis "Detect libraries for compiling Ruby native extensions")
+    (description
+     "@code{pkg-config} can be used in your extconf.rb to properly detect need
+libraries for compiling Ruby native extensions.")
+    (home-page "https://github.com/ruby-gnome2/pkg-config")
+    (license license:lgpl2.0+)))