From 5379504451c67b9773191d4cc56638072d3239d3 Mon Sep 17 00:00:00 2001 From: Jude Taylor Date: Sat, 26 Sep 2015 06:25:01 -0700 Subject: Merge pull request #9834 from NixOS/rubies Merge Ruby versions into one file --- pkgs/development/interpreters/ruby/default.nix | 248 ++++++++++++++++++++++ pkgs/development/interpreters/ruby/patchsets.nix | 126 +++++++++++ pkgs/development/interpreters/ruby/ruby-1.9.3.nix | 124 ----------- pkgs/development/interpreters/ruby/ruby-2.0.0.nix | 103 --------- pkgs/development/interpreters/ruby/ruby-2.1.0.nix | 120 ----------- pkgs/development/interpreters/ruby/ruby-2.1.1.nix | 118 ---------- pkgs/development/interpreters/ruby/ruby-2.1.2.nix | 117 ---------- pkgs/development/interpreters/ruby/ruby-2.1.3.nix | 121 ----------- pkgs/development/interpreters/ruby/ruby-2.1.6.nix | 124 ----------- pkgs/development/interpreters/ruby/ruby-2.2.0.nix | 113 ---------- pkgs/development/interpreters/ruby/ruby-2.2.2.nix | 112 ---------- 11 files changed, 374 insertions(+), 1052 deletions(-) create mode 100644 pkgs/development/interpreters/ruby/default.nix create mode 100644 pkgs/development/interpreters/ruby/patchsets.nix delete mode 100644 pkgs/development/interpreters/ruby/ruby-1.9.3.nix delete mode 100644 pkgs/development/interpreters/ruby/ruby-2.0.0.nix delete mode 100644 pkgs/development/interpreters/ruby/ruby-2.1.0.nix delete mode 100644 pkgs/development/interpreters/ruby/ruby-2.1.1.nix delete mode 100644 pkgs/development/interpreters/ruby/ruby-2.1.2.nix delete mode 100644 pkgs/development/interpreters/ruby/ruby-2.1.3.nix delete mode 100644 pkgs/development/interpreters/ruby/ruby-2.1.6.nix delete mode 100644 pkgs/development/interpreters/ruby/ruby-2.2.0.nix delete mode 100644 pkgs/development/interpreters/ruby/ruby-2.2.2.nix (limited to 'pkgs/development/interpreters') diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix new file mode 100644 index 00000000000..89e0016f98d --- /dev/null +++ b/pkgs/development/interpreters/ruby/default.nix @@ -0,0 +1,248 @@ +{ stdenv, lib, fetchurl, fetchFromSavannah, fetchFromGitHub +, zlib, openssl, gdbm, ncurses, readline, groff, libyaml, libffi, autoreconfHook, bison +, autoconf, darwin ? null +} @ args: + +let + op = stdenv.lib.optional; + ops = stdenv.lib.optionals; + opString = stdenv.lib.optionalString; + patchSet = import ./rvm-patchsets.nix { inherit fetchFromGitHub; }; + config = import ./config.nix { inherit fetchFromSavannah; }; + + generic = { majorVersion, minorVersion, teenyVersion, patchLevel, sha256 }: let + versionNoPatch = "${majorVersion}.${minorVersion}.${teenyVersion}"; + version = "${versionNoPatch}-p${patchLevel}"; + fullVersionName = if patchLevel != "0" && stdenv.lib.versionOlder versionNoPatch "2.1" + then version + 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 + , useRailsExpress ? true + , zlib, zlibSupport ? true + , openssl, opensslSupport ? true + , gdbm, gdbmSupport ? true + , ncurses, readline, cursesSupport ? true + , groff, docSupport ? false + , libyaml, yamlSupport ? true + , libffi, fiddleSupport ? true + , autoreconfHook, bison, autoconf + , darwin ? null + }: + stdenv.mkDerivation rec { + inherit version; + + name = "ruby-${version}"; + + src = if useRailsExpress then fetchFromGitHub { + owner = "ruby"; + repo = "ruby"; + rev = tag; + sha256 = sha256.git; + } else fetchurl { + url = "http://cache.ruby-lang.org/pub/ruby/${majorVersion}.${minorVersion}/ruby-${fullVersionName}.tar.gz"; + sha256 = sha256.src; + }; + + # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds. + NROFF = "${groff}/bin/nroff"; + + buildInputs = ops useRailsExpress [ autoreconfHook bison ] + ++ (op fiddleSupport libffi) + ++ (ops cursesSupport [ ncurses readline ]) + ++ (op docSupport groff) + ++ (op zlibSupport zlib) + ++ (op opensslSupport openssl) + ++ (op gdbmSupport gdbm) + ++ (op yamlSupport libyaml) + # Looks like ruby fails to build on darwin without readline even if curses + # support is not enabled, so add readline to the build inputs if curses + # 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; + + enableParallelBuilding = true; + + patches = (import ./patchsets.nix { + inherit patchSet useRailsExpress ops patchLevel; + })."${versionNoPatch}"; + + postUnpack = opString isRuby21 '' + rm "$sourceRoot/enc/unicode/name2ctype.h" + ''; + + postPatch = opString (!isRuby18) (if isRuby21 then '' + rm tool/config_files.rb + cp ${config}/config.guess tool/ + cp ${config}/config.sub tool/ + '' 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" + ++ ops stdenv.isDarwin [ + # on darwin, we have /usr/include/tk.h -- so the configure script detects + # that tk is installed + "--with-out-ext=tk" + # on yosemite, "generating encdb.h" will hang for a very long time without this flag + "--with-setjmp-type=setjmp" + ]; + + installFlags = stdenv.lib.optionalString docSupport "install-doc"; + # Bundler tries to create this directory + postInstall = '' + # Bundler tries to create this directory + mkdir -pv $out/${passthru.gemPath} + mkdir -p $out/nix-support + cat > $out/nix-support/setup-hook < $out/nix-support/setup-hook < $out/nix-support/setup-hook <= 2.1.0 tries to download config.{guess,sub} - postPatch = '' - rm tool/config_files.rb - cp ${config}/config.guess tool/ - cp ${config}/config.sub tool/ - ''; - - configureFlags = ["--enable-shared" ] - ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby" - # on darwin, we have /usr/include/tk.h -- so the configure script detects - # that tk is installed - ++ ( if stdenv.isDarwin then [ "--with-out-ext=tk " ] else [ ]); - - installFlags = stdenv.lib.optionalString docSupport "install-doc"; - # Bundler tries to create this directory - postInstall = '' - # Bundler tries to create this directory - mkdir -pv $out/${passthru.gemPath} - mkdir -p $out/nix-support - cat > $out/nix-support/setup-hook <= 2.1.0 tries to download config.{guess,sub} - postPatch = '' - rm tool/config_files.rb - cp ${config}/config.guess tool/ - cp ${config}/config.sub tool/ - ''; - - configureFlags = ["--enable-shared" ] - ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby" - # on darwin, we have /usr/include/tk.h -- so the configure script detects - # that tk is installed - ++ ( if stdenv.isDarwin then [ "--with-out-ext=tk " ] else [ ]); - - installFlags = stdenv.lib.optionalString docSupport "install-doc"; - # Bundler tries to create this directory - postInstall = '' - # Bundler tries to create this directory - mkdir -pv $out/${passthru.gemPath} - mkdir -p $out/nix-support - cat > $out/nix-support/setup-hook <= 2.1.0 tries to download config.{guess,sub} - postPatch = '' - rm tool/config_files.rb - cp ${config}/config.guess tool/ - cp ${config}/config.sub tool/ - ''; - - configureFlags = ["--enable-shared" ] - ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby" - # on darwin, we have /usr/include/tk.h -- so the configure script detects - # that tk is installed - ++ ( if stdenv.isDarwin then [ "--with-out-ext=tk " ] else [ ]); - - installFlags = stdenv.lib.optionalString docSupport "install-doc"; - # Bundler tries to create this directory - postInstall = '' - # Bundler tries to create this directory - mkdir -pv $out/${passthru.gemPath} - mkdir -p $out/nix-support - cat > $out/nix-support/setup-hook <= 2.1.0 tries to download config.{guess,sub} - postPatch = '' - rm tool/config_files.rb - cp ${config}/config.guess tool/ - cp ${config}/config.sub tool/ - ''; - - configureFlags = ["--enable-shared" ] - ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby" - # on darwin, we have /usr/include/tk.h -- so the configure script detects - # that tk is installed - ++ ( if stdenv.isDarwin then [ "--with-out-ext=tk " ] else [ ]); - - installFlags = stdenv.lib.optionalString docSupport "install-doc"; - # Bundler tries to create this directory - postInstall = '' - # Bundler tries to create this directory - mkdir -pv $out/${passthru.gemPath} - mkdir -p $out/nix-support - cat > $out/nix-support/setup-hook <= 2.1.0 tries to download config.{guess,sub} - postPatch = '' - rm tool/config_files.rb - cp ${config}/config.guess tool/ - cp ${config}/config.sub tool/ - ''; - - configureFlags = ["--enable-shared" ] - ++ op useRailsExpress "--with-baseruby=${baseruby}/bin/ruby" - # on darwin, we have /usr/include/tk.h -- so the configure script detects - # that tk is installed - ++ ( if stdenv.isDarwin then [ "--with-out-ext=tk " ] else [ ]); - - installFlags = stdenv.lib.optionalString docSupport "install-doc"; - # Bundler tries to create this directory - postInstall = '' - # Bundler tries to create this directory - mkdir -pv $out/${passthru.gemPath} - mkdir -p $out/nix-support - cat > $out/nix-support/setup-hook < $out/nix-support/setup-hook < $out/nix-support/setup-hook < Date: Sat, 26 Sep 2015 23:12:59 -0700 Subject: update bundler-head SHA256 --- pkgs/development/interpreters/ruby/bundler-head.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/development/interpreters') diff --git a/pkgs/development/interpreters/ruby/bundler-head.nix b/pkgs/development/interpreters/ruby/bundler-head.nix index a81f2f771bc..e31f63dccf0 100644 --- a/pkgs/development/interpreters/ruby/bundler-head.nix +++ b/pkgs/development/interpreters/ruby/bundler-head.nix @@ -5,7 +5,7 @@ buildRubyGem { src = fetchgit { url = "https://github.com/bundler/bundler.git"; rev = "a2343c9eabf5403d8ffcbca4dea33d18a60fc157"; - sha256 = "1p7kzhmicfljy9n7nq3qh6lvrsckiq76ddypf6s55gfh1l98z4k9"; + sha256 = "06qsai4ac3i2xlr7nbc4anh4cy6jd9jjf3rpj254g9gwshqv0qgr"; leaveDotGit = true; }; dontPatchShebangs = true; -- cgit 1.4.1