@@ -1,72 +0,0 @@
1−{ lib, stdenv, fetchurl, pkg-config, gnused_422, perl, python2, zip, libffi, readline, icu, zlib, buildPackages
2−, libobjc }:
3−
4−with lib;
5−
6−stdenv.mkDerivation rec {
7− version = "38.8.0";
8− pname = "spidermonkey";
9−
10− src = fetchurl {
11− url = "mirror://mozilla/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.bz2";
12− sha256 = "10lrync6cxnjlnadc0j3vg8r2dq9b3wwanw8qj1h6ncxwb7asxcl";
13− };
14−
15− buildInputs = [ libffi readline icu zlib ]
16− ++ lib.optional stdenv.isDarwin libobjc;
17− nativeBuildInputs = [ pkg-config perl python2 zip gnused_422 ];
18−
19− postUnpack = "sourceRoot=\${sourceRoot}/js/src";
20−
21− preConfigure = ''
22− export CXXFLAGS="-fpermissive"
23− export LIBXUL_DIST=$out
24− export PYTHON="${buildPackages.python2.interpreter}"
25− '';
26−
27− configureFlags = [
28− "--enable-threadsafe"
29− "--with-system-ffi"
30− "--enable-posix-nspr-emulation"
31− "--with-system-zlib"
32− "--with-system-icu"
33− "--enable-readline"
34−
35− # enabling these because they're wanted by 0ad. They may or may
36− # not be good defaults for other uses.
37− "--enable-gcgenerational"
38− "--enable-shared-js"
39− ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
40− # Spidermonkey seems to use different host/build terminology for cross
41− # compilation here.
42− "--host=${stdenv.buildPlatform.config}"
43− "--target=${stdenv.hostPlatform.config}"
44− ];
45−
46− configurePlatforms = [];
47−
48− depsBuildBuild = [ buildPackages.stdenv.cc ];
49−
50− # This addresses some build system bug. It's quite likely to be safe
51− # to re-enable parallel builds if the source revision changes.
52− enableParallelBuilding = true;
53−
54− postFixup = ''
55− # The headers are symlinks to a directory that doesn't get put
56− # into $out, so they end up broken. Fix that by just resolving the
57− # symlinks.
58− for i in $(find $out -type l); do
59− cp --remove-destination "$(readlink "$i")" "$i";
60− done
61− '';
62−
63− meta = with lib; {
64− description = "Mozilla's JavaScript engine written in C/C++";
65− homepage = "https://developer.mozilla.org/en/SpiderMonkey";
66− # TODO: MPL/GPL/LGPL tri-license.
67−
68− maintainers = [ maintainers.abbradar ];
69− platforms = platforms.unix;
70− knownVulnerabilities = [ "SpiderMonkey 38 is outdated and contains known security vulnerabilities." ]; # as per https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/38
71− };
72−}