chromium: Don't use the config attrset anymore.
We can still use the config attribute set from within all-packages to pass it to the package expression, which we do in case of PulseAudio. In order to override other stuff you can now conveniently use chromium.override without passing a fake config attribute set. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
5138c46432
commit
8fd4b80bc7
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, config, fetchurl, makeWrapper, which
|
{ stdenv, fetchurl, makeWrapper, which
|
||||||
|
|
||||||
# default dependencies
|
# default dependencies
|
||||||
, bzip2, flac, speex
|
, bzip2, flac, speex
|
||||||
@ -15,32 +15,23 @@
|
|||||||
, libXScrnSaver, libXcursor, mesa
|
, libXScrnSaver, libXcursor, mesa
|
||||||
|
|
||||||
# optional dependencies
|
# optional dependencies
|
||||||
, libgnome_keyring # config.gnomeKeyring
|
, libgcrypt ? null # gnomeSupport || cupsSupport
|
||||||
, gconf # config.gnome
|
|
||||||
, libgcrypt # config.gnome || config.cups
|
|
||||||
, nss, openssl # config.openssl
|
|
||||||
, pulseaudio # config.pulseaudio
|
|
||||||
, libselinux # config.selinux
|
|
||||||
|
|
||||||
|
# package customization
|
||||||
, channel ? "stable"
|
, channel ? "stable"
|
||||||
|
, enableSELinux ? false, libselinux ? null
|
||||||
|
, enableNaCl ? false
|
||||||
|
, useOpenSSL ? false, nss ? null, openssl ? null
|
||||||
|
, gnomeSupport ? false, gconf ? null
|
||||||
|
, gnomeKeyringSupport ? false, libgnome_keyring ? null
|
||||||
|
, proprietaryCodecs ? true
|
||||||
|
, cupsSupport ? false
|
||||||
|
, pulseSupport ? false, pulseaudio ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
mkConfigurable = mapAttrs (flag: default: attrByPath ["chromium" flag] default config);
|
|
||||||
|
|
||||||
cfg = mkConfigurable {
|
|
||||||
selinux = false;
|
|
||||||
nacl = false;
|
|
||||||
openssl = false;
|
|
||||||
gnome = false;
|
|
||||||
gnomeKeyring = false;
|
|
||||||
proprietaryCodecs = true;
|
|
||||||
cups = false;
|
|
||||||
pulseaudio = config.pulseaudio or true;
|
|
||||||
};
|
|
||||||
|
|
||||||
sourceInfo = builtins.getAttr channel (import ./sources.nix);
|
sourceInfo = builtins.getAttr channel (import ./sources.nix);
|
||||||
|
|
||||||
mkGypFlags =
|
mkGypFlags =
|
||||||
@ -63,7 +54,7 @@ let
|
|||||||
use_system_libusb = true;
|
use_system_libusb = true;
|
||||||
use_system_libxml = true;
|
use_system_libxml = true;
|
||||||
use_system_speex = true;
|
use_system_speex = true;
|
||||||
use_system_ssl = cfg.openssl;
|
use_system_ssl = useOpenSSL;
|
||||||
use_system_stlport = true;
|
use_system_stlport = true;
|
||||||
use_system_xdg_utils = true;
|
use_system_xdg_utils = true;
|
||||||
use_system_yasm = true;
|
use_system_yasm = true;
|
||||||
@ -88,7 +79,7 @@ let
|
|||||||
post23 = !versionOlder sourceInfo.version "24.0.0.0";
|
post23 = !versionOlder sourceInfo.version "24.0.0.0";
|
||||||
post24 = !versionOlder sourceInfo.version "25.0.0.0";
|
post24 = !versionOlder sourceInfo.version "25.0.0.0";
|
||||||
|
|
||||||
maybeFixPulseAudioBuild = optional (post23 && cfg.pulseaudio) (fetchurl {
|
maybeFixPulseAudioBuild = optional (post23 && pulseSupport) (fetchurl {
|
||||||
url = http://archrepo.jeago.com/sources/chromium-dev/pulse_audio_fix.patch;
|
url = http://archrepo.jeago.com/sources/chromium-dev/pulse_audio_fix.patch;
|
||||||
sha256 = "1w91mirrkqigdhsj892mqxlc0nlv1dsp5shc46w9xf8nl96jxgfb";
|
sha256 = "1w91mirrkqigdhsj892mqxlc0nlv1dsp5shc46w9xf8nl96jxgfb";
|
||||||
});
|
});
|
||||||
@ -108,28 +99,28 @@ in stdenv.mkDerivation rec {
|
|||||||
which makeWrapper
|
which makeWrapper
|
||||||
python perl pkgconfig
|
python perl pkgconfig
|
||||||
nspr udev
|
nspr udev
|
||||||
(if cfg.openssl then openssl else nss)
|
(if useOpenSSL then openssl else nss)
|
||||||
utillinux alsaLib
|
utillinux alsaLib
|
||||||
gcc bison gperf
|
gcc bison gperf
|
||||||
krb5
|
krb5
|
||||||
glib gtk dbus_glib
|
glib gtk dbus_glib
|
||||||
libXScrnSaver libXcursor mesa
|
libXScrnSaver libXcursor mesa
|
||||||
] ++ optional cfg.gnomeKeyring libgnome_keyring
|
] ++ optional gnomeKeyringSupport libgnome_keyring
|
||||||
++ optionals cfg.gnome [ gconf libgcrypt ]
|
++ optionals gnomeSupport [ gconf libgcrypt ]
|
||||||
++ optional cfg.selinux libselinux
|
++ optional enableSELinux libselinux
|
||||||
++ optional cfg.cups libgcrypt
|
++ optional cupsSupport libgcrypt
|
||||||
++ optional cfg.pulseaudio pulseaudio
|
++ optional pulseSupport pulseaudio
|
||||||
++ optional post24 pciutils;
|
++ optional post24 pciutils;
|
||||||
|
|
||||||
opensslPatches = optional cfg.openssl openssl.patches;
|
opensslPatches = optional useOpenSSL openssl.patches;
|
||||||
|
|
||||||
prePatch = "patchShebangs .";
|
prePatch = "patchShebangs .";
|
||||||
|
|
||||||
patches = optional cfg.cups ./cups_allow_deprecated.patch
|
patches = optional cupsSupport ./cups_allow_deprecated.patch
|
||||||
++ optional cfg.pulseaudio ./pulseaudio_array_bounds.patch
|
++ optional pulseSupport ./pulseaudio_array_bounds.patch
|
||||||
++ maybeFixPulseAudioBuild;
|
++ maybeFixPulseAudioBuild;
|
||||||
|
|
||||||
postPatch = optionalString cfg.openssl ''
|
postPatch = optionalString useOpenSSL ''
|
||||||
cat $opensslPatches | patch -p1 -d third_party/openssl/openssl
|
cat $opensslPatches | patch -p1 -d third_party/openssl/openssl
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -137,15 +128,15 @@ in stdenv.mkDerivation rec {
|
|||||||
linux_use_gold_binary = false;
|
linux_use_gold_binary = false;
|
||||||
linux_use_gold_flags = false;
|
linux_use_gold_flags = false;
|
||||||
proprietary_codecs = false;
|
proprietary_codecs = false;
|
||||||
use_gnome_keyring = cfg.gnomeKeyring;
|
use_gnome_keyring = gnomeKeyringSupport;
|
||||||
use_gconf = cfg.gnome;
|
use_gconf = gnomeSupport;
|
||||||
use_gio = cfg.gnome;
|
use_gio = gnomeSupport;
|
||||||
use_pulseaudio = cfg.pulseaudio;
|
use_pulseaudio = pulseSupport;
|
||||||
disable_nacl = !cfg.nacl;
|
disable_nacl = !enableNaCl;
|
||||||
use_openssl = cfg.openssl;
|
use_openssl = useOpenSSL;
|
||||||
selinux = cfg.selinux;
|
selinux = enableSELinux;
|
||||||
use_cups = cfg.cups;
|
use_cups = cupsSupport;
|
||||||
} // optionalAttrs cfg.proprietaryCodecs {
|
} // optionalAttrs proprietaryCodecs {
|
||||||
# enable support for the H.264 codec
|
# enable support for the H.264 codec
|
||||||
proprietary_codecs = true;
|
proprietary_codecs = true;
|
||||||
ffmpeg_branding = "Chrome";
|
ffmpeg_branding = "Chrome";
|
||||||
|
@ -6634,6 +6634,7 @@ let
|
|||||||
chromium = lowPrio (callPackage ../applications/networking/browsers/chromium {
|
chromium = lowPrio (callPackage ../applications/networking/browsers/chromium {
|
||||||
channel = "stable";
|
channel = "stable";
|
||||||
gconf = gnome.GConf;
|
gconf = gnome.GConf;
|
||||||
|
pulseSupport = config.pulseaudio or false;
|
||||||
});
|
});
|
||||||
|
|
||||||
chromiumBeta = chromium.override { channel = "beta"; };
|
chromiumBeta = chromium.override { channel = "beta"; };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user