diff options
author | zimbatm <zimbatm@zimbatm.com> | 2015-11-16 18:10:20 +0100 |
---|---|---|
committer | Rok Garbas <rok@garbas.si> | 2015-11-25 12:10:03 +0100 |
commit | ad2a4ab24cc3cdd143602f4b65e8c700db8933dd (patch) | |
tree | b3b986da6c1d878dacb06f379c94cedb413f9e94 /pkgs/development/interpreters/ruby | |
parent | e7cd9077a8fa0d3acd434e6de09902aabe3a3425 (diff) | |
download | nixlib-ad2a4ab24cc3cdd143602f4b65e8c700db8933dd.tar nixlib-ad2a4ab24cc3cdd143602f4b65e8c700db8933dd.tar.gz nixlib-ad2a4ab24cc3cdd143602f4b65e8c700db8933dd.tar.bz2 nixlib-ad2a4ab24cc3cdd143602f4b65e8c700db8933dd.tar.lz nixlib-ad2a4ab24cc3cdd143602f4b65e8c700db8933dd.tar.xz nixlib-ad2a4ab24cc3cdd143602f4b65e8c700db8933dd.tar.zst nixlib-ad2a4ab24cc3cdd143602f4b65e8c700db8933dd.zip |
ruby: remove insecure 1.8.7, fixes #11194
1.8.x is unsupported and is probably insecure. This also simplifies things a little bit
Diffstat (limited to 'pkgs/development/interpreters/ruby')
-rw-r--r-- | pkgs/development/interpreters/ruby/bundler-env/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/interpreters/ruby/default.nix | 22 | ||||
-rw-r--r-- | pkgs/development/interpreters/ruby/patchsets.nix | 19 | ||||
-rw-r--r-- | pkgs/development/interpreters/ruby/ruby-1.8.7.nix | 104 |
4 files changed, 7 insertions, 144 deletions
diff --git a/pkgs/development/interpreters/ruby/bundler-env/default.nix b/pkgs/development/interpreters/ruby/bundler-env/default.nix index b51a6d49bd3d..9fa6e52c4557 100644 --- a/pkgs/development/interpreters/ruby/bundler-env/default.nix +++ b/pkgs/development/interpreters/ruby/bundler-env/default.nix @@ -88,10 +88,8 @@ let require 'rubygems/package' require 'fileutils' - if defined?(Encoding.default_internal) - Encoding.default_internal = Encoding::UTF_8 - Encoding.default_external = Encoding::UTF_8 - end + Encoding.default_internal = Encoding::UTF_8 + Encoding.default_external = Encoding::UTF_8 if Gem::VERSION < '2.0' load "${./package-1.8.rb}" diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index 185d6619596c..a9bc2f775bb5 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -18,7 +18,6 @@ let else versionNoPatch; tag = "v" + stdenv.lib.replaceChars ["." "p" "-"] ["_" "_" ""] fullVersionName; isRuby21 = majorVersion == "2" && minorVersion == "1"; - isRuby18 = majorVersion == "1" && minorVersion == "8"; baseruby = self.override { useRailsExpress = false; }; self = lib.makeOverridable ( { stdenv, lib, fetchurl, fetchFromSavannah, fetchFromGitHub @@ -64,8 +63,7 @@ let # support is disabled (if it's enabled, we already have it) and we're # running on darwin ++ (op (!cursesSupport && stdenv.isDarwin) readline) - ++ (ops stdenv.isDarwin (with darwin; [ libiconv libobjc libunwind ])) - ++ op isRuby18 autoconf; + ++ (ops stdenv.isDarwin (with darwin; [ libiconv libobjc libunwind ])); enableParallelBuilding = true; @@ -77,15 +75,16 @@ let rm "$sourceRoot/enc/unicode/name2ctype.h" ''; - postPatch = opString (!isRuby18) (if isRuby21 then '' + postPatch = if isRuby21 then '' rm tool/config_files.rb cp ${config}/config.guess tool/ cp ${config}/config.sub tool/ - '' else opString useRailsExpress '' + '' + else opString useRailsExpress '' sed -i configure.in -e '/config.guess/d' cp ${config}/config.guess tool/ cp ${config}/config.sub tool/ - ''); + ''; configureFlags = ["--enable-shared" "--enable-pthread"] ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby" @@ -136,17 +135,6 @@ let ) args; in self; in { - ruby_1_8_7 = generic { - majorVersion = "1"; - minorVersion = "8"; - teenyVersion = "7"; - patchLevel = "374"; - sha256 = { - src = "0v17cmm95f3xwa4kvza8xwbnfvfqcrym8cvqfvscn45bxsmfwvl7"; - git = "1xddhxr0j26hpxfixvhqdscwk2ri846w2129fcfwfjzvy19igswx"; - }; - }; - ruby_1_9_3 = generic { majorVersion = "1"; minorVersion = "9"; diff --git a/pkgs/development/interpreters/ruby/patchsets.nix b/pkgs/development/interpreters/ruby/patchsets.nix index 44f4c25a6858..0995e23890dc 100644 --- a/pkgs/development/interpreters/ruby/patchsets.nix +++ b/pkgs/development/interpreters/ruby/patchsets.nix @@ -1,25 +1,6 @@ { patchSet, useRailsExpress, ops, patchLevel }: let self = rec { - "1.8.7" = [ - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/01-ignore-generated-files.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/02-fix-tests-for-osx.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/03-sigvtalrm-fix.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/04-railsbench-gc-patch.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/05-display-full-stack-trace.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/06-better-source-file-tracing.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/07-heap-dump-support.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/08-fork-support-for-gc-logging.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/09-track-malloc-size.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/10-track-object-allocation.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/11-expose-heap-slots.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/12-fix-heap-size-growth-logic.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/13-heap-slot-size.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/14-add-trace-stats-enabled-methods.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/15-track-live-dataset-size.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/16-add-object-size-information-to-heap-dump.patch" - "${patchSet}/patches/ruby/1.8.7/p${patchLevel}/railsexpress/17-caller-for-all-threads.patch" - ]; "1.9.3" = [ ./ruby19-parallel-install.patch ./bitperfect-rdoc.patch diff --git a/pkgs/development/interpreters/ruby/ruby-1.8.7.nix b/pkgs/development/interpreters/ruby/ruby-1.8.7.nix deleted file mode 100644 index 0ae1d1261eed..000000000000 --- a/pkgs/development/interpreters/ruby/ruby-1.8.7.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ stdenv, lib, fetchurl, fetchFromGitHub -, zlib, zlibSupport ? true -, openssl, opensslSupport ? true -, gdbm, gdbmSupport ? true -, ncurses, readline, cursesSupport ? true -, groff, docSupport ? false -, ruby_1_8_7, autoreconfHook, bison, useRailsExpress ? true -}: - -let - op = stdenv.lib.optional; - ops = stdenv.lib.optionals; - patchSet = import ./rvm-patchsets.nix { inherit fetchFromGitHub; }; - baseruby = ruby_1_8_7.override { useRailsExpress = false; }; -in - -stdenv.mkDerivation rec { - version = with passthru; "${majorVersion}.${minorVersion}.${teenyVersion}-p${patchLevel}"; - - name = "ruby-${version}"; - - src = if useRailsExpress then fetchFromGitHub { - owner = "ruby"; - repo = "ruby"; - rev = "v1_8_7_${passthru.patchLevel}"; - sha256 = "1xddhxr0j26hpxfixvhqdscwk2ri846w2129fcfwfjzvy19igswx"; - } else fetchurl { - url = "http://cache.ruby-lang.org/pub/ruby/1.8/${name}.tar.bz2"; - sha256 = "1qq7khilwkayrhwmzlxk83scrmiqfi7lgsn4c63znyvz2c1lgqxl"; - }; - - # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds. - NROFF = "${groff}/bin/nroff"; - - buildInputs = ops useRailsExpress [ autoreconfHook bison ] - ++ (ops cursesSupport [ ncurses readline ] ) - ++ (op docSupport groff ) - ++ (op zlibSupport zlib) - ++ (op opensslSupport openssl) - ++ (op gdbmSupport gdbm); - - patches = ops useRailsExpress [ - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/01-ignore-generated-files.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/02-fix-tests-for-osx.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/03-sigvtalrm-fix.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/04-railsbench-gc-patch.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/05-display-full-stack-trace.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/06-better-source-file-tracing.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/07-heap-dump-support.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/08-fork-support-for-gc-logging.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/09-track-malloc-size.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/10-track-object-allocation.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/11-expose-heap-slots.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/12-fix-heap-size-growth-logic.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/13-heap-slot-size.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/14-add-trace-stats-enabled-methods.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/15-track-live-dataset-size.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/16-add-object-size-information-to-heap-dump.patch" - "${patchSet}/patches/ruby/1.8.7/p374/railsexpress/17-caller-for-all-threads.patch" - ]; - - configureFlags = [ "--enable-shared" "--enable-pthread" ] - # Without this fails due to not finding X11/Xlib.h - # Not sure why this isn't required on Linux - ++ ops stdenv.isDarwin [ "--without-tcl" "--without-tk" ] - ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby"; - - installFlags = stdenv.lib.optionalString docSupport "install-doc"; - - postInstall = '' - # Bundler tries to create this directory - mkdir -pv $out/${passthru.gemPath} - mkdir -p $out/nix-support - cat > $out/nix-support/setup-hook <<EOF - addGemPath() { - addToSearchPath GEM_PATH \$1/${passthru.gemPath} - } - - envHooks+=(addGemPath) - EOF - '' + lib.optionalString useRailsExpress '' - rbConfig=$(find $out/lib/ruby -name rbconfig.rb) - - # Prevent the baseruby from being included in the closure. - sed -i '/^ CONFIG\["BASERUBY"\]/d' $rbConfig - sed -i "s|'--with-baseruby=${baseruby}/bin/ruby'||" $rbConfig - ''; - - meta = { - license = stdenv.lib.licenses.ruby; - homepage = "http://www.ruby-lang.org/en/"; - description = "The Ruby language"; - }; - - passthru = rec { - majorVersion = "1"; - minorVersion = "8"; - teenyVersion = "7"; - patchLevel = "374"; - rubyEngine = "ruby"; - libPath = "lib/${rubyEngine}/${majorVersion}.${minorVersion}.${teenyVersion}"; - gemPath = "lib/${rubyEngine}/gems/${majorVersion}.${minorVersion}.${teenyVersion}"; - }; -} |