about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/interpreters/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/ruby')
-rw-r--r--nixpkgs/pkgs/development/interpreters/ruby/default.nix40
-rw-r--r--nixpkgs/pkgs/development/interpreters/ruby/patchsets.nix2
-rw-r--r--nixpkgs/pkgs/development/interpreters/ruby/rubygems/default.nix4
-rw-r--r--nixpkgs/pkgs/development/interpreters/ruby/rvm-patchsets.nix4
4 files changed, 35 insertions, 15 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/ruby/default.nix b/nixpkgs/pkgs/development/interpreters/ruby/default.nix
index d90a2f4f971b..7d688da61aa0 100644
--- a/nixpkgs/pkgs/development/interpreters/ruby/default.nix
+++ b/nixpkgs/pkgs/development/interpreters/ruby/default.nix
@@ -51,11 +51,22 @@ let
       , groff, docSupport ? true
       , libyaml, yamlSupport ? true
       , libffi, fiddleSupport ? true
-      # ruby -e "puts RbConfig::CONFIG['configure_args']"
-      # puts a reference to the C compiler in the binary.
-      # This might be required by some gems at runtime,
-      # but we allow to strip it out for smaller closure size.
-      , removeReferencesTo, removeReferenceToCC ? true
+      # By default, ruby has 3 observed references to stdenv.cc:
+      #
+      # - If you run:
+      #     ruby -e "puts RbConfig::CONFIG['configure_args']"
+      # - In:
+      #     $out/${passthru.libPath}/${stdenv.targetPlatform.system}/rbconfig.rb
+      #   Or (usually):
+      #     $(nix-build -A ruby)/lib/ruby/2.6.0/x86_64-linux/rbconfig.rb
+      # - In $out/lib/libruby.so and/or $out/lib/libruby.dylib
+      #
+      # Since some Gems require JIT support, there's probably no
+      # escape from this reference. Hence, it was decided to enable this
+      # feature by default, as it's enabled by default by ruby's ./configure
+      # script. If you'd like to have a ruby without reference to cc, setting
+      # jitSupport to false should remove all known references mentioned above.
+      , removeReferencesTo, jitSupport ? true
       , autoreconfHook, bison, autoconf
       , buildEnv, bundler, bundix
       , libiconv, libobjc, libunwind, Foundation
@@ -124,6 +135,9 @@ let
           sed -i configure.ac -e '/config.guess/d'
           cp --remove-destination ${config}/config.guess tool/
           cp --remove-destination ${config}/config.sub tool/
+          # Make the build reproducible for ruby <= 2.7
+          # See https://github.com/ruby/io-console/commit/679a941d05d869f5e575730f6581c027203b7b26#diff-d8422f096931c58d4463e2489f62a228b0f24f0492950ba88c8c89a0d741cfe6
+          sed -i ext/io/console/io-console.gemspec -e '/s\.date/d'
         '';
 
         # Force the revision.h generation. Somehow `revision.tmp` is an empty
@@ -134,6 +148,7 @@ let
 
         configureFlags = ["--enable-shared" "--enable-pthread" "--with-soname=ruby-${version}"]
           ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby"
+          ++ op (!jitSupport) "--disable-jit-support"
           ++ op (!docSupport) "--disable-install-doc"
           ++ ops stdenv.isDarwin [
             # on darwin, we have /usr/include/tk.h -- so the configure script detects
@@ -166,11 +181,14 @@ let
           # Remove unnecessary groff reference from runtime closure, since it's big
           sed -i '/NROFF/d' $out/lib/ruby/*/*/rbconfig.rb
           ${
-            lib.optionalString removeReferenceToCC ''
+            lib.optionalString (!jitSupport) ''
               # Get rid of the CC runtime dependency
               ${removeReferencesTo}/bin/remove-references-to \
                 -t ${stdenv.cc} \
                 $out/lib/libruby*
+              ${removeReferencesTo}/bin/remove-references-to \
+                -t ${stdenv.cc} \
+                $out/${passthru.libPath}/${stdenv.targetPlatform.system}/rbconfig.rb
             ''
           }
           # Bundler tries to create this directory
@@ -204,11 +222,13 @@ let
           sed -i "s|'--with-baseruby=${baseruby}/bin/ruby'||" $rbConfig
         '';
 
+        disallowedRequisites = op (!jitSupport) stdenv.cc.cc;
+
         meta = with stdenv.lib; {
           description = "The Ruby language";
           homepage    = "http://www.ruby-lang.org/en/";
           license     = licenses.ruby;
-          maintainers = with maintainers; [ vrthra manveru ];
+          maintainers = with maintainers; [ vrthra manveru marsam ];
           platforms   = platforms.all;
         };
 
@@ -300,10 +320,10 @@ in {
   };
 
   ruby_2_7 = generic {
-    version = rubyVersion "2" "7" "1" "";
+    version = rubyVersion "2" "7" "2" "";
     sha256 = {
-      src = "0674x98f542y02r7n2yv2qhmh97blqhi2mvh2dn5f000vlxlh66l";
-      git = "0qk729kr5wm67xmwpljpdprwhp5wvn5y4ikqy00p1zcgwlwdcs33";
+      src = "1m63461mxi3fg4y3bspbgmb0ckbbb1ldgf9xi0piwkpfsk80cmvf";
+      git = "0kbgznf1yprfp9645k31ra5f4757b7fichzi0hdg6nxkj90853s0";
     };
   };
 }
diff --git a/nixpkgs/pkgs/development/interpreters/ruby/patchsets.nix b/nixpkgs/pkgs/development/interpreters/ruby/patchsets.nix
index 4407cb6e5da4..e03248b7d363 100644
--- a/nixpkgs/pkgs/development/interpreters/ruby/patchsets.nix
+++ b/nixpkgs/pkgs/development/interpreters/ruby/patchsets.nix
@@ -75,7 +75,7 @@
     "${patchSet}/patches/ruby/2.6/head/railsexpress/02-improve-gc-stats.patch"
     "${patchSet}/patches/ruby/2.6/head/railsexpress/03-more-detailed-stacktrace.patch"
   ];
-  "2.7.1" = ops useRailsExpress [
+  "2.7.2" = ops useRailsExpress [
     "${patchSet}/patches/ruby/2.7/head/railsexpress/01-fix-broken-tests-caused-by-ad.patch"
     "${patchSet}/patches/ruby/2.7/head/railsexpress/02-improve-gc-stats.patch"
     "${patchSet}/patches/ruby/2.7/head/railsexpress/03-more-detailed-stacktrace.patch"
diff --git a/nixpkgs/pkgs/development/interpreters/ruby/rubygems/default.nix b/nixpkgs/pkgs/development/interpreters/ruby/rubygems/default.nix
index 0bbcadba3f51..8263a987d639 100644
--- a/nixpkgs/pkgs/development/interpreters/ruby/rubygems/default.nix
+++ b/nixpkgs/pkgs/development/interpreters/ruby/rubygems/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "rubygems";
-  version = "3.1.2";
+  version = "3.1.3";
 
   src = fetchurl {
     url = "https://rubygems.org/rubygems/rubygems-${version}.tgz";
-    sha256 = "0h7ij4jpj8rgnpkl63cwh2lnav73pw5wpfqra3va7077lsyadlgd";
+    sha256 = "181wjclxnq5lrwnr53famy9pg8911hi9w2v0vy7dqgjqnc4iy1hp";
   };
 
   patches = [
diff --git a/nixpkgs/pkgs/development/interpreters/ruby/rvm-patchsets.nix b/nixpkgs/pkgs/development/interpreters/ruby/rvm-patchsets.nix
index 331dda5d0503..14f932e1d65c 100644
--- a/nixpkgs/pkgs/development/interpreters/ruby/rvm-patchsets.nix
+++ b/nixpkgs/pkgs/development/interpreters/ruby/rvm-patchsets.nix
@@ -3,6 +3,6 @@
 fetchFromGitHub {
   owner  = "skaes";
   repo   = "rvm-patchsets";
-  rev    = "6d8888d34a321198f7fd9253343b78c209efb046";
-  sha256 = "0xczl0nng1649km3bcbjn6zrr591l6m2kkwgnknh1fnwmmrdaya7";
+  rev    = "e2f4b82e47aeaf2a3b894da3b46ba6f0ca92cbb6";
+  sha256 = "059mvf8jcjrfplr8hv2y6ibc41id979k0zwfh6zdnb7dynym4bsg";
 }