Merge branch 'chromium-refactor', closes #1798.

This implements some longstanding work of getting the Chromium
derivation more modular. Unfortunately, I didn't manage to decrease the
compile time, which was one of the primary goal for doing the refactor.
A main reason this didn't work out well was the fact that most bundled
libraries are so heavily patched that it's not possible within a limited
time frame to decouple it from the main derivation.

However, it should now be easier to build other derivations that build
upon Chromium, like libcef. Also, it finally adds support for the
non-free PepperAPI Flash and PDF plugins and support for fetching the
corresponding versions through the updater.
This commit is contained in:
aszlig
2014-04-21 09:50:50 +02:00
22 changed files with 1074 additions and 403 deletions

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchurl, fixedPoint ? false }:
{ stdenv, fetchurl, fixedPoint ? false, withCustomModes ? false }:
let
version = "1.1";
@@ -11,7 +11,8 @@ stdenv.mkDerivation rec {
sha256 = "158xprn2086arvdib3vbbygz7z6jqkw2nci7nlywzzwallap0wmr";
};
configureFlags = stdenv.lib.optionalString fixedPoint "--enable-fixed-point";
configureFlags = stdenv.lib.optional fixedPoint "--enable-fixed-point"
++ stdenv.lib.optional withCustomModes "--enable-custom-modes";
doCheck = true;

View File

@@ -1,14 +1,20 @@
{stdenv, fetchurl, libpng, libjpeg}:
{ stdenv, fetchurl, libpng, libjpeg, giflib, libtiff }:
stdenv.mkDerivation rec {
name = "libwebp-0.1.3";
name = "libwebp-0.4.0";
src = fetchurl {
url = "http://webp.googlecode.com/files/${name}.tar.gz";
sha256 = "1fkssvg99s9ypswh4ywkirgcy1wmy3b6388f3cqj4a4vwdb89ca0";
sha256 = "0sadjkx8m6sf064r5gngjvz4b5246q3j27dlaml5b1k3x5vkb49i";
};
buildInputs = [ libpng libjpeg ];
buildInputs = [ libpng libjpeg giflib libtiff ];
configureFlags = [
"--enable-libwebpmux"
"--enable-libwebpdemux"
"--enable-libwebpdecoder"
];
meta = {
homepage = http://code.google.com/p/webp/;

View File

@@ -0,0 +1,14 @@
{ stdenv, zlib, autoconf, automake, libtool }:
stdenv.mkDerivation {
name = "minizip-${zlib.version}";
inherit (zlib) src;
nativeBuildInputs = [ autoconf automake libtool ];
buildInputs = [ zlib ];
preConfigure = ''
cd contrib/minizip
autoreconf -vfi
'';
}

View File

@@ -0,0 +1,65 @@
{ stdenv, fetchsvn, gyp, readline, python, which }:
assert readline != null;
let
system = stdenv.system;
arch = if system == "i686-linux" then "ia32" else if system == "x86_64-linux" || system == "x86_64-darwin" then "x64" else "";
version = "3.14.5.9";
in
assert arch != "";
stdenv.mkDerivation {
name = "v8-${version}";
src = fetchsvn {
url = "http://v8.googlecode.com/svn/tags/${version}";
sha256 = "18qp5qp5xrb6f00w01cklz358yrl54pks963f5rwvwz82d8sfyqr";
name = "v8-${version}-src";
};
patches = [ ./fix-GetLocalizedMessage-usage.patch ];
configurePhase = ''
mkdir build/gyp
ln -sv ${gyp}/bin/gyp build/gyp/gyp
'';
nativeBuildInputs = [ which ];
buildInputs = [ readline python ];
buildFlags = [
"library=shared"
"console=readline"
"${arch}.release"
];
# http://code.google.com/p/v8/issues/detail?id=2149
NIX_CFLAGS_COMPILE = "-Wno-unused-local-typedefs -Wno-aggressive-loop-optimizations";
enableParallelBuilding = true;
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/lib
mv -v out/${arch}.release/d8 $out/bin
${if stdenv.system == "x86_64-darwin" then
"mv -v out/${arch}.release/libv8.dylib $out/lib"
else
"mv -v out/${arch}.release/lib.target/libv8.so $out/lib"}
mv -v include $out/
'';
postFixup = if stdenv.isDarwin then ''
install_name_tool -change /usr/local/lib/libv8.dylib $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/bin/d8
install_name_tool -id $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/lib/libv8.dylib
'' else null;
meta = with stdenv.lib; {
description = "V8 is Google's open source JavaScript engine";
platforms = platforms.linux ++ platforms.darwin;
license = licenses.bsd3;
};
}

View File

@@ -1,65 +1,66 @@
{ stdenv, fetchsvn, gyp, readline, python, which }:
{ stdenv, fetchurl, gyp, readline, python, which, icu }:
assert readline != null;
let
system = stdenv.system;
arch = if system == "i686-linux" then "ia32" else if system == "x86_64-linux" || system == "x86_64-darwin" then "x64" else "";
version = "3.14.5.9";
arch = if stdenv.is64bit then "x64" else "ia32";
in
assert arch != "";
stdenv.mkDerivation rec {
name = "v8-${version}";
version = "3.25.9";
stdenv.mkDerivation {
name = "v8-${version}";
src = fetchurl {
url = "https://commondatastorage.googleapis.com/chromium-browser-official/"
+ "${name}.tar.bz2";
sha256 = "0x6czv99dr701vljyb4ghyhhc5rmv7vfkpvigcnrqz2an9q1pc28";
};
src = fetchsvn {
url = "http://v8.googlecode.com/svn/tags/${version}";
sha256 = "18qp5qp5xrb6f00w01cklz358yrl54pks963f5rwvwz82d8sfyqr";
name = "v8-${version}-src";
};
configurePhase = ''
PYTHONPATH="tools/generate_shim_headers:$PYTHONPATH" \
${gyp}/bin/gyp \
-f make \
--generator-output="out" \
-Dflock_index=0 \
-Dv8_enable_i18n_support=1 \
-Duse_system_icu=1 \
-Dconsole=readline \
-Dcomponent=shared_library \
-Dv8_target_arch=${arch} \
--depth=. -Ibuild/standalone.gypi \
build/all.gyp
'';
patches = [ ./fix-GetLocalizedMessage-usage.patch ];
nativeBuildInputs = [ which ];
buildInputs = [ readline python icu ];
configurePhase = ''
mkdir build/gyp
ln -sv ${gyp}/bin/gyp build/gyp/gyp
'';
buildFlags = [
"LINK=g++"
"-C out"
"builddir=$(CURDIR)/Release"
"BUILDTYPE=Release"
];
nativeBuildInputs = [ which ];
buildInputs = [ readline python ];
enableParallelBuilding = true;
buildFlags = [
"library=shared"
"console=readline"
"${arch}.release"
];
installPhase = ''
install -vD out/Release/d8 "$out/bin/d8"
${if stdenv.system == "x86_64-darwin" then ''
install -vD out/Release/lib.target/libv8.dylib "$out/lib/libv8.dylib"
'' else ''
install -vD out/Release/lib.target/libv8.so "$out/lib/libv8.so"
''}
cp -vr include "$out/"
'';
# http://code.google.com/p/v8/issues/detail?id=2149
NIX_CFLAGS_COMPILE = "-Wno-unused-local-typedefs -Wno-aggressive-loop-optimizations";
postFixup = if stdenv.isDarwin then ''
install_name_tool -change /usr/local/lib/libv8.dylib $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/bin/d8
install_name_tool -id $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/lib/libv8.dylib
'' else null;
enableParallelBuilding = true;
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/lib
mv -v out/${arch}.release/d8 $out/bin
${if stdenv.system == "x86_64-darwin" then
"mv -v out/${arch}.release/libv8.dylib $out/lib"
else
"mv -v out/${arch}.release/lib.target/libv8.so $out/lib"}
mv -v include $out/
'';
postFixup = if stdenv.isDarwin then ''
install_name_tool -change /usr/local/lib/libv8.dylib $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/bin/d8
install_name_tool -id $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/lib/libv8.dylib
'' else null;
meta = with stdenv.lib; {
description = "V8 is Google's open source JavaScript engine";
platforms = platforms.linux ++ platforms.darwin;
license = licenses.bsd3;
};
meta = with stdenv.lib; {
description = "V8 is Google's open source JavaScript engine";
platforms = platforms.linux ++ platforms.darwin;
license = licenses.bsd3;
};
}

View File

@@ -40,4 +40,6 @@ stdenv.mkDerivation rec {
# zlib doesn't like the automatic --disable-shared from the Cygwin stdenv.
cygwinConfigureEnableShared = true;
passthru.version = version;
}

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchurl, openssl, python, zlib, v8, utillinux, http-parser, c-ares, pkgconfig, runCommand }:
{ stdenv, fetchurl, openssl, python, zlib, v8_3_14, utillinux, http-parser, c-ares, pkgconfig, runCommand }:
let
dtrace = runCommand "dtrace-native" {} ''
@@ -10,7 +10,7 @@ let
# !!! Should we also do shared libuv?
deps = {
inherit v8 openssl zlib http-parser;
inherit v8_3_14 openssl zlib http-parser;
cares = c-ares;
};