3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/interpreters/ruby/fixes.nix

68 lines
1.8 KiB
Nix
Raw Normal View History

# The standard set of gems in nixpkgs including potential fixes.
#
# The gemset is derived from two points of entry:
# - An attrset describing a gem, including version, source and dependencies
# This is just meta data, most probably automatically generated by a tool
# like Bundix (https://github.com/aflatter/bundix).
# {
# name = "bundler";
# version = "1.6.5";
# sha256 = "1s4x0f5by9xs2y24jk6krq5ky7ffkzmxgr4z1nhdykdmpsi2zd0l";
# dependencies = [ "rake" ];
# }
# - An optional derivation that may override how the gem is built. For popular
# gems that don't behave correctly, fixes are already provided in the form of
# derivations.
#
# This seperates "what to build" (the exact gem versions) from "how to build"
# (to make gems behave if necessary).
2014-10-28 04:16:14 +00:00
{ lib, fetchurl, writeScript, ruby, libxml2, libxslt, python, stdenv, which
, postgresql, v8_3_16_14, clang }:
let
v8 = v8_3_16_14;
2014-10-28 04:16:14 +00:00
in
2014-10-28 04:16:14 +00:00
{
bundler = attrs: {
dontPatchShebangs = 1;
};
2014-10-28 04:16:14 +00:00
libv8 = attrs: {
buildFlags = [ "--with-system-v8" ];
buildInputs = [ which v8 python ];
};
2014-10-28 04:16:14 +00:00
nokogiri = attrs: {
buildFlags = [
"--with-xml2-dir=${libxml2}"
"--with-xml2-include=${libxml2}/include/libxml2"
"--with-xslt-dir=${libxslt}"
"--use-system-libraries"
];
};
2014-10-28 04:16:14 +00:00
therubyracer = attrs: {
dontBuild = false;
2014-10-28 04:16:14 +00:00
preInstall = ''
ln -s ${clang}/bin/clang $TMPDIR/gcc
ln -s ${clang}/bin/clang++ $TMPDIR/g++
export PATH=$TMPDIR:$PATH
'';
2014-10-28 04:16:14 +00:00
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
cat >> $out/nix-support/setup-hook <<EOF
export DYLD_INSERT_LIBRARIES="$DYLD_INSERT_LIBRARIES''${!DYLD_INSERT_LIBRARIES:+:}${v8}/lib/libv8.dylib"
EOF
'';
2014-10-28 04:16:14 +00:00
buildFlags = [
"--with-v8-dir=${v8}" "--with-v8-include=${v8}/include"
"--with-v8-lib=${v8}/lib"
];
};
2014-10-28 04:16:14 +00:00
}