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