git.iko.soy/typeable/nixpkgs
on master help sign in
spidermonkey_52: init at 52.9.0
commitfa3d651ee73c8d0fa5f450b405bd7169138b6450 authorMaciej Krüger <mkg20001@gmail.com> dateSat 7 Dec 2019, 08:57 (7 years ago) parent37771e4
2 files changed+134
pkgs/desktops/cinnamon/cjs/fix-werror.patch+39 pkgs/desktops/cinnamon/cjs/spidermonkey_52.nix+95
pkgs/desktops/cinnamon/cjs/fix-werror.patchnew file+39
@@ -0,0 +1,39 @@
1+From 1b802175914418f5675047c34f1ab1593dd35b18 Mon Sep 17 00:00:00 2001
2+From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= <mkg20001@gmail.com>
3+Date: Wed, 8 Jan 2020 11:04:27 +0100
4+Subject: [PATCH] fix werror
5+
6+---
7+ js/src/moz.build | 2 +-
8+ js/src/shell/moz.build | 2 +-
9+ 2 files changed, 2 insertions(+), 2 deletions(-)
10+
11+diff --git a/js/src/moz.build b/js/src/moz.build
12+index 1162cb70c..595ea9842 100644
13+--- a/js/src/moz.build
14++++ b/js/src/moz.build
15+@@ -785,7 +785,7 @@ if CONFIG['JS_HAS_CTYPES']:
16+ DEFINES['FFI_BUILDING'] = True
17+
18+ if CONFIG['GNU_CXX']:
19+- CXXFLAGS += ['-Wno-shadow', '-Werror=format']
20++ CXXFLAGS += ['-Wno-shadow']
21+
22+ # Suppress warnings in third-party code.
23+ if CONFIG['CLANG_CXX']:
24+diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build
25+index 72ea8145c..77475b241 100644
26+--- a/js/src/shell/moz.build
27++++ b/js/src/shell/moz.build
28+@@ -51,7 +51,7 @@ shellmoduleloader.inputs = [
29+ ]
30+
31+ if CONFIG['GNU_CXX']:
32+- CXXFLAGS += ['-Wno-shadow', '-Werror=format']
33++ CXXFLAGS += ['-Wno-shadow']
34+
35+ # This is intended as a temporary workaround to enable VS2015.
36+ if CONFIG['_MSC_VER']:
37+--
38+2.17.1
39+
pkgs/desktops/cinnamon/cjs/spidermonkey_52.nixnew file+95
@@ -0,0 +1,95 @@
1+{ stdenv, fetchurl, fetchpatch, autoconf213, pkgconfig, perl, zip, which, readline, icu, zlib, nspr, buildPackages }:
2+
3+let
4+ version = "52.9.0";
5+in stdenv.mkDerivation {
6+ pname = "spidermonkey";
7+ inherit version;
8+
9+ src = fetchurl {
10+ url = "mirror://mozilla/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz";
11+ sha256 = "1mlx34fgh1kaqamrkl5isf0npch3mm6s4lz3jsjb7hakiijhj7f0";
12+ };
13+
14+ outputs = [ "out" "dev" ];
15+ setOutputFlags = false; # Configure script only understands --includedir
16+
17+ buildInputs = [ readline icu zlib nspr ];
18+ nativeBuildInputs = [ autoconf213 pkgconfig perl which buildPackages.python2 zip ];
19+
20+ # Apparently this package fails to build correctly with modern compilers, which at least
21+ # on ARMv6 causes polkit testsuite to break with an assertion failure in spidermonkey.
22+ # These flags were stolen from:
23+ # https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/js52
24+ NIX_CFLAGS_COMPILE = "-fno-delete-null-pointer-checks -fno-strict-aliasing -fno-tree-vrp";
25+
26+ patches = [
27+ # needed to build gnome3.gjs
28+ (fetchpatch {
29+ name = "mozjs52-disable-mozglue.patch";
30+ url = https://git.archlinux.org/svntogit/packages.git/plain/trunk/mozjs52-disable-mozglue.patch?h=packages/js52&id=4279d2e18d9a44f6375f584911f63d13de7704be;
31+ sha256 = "18wkss0agdyff107p5lfflk72qiz350xqw2yqc353alkx4fsfpz0";
32+ })
33+ (fetchpatch {
34+ url = https://git.archlinux.org/svntogit/packages.git/plain/trunk/no-error.diff?h=packages/js52;
35+ sha256 = "1vsw6558lxiy0r1mg6y49cgddan1mfqvqlkyv734bgxyg6n3pb9i";
36+ })
37+ ./fix-werror.patch
38+ ];
39+
40+ configurePlatforms = [ ];
41+
42+ preConfigure = ''
43+ export CXXFLAGS="-fpermissive"
44+ export LIBXUL_DIST=$out
45+ export PYTHON="${buildPackages.python2.interpreter}"
46+ configureFlagsArray+=("--includedir=$dev/include")
47+
48+ cd js/src
49+
50+ autoconf
51+ '';
52+
53+ configureFlags = [
54+ "--with-nspr-prefix=${nspr}"
55+ "--with-system-zlib"
56+ "--with-system-icu"
57+ "--with-intl-api"
58+ "--enable-readline"
59+ "--enable-shared-js"
60+ ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-jemalloc"
61+ ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
62+ "--host=${stdenv.buildPlatform.config}"
63+ "--target=${stdenv.hostPlatform.config}"
64+ ];
65+
66+ makeFlags = [
67+ "HOST_CC=${buildPackages.stdenv.cc}/bin/cc"
68+ ];
69+
70+ depsBuildBuild = [ buildPackages.stdenv.cc ];
71+
72+ enableParallelBuilding = true;
73+
74+ postInstall = ''
75+ moveToOutput bin/js52-config "$dev"
76+ # Nuke a static lib.
77+ rm $out/lib/libjs_static.ajs
78+ '';
79+
80+ meta = with stdenv.lib; {
81+ description = "Mozilla's JavaScript engine written in C/C++";
82+ homepage = https://developer.mozilla.org/en/SpiderMonkey;
83+ license = licenses.gpl2; # TODO: MPL/GPL/LGPL tri-license.
84+ maintainers = [ maintainers.abbradar ];
85+ platforms = platforms.linux;
86+
87+ # Commented out so hydra builds the package
88+ # (I know what you're thinking now, but cjs won't be pulling anything from the network
89+ # and modules are allowed to execute commands anyways, so an RCE is basically irrelevant)
90+ #
91+ # knownVulnerabilities = [
92+ # "The runtime was extracted from Firefox 52, which EOL’d on September 5, 2018."
93+ # ];
94+ };
95+}