Merge pull request #20586 from abbradar/spidermonkey

SpiderMonkey cleanup
This commit is contained in:
Nikolay Amiantov 2016-11-22 11:46:14 +03:00 committed by GitHub
commit 69e649503f
17 changed files with 104 additions and 123 deletions

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, perl, ncurses, xlibsWrapper, bzip2, zlib, openssl { stdenv, fetchurl, perl, ncurses, xlibsWrapper, bzip2, zlib, openssl
, spidermonkey, gpm , spidermonkey_1_8_5, gpm
, enableGuile ? false, guile ? null # Incompatible licenses, LGPLv3 - GPLv2 , enableGuile ? false, guile ? null # Incompatible licenses, LGPLv3 - GPLv2
, enablePython ? false, python ? null , enablePython ? false, python ? null
}: }:
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
patches = [ ./gc-init.patch ]; patches = [ ./gc-init.patch ];
buildInputs = [ perl ncurses xlibsWrapper bzip2 zlib openssl spidermonkey gpm ] buildInputs = [ perl ncurses xlibsWrapper bzip2 zlib openssl spidermonkey_1_8_5 gpm ]
++ stdenv.lib.optional enableGuile guile ++ stdenv.lib.optional enableGuile guile
++ stdenv.lib.optional enablePython python; ++ stdenv.lib.optional enablePython python;
@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
'' ''
--enable-finger --enable-html-highlight --enable-finger --enable-html-highlight
--with-perl --enable-gopher --enable-cgi --enable-bittorrent --with-perl --enable-gopher --enable-cgi --enable-bittorrent
--with-spidermonkey=${spidermonkey} --with-spidermonkey=${spidermonkey_1_8_5}
--enable-nntp --with-openssl=${openssl.dev} --enable-nntp --with-openssl=${openssl.dev}
'' + stdenv.lib.optionalString enableGuile " --with-guile" '' + stdenv.lib.optionalString enableGuile " --with-guile"
+ stdenv.lib.optionalString enablePython " --with-python"; + stdenv.lib.optionalString enablePython " --with-python";

View File

@ -1,36 +0,0 @@
{ stdenv, fetchurl, readline, nspr }:
stdenv.mkDerivation rec {
version = "1.8.0-rc1";
name = "spidermonkey-${version}";
src = fetchurl {
url = "mirror://mozilla/js/js-${version}.tar.gz";
sha256 = "374398699ac3fd802d98d642486cf6b0edc082a119c9c9c499945a0bc73e3413";
};
buildInputs = [ readline nspr ];
postUnpack = "sourceRoot=\${sourceRoot}/src";
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.isi686 "pic";
makefileExtra = ./Makefile.extra;
makefile = "Makefile.ref";
patchPhase =
''
cat ${makefileExtra} >> ${makefile}
sed -e 's/ -ltermcap/ -lncurses/' -i ${makefile}
'';
preConfigure = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${nspr.dev}/include/nspr"
'';
makeFlags = "-f ${makefile} JS_DIST=\${out} BUILD_OPT=1 JS_READLINE=1 JS_THREADSAFE=1";
meta = {
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -1,11 +1,11 @@
{ stdenv, autoconf213, fetchurl, pkgconfig, nspr, perl, python2, zip }: { stdenv, lib, autoconf213, fetchurl, pkgconfig, nspr, perl, python2, zip }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "185-1.0.0";
name = "spidermonkey-${version}"; name = "spidermonkey-${version}";
version = "1.8.5";
src = fetchurl { src = fetchurl {
url = "mirror://mozilla/js/js${version}.tar.gz"; url = "mirror://mozilla/js/js185-1.0.0.tar.gz";
sha256 = "5d12f7e1f5b4a99436685d97b9b7b75f094d33580227aa998c406bbae6f2a687"; sha256 = "5d12f7e1f5b4a99436685d97b9b7b75f094d33580227aa998c406bbae6f2a687";
}; };
@ -19,14 +19,14 @@ stdenv.mkDerivation rec {
preConfigure = '' preConfigure = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${nspr.dev}/include/nspr" export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${nspr.dev}/include/nspr"
export LIBXUL_DIST=$out export LIBXUL_DIST=$out
${if stdenv.isArm then "autoreconf --verbose --force" else ""} ${lib.optionalString stdenv.isArm "autoreconf --verbose --force"}
''; '';
patches = stdenv.lib.optionals stdenv.isArm [ patches = stdenv.lib.optionals stdenv.isArm [
# Explained below in configureFlags for ARM # Explained below in configureFlags for ARM
./findvanilla.patch ./1.8.5-findvanilla.patch
# Fix for hard float flags. # Fix for hard float flags.
./arm-flags.patch ./1.8.5-arm-flags.patch
]; ];
patchFlags = "-p3"; patchFlags = "-p3";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, nspr, perl, python2, zip, libffi, readline }: { stdenv, fetchurl, pkgconfig, nspr, perl, python2, zip, libffi, readline, icu }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "24.2.0"; version = "24.2.0";
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [ nspr ]; propagatedBuildInputs = [ nspr ];
buildInputs = [ pkgconfig perl python2 zip libffi readline ]; buildInputs = [ pkgconfig perl python2 zip libffi readline icu ];
postPatch = '' postPatch = ''
# Fixes an issue with version detection under perl 5.22.x # Fixes an issue with version detection under perl 5.22.x
@ -32,6 +32,7 @@ stdenv.mkDerivation rec {
"--libdir=$(lib)/lib" "--libdir=$(lib)/lib"
"--includedir=$(dev)/include" "--includedir=$(dev)/include"
"--enable-threadsafe" "--enable-threadsafe"
"--with-system-icu"
"--with-system-nspr" "--with-system-nspr"
"--with-system-ffi" "--with-system-ffi"
"--enable-readline" "--enable-readline"

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, perl, python2, zip, libffi, readline }: { stdenv, fetchurl, pkgconfig, perl, python2, zip, libffi, nspr, icu, readline }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "31.5.0"; version = "31.5.0";
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
sha256 = "1q8icql5hh1g3gzg5fp4rl9rfagyhm9gilfn3dgi7qn4i1mrfqsd"; sha256 = "1q8icql5hh1g3gzg5fp4rl9rfagyhm9gilfn3dgi7qn4i1mrfqsd";
}; };
buildInputs = [ pkgconfig perl python2 zip libffi readline ]; buildInputs = [ pkgconfig perl python2 zip libffi readline nspr icu ];
postUnpack = "sourceRoot=\${sourceRoot}/js/src"; postUnpack = "sourceRoot=\${sourceRoot}/js/src";
@ -25,6 +25,8 @@ stdenv.mkDerivation rec {
configureFlags = [ configureFlags = [
"--enable-threadsafe" "--enable-threadsafe"
"--with-system-ffi" "--with-system-ffi"
"--with-system-nspr"
"--with-system-icu"
"--enable-readline" "--enable-readline"
# enabling these because they're wanted by 0ad. They may or may # enabling these because they're wanted by 0ad. They may or may

View File

@ -0,0 +1,61 @@
{ stdenv, fetchurl, pkgconfig, perl, python2, zip, libffi, readline, icu, zlib, nspr }:
stdenv.mkDerivation rec {
version = "38.2.1.rc0";
name = "spidermonkey-${version}";
# the release notes point to some guys home directory, see
# https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/38
# probably it would be more ideal to pull a particular tag/revision
# from the mercurial repo
src = fetchurl {
url = "https://people.mozilla.org/~sstangl/mozjs-${version}.tar.bz2";
sha256 = "0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681";
};
buildInputs = [ pkgconfig perl python2 zip libffi readline icu zlib nspr ];
postUnpack = "sourceRoot=\${sourceRoot}/js/src";
preConfigure = ''
export CXXFLAGS="-fpermissive"
export LIBXUL_DIST=$out
export PYTHON="${python2.interpreter}"
'';
configureFlags = [
"--enable-threadsafe"
"--with-system-ffi"
"--with-system-nspr"
"--with-system-zlib"
"--with-system-icu"
"--enable-readline"
# enabling these because they're wanted by 0ad. They may or may
# not be good defaults for other uses.
"--enable-gcgenerational"
"--enable-shared-js"
];
# This addresses some build system bug. It's quite likely to be safe
# to re-enable parallel builds if the source revision changes.
enableParallelBuilding = true;
postFixup = ''
# The headers are symlinks to a directory that doesn't get put
# into $out, so they end up broken. Fix that by just resolving the
# symlinks.
for i in $(find $out -type l); do
cp --remove-destination "$(readlink "$i")" "$i";
done
'';
meta = with stdenv.lib; {
description = "Mozilla's JavaScript engine written in C/C++";
homepage = https://developer.mozilla.org/en/SpiderMonkey;
# TODO: MPL/GPL/LGPL tri-license.
maintainers = [ maintainers.abbradar ];
platforms = platforms.linux;
};
}

View File

@ -1,10 +0,0 @@
install: $(PROGRAM) $(SHARED_LIBRARY)
mkdir -pv $(DIST)/{bin,lib}
mkdir -pv $(DIST)/include
cp -v $(PROGRAM) $(DIST)/bin
cp -v $(SHARED_LIBRARY) $(LIBRARY) $(DIST)/lib
cp -v $(JS_HFILES) $(API_HFILES) $(OTHER_HFILES) $(DIST)/include
mkdir -pv $(DIST)/include/js
find . -name '*.h' -exec cp '{}' $(DIST)/include/js ';'
find . -name '*.msg' -exec cp '{}' $(DIST)/include/js ';'

View File

@ -1,37 +0,0 @@
{ stdenv, fetchurl, readline }:
stdenv.mkDerivation rec {
name = "spidermonkey-1.7";
src = fetchurl {
url = mirror://mozilla/js/js-1.7.0.tar.gz;
sha256 = "12v6v2ccw1y6ng3kny3xw0lfs58d1klylqq707k0x04m707kydj4";
};
hardeningDisable = [ "format" ]
++ stdenv.lib.optional stdenv.isi686 "stackprotector";
buildInputs = [ readline ];
postUnpack = "sourceRoot=\${sourceRoot}/src";
makefileExtra = ./Makefile.extra;
makefile = "Makefile.ref";
patchPhase =
''
cat ${makefileExtra} >> ${makefile}
sed -e 's/ -ltermcap/ -lncurses/' -i ${makefile}
'';
CFLAGS = "-DPIC -fPIC -DJS_C_STRINGS_ARE_UTF8";
makeFlags = "-f ${makefile} JS_DIST=\${out} BUILD_OPT=1 JS_READLINE=1";
meta = with stdenv.lib; {
description = "Mozilla's JavaScript engine written in C/C++";
homepage = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey";
license = licenses.mpl20;
platforms = platforms.all;
};
}

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, glib, expat, pam, intltool, spidermonkey { stdenv, fetchurl, pkgconfig, glib, expat, pam, intltool, spidermonkey_17
, gobjectIntrospection, libxslt, docbook_xsl, docbook_xml_dtd_412 , gobjectIntrospection, libxslt, docbook_xsl, docbook_xml_dtd_412
, useSystemd ? stdenv.isLinux, systemd }: , useSystemd ? stdenv.isLinux, systemd }:
@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
outputs = [ "bin" "dev" "out" ]; # small man pages in $bin outputs = [ "bin" "dev" "out" ]; # small man pages in $bin
buildInputs = buildInputs =
[ pkgconfig glib expat pam intltool spidermonkey gobjectIntrospection ] [ pkgconfig glib expat pam intltool spidermonkey_17 gobjectIntrospection ]
++ [ libxslt docbook_xsl docbook_xml_dtd_412 ] # man pages ++ [ libxslt docbook_xsl docbook_xml_dtd_412 ] # man pages
++ stdenv.lib.optional useSystemd systemd; ++ stdenv.lib.optional useSystemd systemd;

View File

@ -2,11 +2,11 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "0ad-data-${version}"; name = "0ad-data-${version}";
version = "0.0.20"; version = "0.0.21";
src = fetchurl { src = fetchurl {
url = "http://releases.wildfiregames.com/0ad-${version}-alpha-unix-data.tar.xz"; url = "http://releases.wildfiregames.com/0ad-${version}-alpha-unix-data.tar.xz";
sha256 = "1lzl8chfqbgs1n9vpn0xaqd70kpwiibfk196iblyq6qkms3v6pnv"; sha256 = "15xadyrpvq27lm9p1ny7bcmmv56m16h3xadbkdx69gfkzxc3razk";
}; };
installPhase = '' installPhase = ''

View File

@ -1,5 +1,5 @@
{ stdenv, lib, callPackage, perl, fetchurl, python2 { stdenv, lib, callPackage, perl, fetchurl, python2
, pkgconfig, spidermonkey_31, boost, icu, libxml2, libpng , pkgconfig, spidermonkey_38, boost, icu, libxml2, libpng
, libjpeg, zlib, curl, libogg, libvorbis, enet, miniupnpc , libjpeg, zlib, curl, libogg, libvorbis, enet, miniupnpc
, openal, mesa, xproto, libX11, libXcursor, nspr, SDL, SDL2 , openal, mesa, xproto, libX11, libXcursor, nspr, SDL, SDL2
, gloox, nvidia-texture-tools , gloox, nvidia-texture-tools
@ -10,17 +10,17 @@ assert withEditor -> wxGTK != null;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "0ad-${version}"; name = "0ad-${version}";
version = "0.0.20"; version = "0.0.21";
src = fetchurl { src = fetchurl {
url = "http://releases.wildfiregames.com/0ad-${version}-alpha-unix-build.tar.xz"; url = "http://releases.wildfiregames.com/0ad-${version}-alpha-unix-build.tar.xz";
sha256 = "13n61xhjsawda3kl7112la41bqkbqmq4yhr3slydsz856z5xb5m3"; sha256 = "1kw3hqnr737ipx4f03khz3hvsh3ha7r8iy9njppk2faa53j27gln";
}; };
nativeBuildInputs = [ python2 perl pkgconfig ]; nativeBuildInputs = [ python2 perl pkgconfig ];
buildInputs = [ buildInputs = [
spidermonkey_31 boost icu libxml2 libpng libjpeg spidermonkey_38 boost icu libxml2 libpng libjpeg
zlib curl libogg libvorbis enet miniupnpc openal zlib curl libogg libvorbis enet miniupnpc openal
mesa xproto libX11 libXcursor nspr SDL2 gloox mesa xproto libX11 libXcursor nspr SDL2 gloox
nvidia-texture-tools nvidia-texture-tools
@ -44,11 +44,16 @@ stdenv.mkDerivation rec {
# Delete shipped libraries which we don't need. # Delete shipped libraries which we don't need.
rm -rf libraries/source/{enet,miniupnpc,nvtt,spidermonkey} rm -rf libraries/source/{enet,miniupnpc,nvtt,spidermonkey}
# Workaround invalid pkgconfig name for mozjs
mkdir pkgconfig
ln -s ${spidermonkey_38}/lib/pkgconfig/* pkgconfig/mozjs-38.pc
PKG_CONFIG_PATH="$PWD/pkgconfig:$PKG_CONFIG_PATH"
# Update Makefiles # Update Makefiles
pushd build/workspaces pushd build/workspaces
./update-workspaces.sh \ ./update-workspaces.sh \
--with-system-nvtt \ --with-system-nvtt \
--with-system-mozjs31 \ --with-system-mozjs38 \
${lib.optionalString withEditor "--enable-atlas"} \ ${lib.optionalString withEditor "--enable-atlas"} \
--bindir="$out"/bin \ --bindir="$out"/bin \
--libdir="$out"/lib/0ad \ --libdir="$out"/lib/0ad \

View File

@ -1,9 +1,8 @@
{ stdenv, fetchgit { stdenv, fetchgit
, sqlite, expat, mp4v2, flac, spidermonkey, taglib, libexif, curl, ffmpeg, file , sqlite, expat, mp4v2, flac, spidermonkey_1_8_5, taglib, libexif, curl, ffmpeg, file
, pkgconfig, autoreconfHook }: , pkgconfig, autoreconfHook }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "mediatomb-${version}"; name = "mediatomb-${version}";
version = "0.12.1"; version = "0.12.1";
@ -13,7 +12,7 @@ stdenv.mkDerivation rec {
sha256 = "1mimslr4q6mky865y6561rr64cbn4gf0qc2dhgb31hxp4rc1kmzd"; sha256 = "1mimslr4q6mky865y6561rr64cbn4gf0qc2dhgb31hxp4rc1kmzd";
}; };
buildInputs = [ sqlite expat spidermonkey taglib libexif curl ffmpeg file mp4v2 flac buildInputs = [ sqlite expat spidermonkey_1_8_5 taglib libexif curl ffmpeg file mp4v2 flac
pkgconfig autoreconfHook ]; pkgconfig autoreconfHook ];
meta = with stdenv.lib; { meta = with stdenv.lib; {

View File

@ -5706,12 +5706,12 @@ in
spark = callPackage ../applications/networking/cluster/spark { }; spark = callPackage ../applications/networking/cluster/spark { };
spidermonkey = callPackage ../development/interpreters/spidermonkey { }; spidermonkey_1_8_5 = callPackage ../development/interpreters/spidermonkey/1.8.5.nix { };
spidermonkey_1_8_0rc1 = callPackage ../development/interpreters/spidermonkey/1.8.0-rc1.nix { }; spidermonkey_17 = callPackage ../development/interpreters/spidermonkey/17.nix { };
spidermonkey_185 = callPackage ../development/interpreters/spidermonkey/185-1.0.0.nix { }; spidermonkey_24 = callPackage ../development/interpreters/spidermonkey/24.nix { };
spidermonkey_17 = callPackage ../development/interpreters/spidermonkey/17.0.nix { }; spidermonkey_31 = callPackage ../development/interpreters/spidermonkey/31.nix { };
spidermonkey_24 = callPackage ../development/interpreters/spidermonkey/24.2.nix { }; spidermonkey_38 = callPackage ../development/interpreters/spidermonkey/38.nix { };
spidermonkey_31 = callPackage ../development/interpreters/spidermonkey/31.5.nix { }; spidermonkey = spidermonkey_31;
supercollider = callPackage ../development/interpreters/supercollider { supercollider = callPackage ../development/interpreters/supercollider {
fftw = fftwSinglePrec; fftw = fftwSinglePrec;
@ -8849,9 +8849,7 @@ in
polarssl = mbedtls; polarssl = mbedtls;
polkit = callPackage ../development/libraries/polkit { polkit = callPackage ../development/libraries/polkit { };
spidermonkey = spidermonkey_17;
};
polkit_qt4 = callPackage ../development/libraries/polkit-qt-1/qt-4.nix { }; polkit_qt4 = callPackage ../development/libraries/polkit-qt-1/qt-4.nix { };
@ -10008,7 +10006,7 @@ in
charybdis = callPackage ../servers/irc/charybdis {}; charybdis = callPackage ../servers/irc/charybdis {};
couchdb = callPackage ../servers/http/couchdb { couchdb = callPackage ../servers/http/couchdb {
spidermonkey = spidermonkey_185; spidermonkey = spidermonkey_1_8_5;
python = python27; python = python27;
sphinx = python27Packages.sphinx; sphinx = python27Packages.sphinx;
erlang = erlangR16; erlang = erlangR16;
@ -10111,9 +10109,7 @@ in
mattermost = callPackage ../servers/mattermost { }; mattermost = callPackage ../servers/mattermost { };
matterircd = callPackage ../servers/mattermost/matterircd.nix { }; matterircd = callPackage ../servers/mattermost/matterircd.nix { };
mediatomb = callPackage ../servers/mediatomb { mediatomb = callPackage ../servers/mediatomb { };
spidermonkey = spidermonkey_185;
};
memcached = callPackage ../servers/memcached {}; memcached = callPackage ../servers/memcached {};

View File

@ -79,10 +79,10 @@ let
sha256 = "1ywrsp90w6rlgq3v2vmvp2zvvykkgqqasab7h9bf3vgvgv3qasbg"; sha256 = "1ywrsp90w6rlgq3v2vmvp2zvvykkgqqasab7h9bf3vgvgv3qasbg";
configureFlags = [ configureFlags = [
"--with-spidermonkey=${pkgs.spidermonkey_185}" "--with-spidermonkey=${pkgs.spidermonkey_1_8_5}"
]; ];
buildInputs = [ pkgs.spidermonkey_185 ]; buildInputs = [ pkgs.spidermonkey_1_8_5 ];
}; };
xdebug = if isPhp7 then xdebug24 else xdebug23; xdebug = if isPhp7 then xdebug24 else xdebug23;