Merge pull request #14027 from zimbatm/ruby-modules

Ruby modules
This commit is contained in:
zimbatm 2016-03-19 22:07:55 +00:00
commit 1a7a7d8ef9
16 changed files with 7 additions and 195 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, lib, bundler, fetchFromGitHub, bundlerEnv, defaultGemConfig, libiconv, ruby
{ stdenv, lib, bundler, fetchFromGitHub, bundlerEnv, libiconv, ruby
, tzdata, git, nodejs, procps
}:

View File

@ -1,138 +0,0 @@
{ fetchurl, writeScript, ruby, ncurses, sqlite, libxml2, libxslt, libffi
, zlib, libuuid, gems, jdk, python, stdenv, libiconv, imagemagick
, pkgconfig }:
let
patchUsrBinEnv = writeScript "path-usr-bin-env" ''
#!/bin/sh
echo "==================="
find "$1" -type f -name "*.rb" | xargs sed -i "s@/usr/bin/env@$(type -p env)@g"
find "$1" -type f -name "*.mk" | xargs sed -i "s@/usr/bin/env@$(type -p env)@g"
'';
in
{
buildr = {
# Many Buildfiles rely on RUBYLIB containing the current directory
# (as was the default in Ruby < 1.9.2).
extraWrapperFlags = "--prefix RUBYLIB : .";
};
fakes3 = {
postInstall = ''
cd $out/${ruby.gemPath}/gems/*
patch -Np1 -i ${../../ruby-modules/fake-s3-list-bucket.patch}
'';
};
ffi = {
postUnpack = "onetuh";
buildFlags = ["--with-ffi-dir=${libffi}"];
NIX_POST_EXTRACT_FILES_HOOK = patchUsrBinEnv;
};
iconv = { buildInputs = [ libiconv ]; };
libv8 = {
# This fix is needed to fool scons, which clears the environment by default.
# It's ugly, but it works.
#
# We create a gcc wrapper wrapper, which reexposes the environment variables
# that scons hides. Furthermore, they treat warnings as errors causing the
# build to fail, due to an unused variable.
#
# Finally, we must set CC and AR explicitly to allow scons to find the
# compiler and archiver
preBuild = ''
cat > $TMPDIR/g++ <<EOF
#! ${stdenv.shell}
$(export)
g++ \$(echo \$@ | sed 's/-Werror//g')
EOF
chmod +x $TMPDIR/g++
export CXX=$TMPDIR/g++
export AR=$(type -p ar)
'';
buildInputs = [ python ];
NIX_POST_EXTRACT_FILES_HOOK = writeScript "patch-scons" ''
#!/bin/sh
for i in `find "$1" -name scons`
do
sed -i -e "s@/usr/bin/env@$(type -p env)@g" $i
done
'';
};
ncurses = { propagatedBuildInputs = [ ncurses ]; };
ncursesw = { propagatedBuildInputs = [ ncurses ]; };
nix = {
postInstall = ''
cd $out/${ruby.gemPath}/gems/nix*
patch -Np1 -i ${./fix-gem-nix-versions.patch}
'';
};
nokogiri = {
buildInputs = [ libxml2 ];
buildFlags =
[ "--with-xml2-dir=${libxml2} --with-xml2-include=${libxml2}/include/libxml2"
"--with-xslt-dir=${libxslt} --use-system-libraries"
libiconv
];
};
pry = { gemFlags = "--no-ri --no-rdoc"; };
rails = { gemFlags = "--no-ri --no-rdoc"; };
rjb = {
buildInputs = [ jdk ];
JAVA_HOME = jdk;
};
rmagick = {
buildInputs = [ imagemagick pkgconfig ];
NIX_CFLAGS_COMPILE = "-I${imagemagick}/include/ImageMagick-6";
};
sqlite3 = { propagatedBuildInputs = [ sqlite ]; };
xapian_full = {
buildInputs = [ gems.rake zlib libuuid ];
gemFlags = "--no-rdoc --no-ri";
};
xapian_full_alaveteli = {
buildInputs = [ zlib libuuid ];
};
xapian_ruby = {
buildInputs = [ zlib libuuid ];
};
xrefresh_server =
let
patch = fetchurl {
url = "http://mawercer.de/~nix/xrefresh.diff.gz";
sha256 = "1f7bnmn1pgkmkml0ms15m5lx880hq2sxy7vsddb3sbzm7n1yyicq";
};
in {
propagatedBuildInputs = [ gems.rb_inotify ];
# monitor implementation for Linux
postInstall = ''
cd $out/${ruby.gemPath}/gems/*
zcat ${patch} | patch -p 1
''; # */
};
bundler = { dontPatchShebangs=1; };
}

View File

@ -1,30 +0,0 @@
commit 983634ea6b81910529596c262644eacfa2c2c4f9
Author: Shea Levy <shea@shealevy.com>
Date: Wed Sep 4 16:16:12 2013 -0400
Fix LS_BUCKET
GET foo.s3.amazonaws.com/ and GET s3.amazonaws.com/foo should result in
an LS_BUCKET request, but under the previous logic it would result in a
LIST_BUCKETS request. GET s3.amazonaws.com/ still results in a
LIST_BUCKETS request due to the 'if path == "/" and s_req.is_path_style'
conditional.
Signed-off-by: Shea Levy <shea@shealevy.com>
diff --git a/lib/fakes3/server.rb b/lib/fakes3/server.rb
index 6958151..36d9cad 100644
--- a/lib/fakes3/server.rb
+++ b/lib/fakes3/server.rb
@@ -213,10 +213,7 @@ module FakeS3
elems = path.split("/")
end
- if elems.size == 0
- # List buckets
- s_req.type = Request::LIST_BUCKETS
- elsif elems.size == 1
+ if elems.size < 2
s_req.type = Request::LS_BUCKET
s_req.query = query
else

View File

@ -1,18 +0,0 @@
{stdenv, fetchurl, ruby, sqlite}:
stdenv.mkDerivation {
name = "ruby-sqlite3-1.2.4";
src = fetchurl {
url = http://rubyforge.org/frs/download.php/42055/sqlite3-ruby-1.2.4.tar.bz2;
sha256 = "1mmhlrggzdsbhpmifv1iibrf4ch3ycm878pxil3x3xhf9l6vp0a7";
};
buildInputs = [ruby sqlite];
buildPhase = "true";
installPhase = ''
mkdir -p $out/lib
ruby setup.rb config --prefix=$out
# --bindir $out/bin --libdir $out/lib
ruby setup.rb setup
ruby setup.rb install
'';
}

View File

@ -15,6 +15,7 @@ rec {
bridge_utils = bridge-utils; # added 2015-02-20
btrfsProgs = btrfs-progs; # added 2016-01-03
buildbotSlave = buildbot-slave; # added 2014-12-09
bundler_HEAD = bundler; # added 2015-11-15
cheetahTemplate = pythonPackages.cheetah; # 2015-06-15
clangAnalyzer = clang-analyzer; # added 2015-02-20
conkerorWrapper = conkeror; # added 2015-01

View File

@ -5589,14 +5589,11 @@ let
pixie = callPackage ../development/interpreters/pixie { };
dust = callPackage ../development/interpreters/pixie/dust.nix { };
bundix = callPackage ../development/interpreters/ruby/bundix {
ruby = ruby_2_1;
};
bundler = callPackage ../development/interpreters/ruby/bundler.nix { };
bundler_HEAD = bundler;
defaultGemConfig = callPackage ../development/interpreters/ruby/gemconfig/default.nix { };
buildRubyGem = callPackage ../development/interpreters/ruby/build-ruby-gem { };
bundlerEnv = callPackage ../development/interpreters/ruby/bundler-env { };
buildRubyGem = callPackage ../development/ruby-modules/gem { };
defaultGemConfig = callPackage ../development/ruby-modules/gem-config { };
bundix = callPackage ../development/ruby-modules/bundix { };
bundler = callPackage ../development/ruby-modules/bundler { };
bundlerEnv = callPackage ../development/ruby-modules/bundler-env { };
inherit (callPackage ../development/interpreters/ruby {})
ruby_1_9_3