diff options
author | Tor Hedin Brønner <torhedinbronner@gmail.com> | 2020-02-07 04:20:17 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2020-03-24 07:06:55 +0100 |
commit | 4ee2aac07568d80aa7e2bc175dbdb3d98bcf462c (patch) | |
tree | 1efb65d08399ccf9e71feca0f85c07ecd4cd4d33 /pkgs/development/interpreters/spidermonkey | |
parent | 986fbf47998f6ad70a084e702db24c11a01e5a83 (diff) | |
download | nixlib-4ee2aac07568d80aa7e2bc175dbdb3d98bcf462c.tar nixlib-4ee2aac07568d80aa7e2bc175dbdb3d98bcf462c.tar.gz nixlib-4ee2aac07568d80aa7e2bc175dbdb3d98bcf462c.tar.bz2 nixlib-4ee2aac07568d80aa7e2bc175dbdb3d98bcf462c.tar.lz nixlib-4ee2aac07568d80aa7e2bc175dbdb3d98bcf462c.tar.xz nixlib-4ee2aac07568d80aa7e2bc175dbdb3d98bcf462c.tar.zst nixlib-4ee2aac07568d80aa7e2bc175dbdb3d98bcf462c.zip |
spidermonkey_68: init at 68.4.2
mostly copied over - now uses python3 https://mail.gnome.org/archives/distributor-list/2020-February/msg00000.html
Diffstat (limited to 'pkgs/development/interpreters/spidermonkey')
-rw-r--r-- | pkgs/development/interpreters/spidermonkey/68.nix | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/spidermonkey/68.nix b/pkgs/development/interpreters/spidermonkey/68.nix new file mode 100644 index 000000000000..807a26a7b95b --- /dev/null +++ b/pkgs/development/interpreters/spidermonkey/68.nix @@ -0,0 +1,95 @@ +{ stdenv, fetchurl, fetchpatch, autoconf213, pkgconfig, perl, python2, python3, zip, buildPackages +, which, readline, zlib, icu, cargo, rustc, llvmPackages }: + +with stdenv.lib; + +let + python3Env = buildPackages.python3.withPackages (p: [p.six]); +in stdenv.mkDerivation rec { + pname = "spidermonkey"; + version = "68.4.2"; + + src = fetchurl { + url = "mirror://mozilla/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz"; + sha256 = "1x1fglg1b85hb0srd6k7n5svl0nlgdm4njc8q13s2750v5ck4ljx"; + }; + + outputs = [ "out" "dev" ]; + setOutputFlags = false; # Configure script only understands --includedir + + nativeBuildInputs = [ + autoconf213 + pkgconfig + perl + which + python2 + zip + cargo + rustc + llvmPackages.llvm + ]; + + buildInputs = [ + readline + zlib + icu + ]; + + preConfigure = '' + export CXXFLAGS="-fpermissive" + export LIBXUL_DIST=$out + export PYTHON3="${python3Env.interpreter}" + + # We can't build in js/src/, so create a build dir + mkdir obj + cd obj/ + configureScript=../js/src/configure + ''; + + configureFlags = [ + # Reccommended by gjs upstream + "--disable-jemalloc" + "--enable-unaligned-private-values" + "--with-intl-api" + "--enable-posix-nspr-emulation" + "--with-system-zlib" + "--with-system-icu" + + "--with-libclang-path=${llvmPackages.libclang}/lib" + "--with-clang-path=${llvmPackages.clang}/bin/clang" + + "--enable-shared-js" + "--enable-readline" + # Fedora and Arch disable optimize, but it doesn't seme to be necessary + # It turns on -O3 which some gcc version had a problem with: + # https://src.fedoraproject.org/rpms/mozjs38/c/761399aba092bcb1299bb4fccfd60f370ab4216e + "--enable-optimize" + "--enable-release" + ] ++ 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}" + ]; + + configurePlatforms = []; + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + + # Remove unnecessary static lib + preFixup = '' + moveToOutput bin/js60-config "$dev" + rm $out/lib/libjs_static.ajs + ln -s $out/bin/js60 $out/bin/js + ''; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + description = "Mozilla's JavaScript engine written in C/C++"; + homepage = https://developer.mozilla.org/en/SpiderMonkey; + license = licenses.gpl2; # TODO: MPL/GPL/LGPL tri-license. + maintainers = [ maintainers.abbradar ]; + platforms = platforms.linux; + }; +} |