Merge pull request #99008 from mkg20001/cjs-upgrade

Cjs upgrade
This commit is contained in:
WORLDofPEACE 2020-09-30 14:30:56 -04:00 committed by GitHub
commit 3451caf60b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 168 additions and 172 deletions

View File

@ -64,6 +64,10 @@ stdenv.mkDerivation rec {
url = "https://github.com/linuxmint/cinnamon/commit/ce99760fa15c3de2e095b9a5372eeaca646fbed1.patch";
sha256 = "0p2sbdi5w7sgblqbgisb6f8lcj1syzq5vlk0ilvwaqayxjylg8gz";
})
(fetchpatch {
url = "https://leigh123linux.fedorapeople.org/pub/patches/new_cjs.patch";
sha256 = "07biv3vkbn3jzijbdrxcw73p8xz2djbsax014mlkvmryrmys0rg4";
})
];
buildInputs = [

View File

@ -1,6 +1,4 @@
{ autoconf-archive
, autoreconfHook
, dbus-glib
{ dbus-glib
, fetchFromGitHub
, gobject-introspection
, pkgconfig
@ -17,26 +15,51 @@
, libffi
, gtk3
, readline
, spidermonkey_78
, meson
, sysprof
, dbus
, xvfb_run
, ninja
, makeWrapper
, which
, libxml2
}:
let
# https://github.com/linuxmint/cjs/issues/80
spidermonkey_52 = callPackage ./spidermonkey_52.nix {};
in
stdenv.mkDerivation rec {
pname = "cjs";
version = "4.6.0";
version = "4.6.0-gjs-1.66.0";
src = fetchFromGitHub {
owner = "linuxmint";
owner = "leigh123linux";
repo = pname;
rev = version;
sha256 = "1caa43cplb40dm1bwnwca7z4yafvnrncm96k7mih6kg3m87fxqi5";
rev = "gjs-1.66.0";
sha256 = "1pccz7h8mwljziflhn04gmfnbl99pvcj1byz1c6zn947v5gqskj1";
};
outputs = [ "out" "dev" ];
nativeBuildInputs = [
meson # ADDING cmake breaks the build, ignore meson warning
ninja
pkgconfig
makeWrapper
which # for locale detection
libxml2 # for xml-stripblanks
];
buildInputs = [
gobject-introspection
cairo
readline
spidermonkey_78
dbus # for dbus-run-session
];
checkInputs = [
xvfb_run
];
propagatedBuildInputs = [
glib
@ -47,25 +70,8 @@ stdenv.mkDerivation rec {
xapps
];
nativeBuildInputs = [
autoconf-archive
autoreconfHook
wrapGAppsHook
pkgconfig
];
buildInputs = [
# from .pc
gobject-introspection
libffi
spidermonkey_52 # mozjs-52
cairo # +cairo-gobject
gtk3
# other
dbus-glib
readline
mesonFlags = [
"-Dprofiler=disabled"
];
meta = with stdenv.lib; {
@ -77,11 +83,12 @@ stdenv.mkDerivation rec {
'';
license = with licenses; [
gpl2Plus
lgpl2Plus
mit
mpl11
];
gpl2Plus
lgpl2Plus
mit
mpl11
];
platforms = platforms.linux;
maintainers = teams.cinnamon.members;
};

View File

@ -1,39 +0,0 @@
From 1b802175914418f5675047c34f1ab1593dd35b18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= <mkg20001@gmail.com>
Date: Wed, 8 Jan 2020 11:04:27 +0100
Subject: [PATCH] fix werror
---
js/src/moz.build | 2 +-
js/src/shell/moz.build | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/js/src/moz.build b/js/src/moz.build
index 1162cb70c..595ea9842 100644
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -785,7 +785,7 @@ if CONFIG['JS_HAS_CTYPES']:
DEFINES['FFI_BUILDING'] = True
if CONFIG['GNU_CXX']:
- CXXFLAGS += ['-Wno-shadow', '-Werror=format']
+ CXXFLAGS += ['-Wno-shadow']
# Suppress warnings in third-party code.
if CONFIG['CLANG_CXX']:
diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build
index 72ea8145c..77475b241 100644
--- a/js/src/shell/moz.build
+++ b/js/src/shell/moz.build
@@ -51,7 +51,7 @@ shellmoduleloader.inputs = [
]
if CONFIG['GNU_CXX']:
- CXXFLAGS += ['-Wno-shadow', '-Werror=format']
+ CXXFLAGS += ['-Wno-shadow']
# This is intended as a temporary workaround to enable VS2015.
if CONFIG['_MSC_VER']:
--
2.17.1

View File

@ -1,95 +0,0 @@
{ stdenv, fetchurl, fetchpatch, autoconf213, pkgconfig, perl, zip, which, readline, icu, zlib, nspr, buildPackages }:
let
version = "52.9.0";
in stdenv.mkDerivation {
pname = "spidermonkey";
inherit version;
src = fetchurl {
url = "mirror://mozilla/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz";
sha256 = "1mlx34fgh1kaqamrkl5isf0npch3mm6s4lz3jsjb7hakiijhj7f0";
};
outputs = [ "out" "dev" ];
setOutputFlags = false; # Configure script only understands --includedir
buildInputs = [ readline icu zlib nspr ];
nativeBuildInputs = [ autoconf213 pkgconfig perl which buildPackages.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 = [
# 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";
})
(fetchpatch {
url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/no-error.diff?h=packages/js52";
sha256 = "1vsw6558lxiy0r1mg6y49cgddan1mfqvqlkyv734bgxyg6n3pb9i";
})
./fix-werror.patch
];
configurePlatforms = [ ];
preConfigure = ''
export CXXFLAGS="-fpermissive"
export LIBXUL_DIST=$out
export PYTHON="${buildPackages.python2.interpreter}"
configureFlagsArray+=("--includedir=$dev/include")
cd js/src
autoconf
'';
configureFlags = [
"--with-nspr-prefix=${nspr}"
"--with-system-zlib"
"--with-system-icu"
"--with-intl-api"
"--enable-readline"
"--enable-shared-js"
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-jemalloc"
++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"--host=${stdenv.buildPlatform.config}"
"--target=${stdenv.hostPlatform.config}"
];
makeFlags = [
"HOST_CC=${buildPackages.stdenv.cc}/bin/cc"
];
depsBuildBuild = [ buildPackages.stdenv.cc ];
enableParallelBuilding = true;
postInstall = ''
moveToOutput bin/js52-config "$dev"
# Nuke a static lib.
rm $out/lib/libjs_static.ajs
'';
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;
# Commented out so hydra builds the package
# (I know what you're thinking now, but cjs won't be pulling anything from the network
# and modules are allowed to execute commands anyways, so an RCE is basically irrelevant)
#
# knownVulnerabilities = [
# "The runtime was extracted from Firefox 52, which EOLd on September 5, 2018."
# ];
};
}

View File

@ -0,0 +1,118 @@
{ stdenv
, fetchurl
, fetchpatch
, autoconf213
, pkgconfig
, perl
, python3
, zip
, buildPackages
, which
, readline
, zlib
, icu67
, cargo
, rustc
, rust-cbindgen
, yasm
, llvmPackages
, nspr
}:
stdenv.mkDerivation rec {
pname = "spidermonkey";
version = "78.1.0";
src = fetchurl {
url = "mirror://mozilla/firefox/releases/${version}esr/source/firefox-${version}esr.source.tar.xz";
sha256 = "18k47dl9hbnpqw69csxjar5dhwa7r8k7j9kvcfgmwb1iv6ba601n";
};
outputs = [ "out" "dev" ];
setOutputFlags = false; # Configure script only understands --includedir
nativeBuildInputs = [
autoconf213
cargo
llvmPackages.llvm # for llvm-objdump
perl
pkgconfig
python3
rust-cbindgen
rustc
which
yasm # to buid icu? seems weird
zip
];
buildInputs = [
icu67
nspr
readline
zlib
];
patches = [
# https://mail.gnome.org/archives/distributor-list/2020-August/msg00000.html
(fetchpatch {
url = "https://github.com/ptomato/mozjs/commit/b2974f8a6558d2dc4517b49ee313a9900a853285.patch";
sha256 = "1bl5mbx7gmad6fmpc427263i1ychi2linpg69kxlr2w91r5m6ji3";
})
(fetchpatch {
url = "https://github.com/ptomato/mozjs/commit/e5a2eb99f653ae03c67e536df1d55d265a0a1605.patch";
sha256 = "0xhy63nw2byibmjc41yh6dwpg282nylganrs5aprn9pbqbcpsvif";
})
];
preConfigure = ''
export CXXFLAGS="-fpermissive"
export LIBXUL_DIST=$out
export PYTHON="${buildPackages.python3.interpreter}"
# We can't build in js/src/, so create a build dir
mkdir obj
cd obj/
configureScript=../js/src/configure
'';
configureFlags = [
"--with-system-zlib"
"--with-system-nspr"
"--with-system-icu"
"--with-intl-api"
"--enable-readline"
"--enable-shared-js"
"--disable-jemalloc"
# 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"
] ++ stdenv.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}"
];
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;
};
}

View File

@ -10354,6 +10354,7 @@ in
}));
spidermonkey_60 = callPackage ../development/interpreters/spidermonkey/60.nix { };
spidermonkey_68 = callPackage ../development/interpreters/spidermonkey/68.nix { };
spidermonkey_78 = callPackage ../development/interpreters/spidermonkey/78.nix { };
spidermonkey = spidermonkey_38;
ssm-agent = callPackage ../applications/networking/cluster/ssm-agent { };