diff options
author | ajs124 <git@ajs124.de> | 2021-10-09 03:19:37 +0200 |
---|---|---|
committer | ajs124 <git@ajs124.de> | 2021-11-07 01:16:29 +0100 |
commit | 59b832d51a016675256f5d828f563d8be9b2ce3f (patch) | |
tree | 4147b9824e95b53303e92eb2d63b18fcf8645427 /pkgs/development/interpreters/spidermonkey | |
parent | 5f12f89a6ff32543ad7661c788f93cd9ffbd2010 (diff) |
spidermonkey_91: init at 91.3.0
Diffstat (limited to 'pkgs/development/interpreters/spidermonkey')
-rw-r--r-- | pkgs/development/interpreters/spidermonkey/91.nix | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/spidermonkey/91.nix b/pkgs/development/interpreters/spidermonkey/91.nix new file mode 100644 index 0000000000000..953a4c506b5cf --- /dev/null +++ b/pkgs/development/interpreters/spidermonkey/91.nix @@ -0,0 +1,119 @@ +{ lib, stdenv +, fetchurl +, pkg-config +, perl +, python3 +, zip +, buildPackages +, which +, readline +, zlib +, icu69 +, cargo +, rustc +, rust-cbindgen +, yasm +, llvmPackages_latest +, nspr +, m4 +}: + +stdenv.mkDerivation rec { + pname = "spidermonkey"; + version = "91.3.0"; + + src = fetchurl { + url = "mirror://mozilla/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"; + sha256 = "0v79c435vfbhsx7pqyq4jm5rv8iysig69wwqhvys1n0jy54m72qj"; + }; + + outputs = [ "out" "dev" ]; + setOutputFlags = false; # Configure script only understands --includedir + + nativeBuildInputs = [ + cargo + llvmPackages_latest.llvm # for llvm-objdump + perl + pkg-config + python3 + rust-cbindgen + rustc + which + yasm # to buid icu? seems weird + zip + m4 + ]; + + buildInputs = [ + icu69 + nspr + readline + zlib + ]; + + preConfigure = '' + export LIBXUL_DIST=$out + export PYTHON="${buildPackages.python3.interpreter}" + export M4=m4 + export AWK=awk + export AC_MACRODIR=$PWD/build/autoconf/ + + pushd js/src + sh ../../build/autoconf/autoconf.sh --localdir=$PWD configure.in > configure + chmod +x configure + popd + # We can't build in js/src/, so create a build dir + mkdir obj + cd obj/ + configureScript=../js/src/configure + ''; + + configureFlags = [ + "--with-intl-api" + "--with-system-icu" + "--with-system-nspr" + "--with-system-zlib" + "--enable-optimize" + "--enable-readline" + "--enable-release" + "--enable-shared-js" + "--disable-debug" + "--disable-jemalloc" + "--disable-strip" + "--disable-tests" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + # Spidermonkey seems to use different host/build terminology for cross + # compilation here. + "--host=${stdenv.buildPlatform.config}" + "--target=${stdenv.hostPlatform.config}" + ]; + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + + # Remove unnecessary static lib + preFixup = '' + moveToOutput bin/js91-config "$dev" + rm $out/lib/libjs_static.ajs + ln -s $out/bin/js91 $out/bin/js + ''; + + enableParallelBuilding = true; + + postPatch = '' + # This patch is a manually applied fix of + # https://bugzilla.mozilla.org/show_bug.cgi?id=1644600 + # Once that bug is fixed, this can be removed. + # This is needed in, for example, `zeroad`. + substituteInPlace js/public/StructuredClone.h \ + --replace "class SharedArrayRawBufferRefs {" \ + "class JS_PUBLIC_API SharedArrayRawBufferRefs {" + ''; + + meta = with lib; { + description = "Mozilla's JavaScript engine written in C/C++"; + homepage = "https://spidermonkey.dev/"; + license = licenses.mpl20; + maintainers = with maintainers; [ lostnet ]; + platforms = platforms.linux; + }; +} |