From 1dbd3a55c4790394ecf43fc8f3b2442856df8241 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Thu, 21 Mar 2013 13:56:33 +0100 Subject: [PATCH] libv8-rubygem: Implemented a very depressing workaround that allows scons to build libv8.a, it's ugly but it works --- .../development/interpreters/ruby/patches.nix | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/ruby/patches.nix b/pkgs/development/interpreters/ruby/patches.nix index 10b0b202387..c4da956b57c 100644 --- a/pkgs/development/interpreters/ruby/patches.nix +++ b/pkgs/development/interpreters/ruby/patches.nix @@ -1,5 +1,5 @@ { fetchurl, writeScript, ruby, ncurses, sqlite, libxml2, libxslt, libffi -, zlib, libuuid, gems, jdk, python }: +, zlib, libuuid, gems, jdk, python, stdenv }: let @@ -15,7 +15,32 @@ in { sup = { buildInputs = [ gems.ncursesw ]; }; - libv8 = { buildInputs = [ python ]; }; + 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++ <