spidermonkey: Use more system dependencies and fix for perl 5.22

This commit is contained in:
William A. Kennington III 2015-07-07 00:01:16 -07:00
parent 731b4a4371
commit f36a9a798e

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, nspr, perl, python, zip }:
{ stdenv, fetchurl, pkgconfig, nspr, perl, python, zip, libffi, readline }:
stdenv.mkDerivation rec {
version = "17.0.0";
@ -11,16 +11,26 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [ nspr ];
buildInputs = [ pkgconfig perl python zip ];
buildInputs = [ pkgconfig perl python zip libffi readline ];
postUnpack = "sourceRoot=\${sourceRoot}/js/src";
postPatch = ''
# Fixes an issue with version detection under perl 5.22.x
sed -i 's/(defined\((@TEMPLATE_FILE)\))/\1/' config/milestone.pl
'';
preConfigure = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${nspr}/include/nspr"
export LIBXUL_DIST=$out
'';
configureFlags = [ "--enable-threadsafe" "--with-system-nspr" ];
configureFlags = [
"--enable-threadsafe"
"--with-system-nspr"
"--with-system-ffi"
"--enable-readline"
];
# hack around a make problem, see https://github.com/NixOS/nixpkgs/issues/1279#issuecomment-29547393
preBuild = "touch -- {.,shell,jsapi-tests}/{-lpthread,-ldl}";