2012-01-11 00:49:24 +01:00
|
|
|
{ fetchurl, writeScript, ruby, ncurses, sqlite, libxml2, libxslt, libffi
|
2013-11-21 04:46:02 +01:00
|
|
|
, zlib, libuuid, gems, jdk, python, stdenv, libiconvOrEmpty, imagemagick
|
2014-11-22 21:13:13 +01:00
|
|
|
, pkgconfig }:
|
2011-01-21 09:25:02 +01:00
|
|
|
|
|
|
|
let
|
2012-01-11 00:49:24 +01:00
|
|
|
|
2011-01-21 09:25:02 +01:00
|
|
|
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"
|
|
|
|
'';
|
2014-02-01 19:56:54 +01:00
|
|
|
|
2011-01-21 09:25:02 +01:00
|
|
|
in
|
2012-01-11 00:49:24 +01:00
|
|
|
|
2011-01-21 09:25:02 +01:00
|
|
|
{
|
2014-02-01 19:56:54 +01:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2013-06-14 10:06:14 +02:00
|
|
|
iconv = { buildInputs = [ libiconvOrEmpty ]; };
|
2013-03-15 13:55:48 +01:00
|
|
|
|
2013-03-21 13:56:33 +01:00
|
|
|
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
|
2014-02-01 19:56:54 +01:00
|
|
|
|
2013-03-21 13:56:33 +01:00
|
|
|
preBuild = ''
|
|
|
|
cat > $TMPDIR/g++ <<EOF
|
|
|
|
#! ${stdenv.shell}
|
|
|
|
$(export)
|
2014-02-01 19:56:54 +01:00
|
|
|
|
2013-03-21 13:56:33 +01:00
|
|
|
g++ \$(echo \$@ | sed 's/-Werror//g')
|
|
|
|
EOF
|
|
|
|
chmod +x $TMPDIR/g++
|
2014-02-01 19:56:54 +01:00
|
|
|
|
2013-03-21 13:56:33 +01:00
|
|
|
export CXX=$TMPDIR/g++
|
|
|
|
export AR=$(type -p ar)
|
|
|
|
'';
|
|
|
|
buildInputs = [ python ];
|
2013-06-18 17:14:17 +02:00
|
|
|
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
|
|
|
|
'';
|
2013-03-21 13:56:33 +01:00
|
|
|
};
|
2014-02-01 19:56:54 +01:00
|
|
|
|
2011-01-21 09:25:02 +01:00
|
|
|
ncurses = { propagatedBuildInputs = [ ncurses ]; };
|
2013-03-04 16:43:20 +01:00
|
|
|
|
2014-02-01 19:56:54 +01:00
|
|
|
ncursesw = { propagatedBuildInputs = [ ncurses ]; };
|
|
|
|
|
2013-03-04 16:43:20 +01:00
|
|
|
nix = {
|
|
|
|
postInstall = ''
|
|
|
|
cd $out/${ruby.gemPath}/gems/nix*
|
|
|
|
patch -Np1 -i ${./fix-gem-nix-versions.patch}
|
|
|
|
'';
|
|
|
|
};
|
2014-02-01 19:56:54 +01:00
|
|
|
|
2011-01-21 09:25:02 +01:00
|
|
|
nokogiri = {
|
2014-08-24 18:33:33 +02:00
|
|
|
buildInputs = [ libxml2 ];
|
2012-01-11 00:49:24 +01:00
|
|
|
buildFlags =
|
|
|
|
[ "--with-xml2-dir=${libxml2} --with-xml2-include=${libxml2}/include/libxml2"
|
2014-11-22 21:13:13 +01:00
|
|
|
"--with-xslt-dir=${libxslt} --use-system-libraries"
|
|
|
|
] ++ libiconvOrEmpty;
|
2011-01-21 09:25:02 +01:00
|
|
|
};
|
|
|
|
|
2014-02-01 19:56:54 +01:00
|
|
|
pry = { gemFlags = "--no-ri --no-rdoc"; };
|
|
|
|
|
|
|
|
rails = { gemFlags = "--no-ri --no-rdoc"; };
|
|
|
|
|
|
|
|
rjb = {
|
|
|
|
buildInputs = [ jdk ];
|
|
|
|
JAVA_HOME = jdk;
|
2011-01-21 09:25:02 +01:00
|
|
|
};
|
|
|
|
|
2013-11-21 04:46:02 +01:00
|
|
|
rmagick = {
|
|
|
|
buildInputs = [ imagemagick pkgconfig ];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = "-I${imagemagick}/include/ImageMagick-6";
|
|
|
|
};
|
|
|
|
|
2014-02-01 19:56:54 +01:00
|
|
|
sqlite3 = { propagatedBuildInputs = [ sqlite ]; };
|
2011-01-21 09:25:02 +01:00
|
|
|
|
|
|
|
xapian_full = {
|
|
|
|
buildInputs = [ gems.rake zlib libuuid ];
|
|
|
|
gemFlags = "--no-rdoc --no-ri";
|
|
|
|
};
|
2012-01-11 00:50:31 +01:00
|
|
|
|
2013-06-12 04:24:04 +02:00
|
|
|
xapian_full_alaveteli = {
|
|
|
|
buildInputs = [ zlib libuuid ];
|
|
|
|
};
|
|
|
|
|
2013-06-20 02:09:15 +02:00
|
|
|
xapian_ruby = {
|
|
|
|
buildInputs = [ zlib libuuid ];
|
|
|
|
};
|
|
|
|
|
2014-02-01 19:56:54 +01:00
|
|
|
xrefresh_server =
|
|
|
|
let
|
|
|
|
patch = fetchurl {
|
|
|
|
url = "http://mawercer.de/~nix/xrefresh.diff.gz";
|
|
|
|
sha256 = "1f7bnmn1pgkmkml0ms15m5lx880hq2sxy7vsddb3sbzm7n1yyicq";
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
propagatedBuildInputs = [ gems.rb_inotify ];
|
2013-09-04 22:42:20 +02:00
|
|
|
|
2014-02-01 19:56:54 +01:00
|
|
|
# monitor implementation for Linux
|
|
|
|
postInstall = ''
|
|
|
|
cd $out/${ruby.gemPath}/gems/*
|
|
|
|
zcat ${patch} | patch -p 1
|
|
|
|
''; # */
|
|
|
|
};
|
2014-09-16 10:27:40 +02:00
|
|
|
|
|
|
|
bundler = { dontPatchShebangs=1; };
|
2011-01-21 09:25:02 +01:00
|
|
|
}
|