2014-08-18 21:58:18 +00:00
|
|
|
# build-time overrides for some gems
|
|
|
|
#
|
|
|
|
# gems in here generally involve native extensions; there's no way to tell
|
|
|
|
# based on the gemfile
|
|
|
|
|
2014-08-31 06:47:59 +00:00
|
|
|
{ libxml2, libxslt, postgresql, python, ruby, self, v8_3_16_14, which, writeScript
|
|
|
|
, stdenv }:
|
2011-01-21 08:25:02 +00:00
|
|
|
|
|
|
|
let
|
2014-08-09 19:55:31 +00:00
|
|
|
v8 = v8_3_16_14;
|
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-08-09 19:55:31 +00:00
|
|
|
barber = { gemFlags = "--ignore-dependencies"; dontBuild = 1; };
|
2014-08-09 02:09:28 +00:00
|
|
|
ember_data_source = { gemFlags = "--ignore-dependencies"; };
|
|
|
|
ember_rails = { gemFlags = "--ignore-dependencies"; };
|
|
|
|
|
2014-08-09 19:55:31 +00:00
|
|
|
rbtrace = { dontBuild = 1; };
|
|
|
|
method_source = { dontBuild = 1; };
|
2013-03-04 15:43:20 +00:00
|
|
|
|
2014-08-31 06:07:35 +00:00
|
|
|
pg = { buildFlags = ["--with-pg-config=${postgresql}/bin/pg_config"]; };
|
2014-02-01 18:56:54 +00:00
|
|
|
|
2011-01-21 08:25:02 +00:00
|
|
|
nokogiri = {
|
2014-08-24 16:33:33 +00:00
|
|
|
buildInputs = [ libxml2 ];
|
2012-01-10 23:49:24 +00:00
|
|
|
buildFlags =
|
|
|
|
[ "--with-xml2-dir=${libxml2} --with-xml2-include=${libxml2}/include/libxml2"
|
2014-08-09 19:55:31 +00:00
|
|
|
"--with-xslt-dir=${libxslt}" "--use-system-libraries"
|
2012-01-10 23:49:24 +00:00
|
|
|
];
|
2011-01-21 08:25:02 +00:00
|
|
|
};
|
|
|
|
|
2014-08-09 19:55:31 +00:00
|
|
|
therubyracer = {
|
|
|
|
preBuild = ''
|
2014-08-31 06:47:59 +00:00
|
|
|
addToSearchPath RUBYLIB "${self.libv8}/${ruby.gemPath}/gems/libv8-3.16.14.3/lib"
|
|
|
|
addToSearchPath RUBYLIB "${self.libv8}/${ruby.gemPath}/gems/libv8-3.16.14.3/ext"
|
2014-08-09 19:55:31 +00:00
|
|
|
'';
|
2011-01-21 08:25:02 +00:00
|
|
|
|
2014-08-09 19:55:31 +00:00
|
|
|
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
cat >> $out/nix-support/setup-hook <<EOF
|
2014-08-10 01:01:40 +00:00
|
|
|
export DYLD_INSERT_LIBRARIES="$DYLD_INSERT_LIBRARIES''${!DYLD_INSERT_LIBRARIES:+:}${v8}/lib/libv8.dylib"
|
2014-08-09 19:55:31 +00:00
|
|
|
EOF
|
|
|
|
'';
|
2012-01-10 23:50:31 +00:00
|
|
|
|
2014-08-09 19:55:31 +00:00
|
|
|
buildFlags = [
|
|
|
|
"--with-v8-dir=${v8}" "--with-v8-include=${v8}/include"
|
|
|
|
"--with-v8-lib=${v8}/lib"
|
|
|
|
];
|
2013-06-12 02:24:04 +00:00
|
|
|
};
|
|
|
|
|
2014-08-09 19:55:31 +00:00
|
|
|
libv8 = {
|
|
|
|
dontBuild = true;
|
|
|
|
buildFlags = [ "--with-system-v8" ];
|
2013-06-20 00:09:15 +00:00
|
|
|
};
|
|
|
|
|
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 20:42:20 +00: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 08:27:40 +00:00
|
|
|
|
|
|
|
bundler = { dontPatchShebangs=1; };
|
2011-01-21 08:25:02 +00:00
|
|
|
}
|