Skip to content

Commit

Permalink
spidermonkey_60
Browse files Browse the repository at this point in the history
  • Loading branch information
hedning committed Sep 6, 2018
1 parent e7325fb commit 808c33c
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkgs/desktops/gnome-3/core/gjs/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ fetchurl, stdenv, pkgconfig, gnome3, gtk3, atk, gobjectIntrospection
, spidermonkey_52, pango, readline, glib, libxml2, dbus, gdk_pixbuf
, spidermonkey_60, pango, readline, glib, libxml2, dbus, gdk_pixbuf
, makeWrapper }:

stdenv.mkDerivation rec {
Expand All @@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig makeWrapper ];
buildInputs = [ libxml2 gobjectIntrospection gtk3 glib pango readline dbus ];

propagatedBuildInputs = [ spidermonkey_52 ];
propagatedBuildInputs = [ spidermonkey_60 ];

configureFlags = [
"--enable-installed-tests"
Expand Down
68 changes: 68 additions & 0 deletions pkgs/development/interpreters/spidermonkey/60.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{ stdenv, fetchurl, fetchpatch, autoconf213, pkgconfig, perl, python2, zip, which, readline, icu, zlib, nspr }:

let
version = "60.2.0";
in stdenv.mkDerivation rec {
name = "spidermonkey-${version}";

src = fetchurl {
url = "mirror://mozilla/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz";
sha256 = "05vpwyxsy7q6w6ff1r51wd69hzcl36rfkqr28gklq8s8as5xqnvr";
};

buildInputs = [ readline icu zlib nspr ];
nativeBuildInputs = [ autoconf213 pkgconfig perl which python2 zip ];

# Apparently this package fails to build correctly with modern compilers, which at least
# on ARMv6 causes polkit testsuite to break with an assertion failure in spidermonkey.
# These flags were stolen from:
# https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/js52
NIX_CFLAGS_COMPILE = "-fno-delete-null-pointer-checks -fno-strict-aliasing -fno-tree-vrp";

patches = [
(fetchpatch {
url = https://bug1415202.bmoattachments.org/attachment.cgi?id=8926363;
sha256 = "082ryrvqa3lvs67v3sq9kf2jshf4qp1fpi195wffc40jdrl8fnin";
})
(fetchpatch {
url = https://salsa.debian.org/gnome-team/mozjs52/raw/debian/master/debian/patches/fix-soname.patch;
sha256 = "0dd7z4z4v0sqvvxk2psvzfz5mbdac690jgb8rh8xn50pb35xgmfj";
})
# # needed to build gnome3.gjs
# (fetchpatch {
# name = "mozjs52-disable-mozglue.patch";
# url = https://git.archlinux.org/svntogit/packages.git/plain/trunk/mozjs52-disable-mozglue.patch?h=packages/js52&id=4279d2e18d9a44f6375f584911f63d13de7704be;
# sha256 = "18wkss0agdyff107p5lfflk72qiz350xqw2yqc353alkx4fsfpz0";
# })
];

preConfigure = ''
export CXXFLAGS="-fpermissive"
export LIBXUL_DIST=$out
export PYTHON="${python2.interpreter}"
cd js/src
autoconf
'';

configureFlags = [
"--with-system-nspr"
"--with-system-zlib"
"--with-system-icu"
"--with-intl-api"
"--enable-readline"
"--enable-shared-js"
"--enable-release"
];

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;
};
}
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7754,6 +7754,7 @@ with pkgs;
stdenv = overrideCC stdenv gcc6; # with gcc-7: undefined reference to `__divmoddi4'
}));
spidermonkey_52 = callPackage ../development/interpreters/spidermonkey/52.nix { };
spidermonkey_60 = callPackage ../development/interpreters/spidermonkey/60.nix { };
spidermonkey = spidermonkey_31;

ssm-agent = callPackage ../applications/networking/cluster/ssm-agent { };
Expand Down

0 comments on commit 808c33c

Please sign in to comment.