mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +03:00
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
|
||||
, bzip2, flac, speex
|
||||
@ -15,32 +15,23 @@
|
||||
, libXScrnSaver, libXcursor, mesa
|
||||
|
||||
# optional dependencies
|
||||
, libgnome_keyring # config.gnomeKeyring
|
||||
, gconf # config.gnome
|
||||
, libgcrypt # config.gnome || config.cups
|
||||
, nss, openssl # config.openssl
|
||||
, pulseaudio # config.pulseaudio
|
||||
, libselinux # config.selinux
|
||||
, libgcrypt ? null # gnomeSupport || cupsSupport
|
||||
|
||||
# package customization
|
||||
, 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;
|
||||
|
||||
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);
|
||||
|
||||
mkGypFlags =
|
||||
@ -63,7 +54,7 @@ let
|
||||
use_system_libusb = true;
|
||||
use_system_libxml = true;
|
||||
use_system_speex = true;
|
||||
use_system_ssl = cfg.openssl;
|
||||
use_system_ssl = useOpenSSL;
|
||||
use_system_stlport = true;
|
||||
use_system_xdg_utils = true;
|
||||
use_system_yasm = true;
|
||||
@ -88,7 +79,7 @@ let
|
||||
post23 = !versionOlder sourceInfo.version "24.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;
|
||||
sha256 = "1w91mirrkqigdhsj892mqxlc0nlv1dsp5shc46w9xf8nl96jxgfb";
|
||||
});
|
||||
@ -108,28 +99,28 @@ in stdenv.mkDerivation rec {
|
||||
which makeWrapper
|
||||
python perl pkgconfig
|
||||
nspr udev
|
||||
(if cfg.openssl then openssl else nss)
|
||||
(if useOpenSSL then openssl else nss)
|
||||
utillinux alsaLib
|
||||
gcc bison gperf
|
||||
krb5
|
||||
glib gtk dbus_glib
|
||||
libXScrnSaver libXcursor mesa
|
||||
] ++ optional cfg.gnomeKeyring libgnome_keyring
|
||||
++ optionals cfg.gnome [ gconf libgcrypt ]
|
||||
++ optional cfg.selinux libselinux
|
||||
++ optional cfg.cups libgcrypt
|
||||
++ optional cfg.pulseaudio pulseaudio
|
||||
] ++ optional gnomeKeyringSupport libgnome_keyring
|
||||
++ optionals gnomeSupport [ gconf libgcrypt ]
|
||||
++ optional enableSELinux libselinux
|
||||
++ optional cupsSupport libgcrypt
|
||||
++ optional pulseSupport pulseaudio
|
||||
++ optional post24 pciutils;
|
||||
|
||||
opensslPatches = optional cfg.openssl openssl.patches;
|
||||
opensslPatches = optional useOpenSSL openssl.patches;
|
||||
|
||||
prePatch = "patchShebangs .";
|
||||
|
||||
patches = optional cfg.cups ./cups_allow_deprecated.patch
|
||||
++ optional cfg.pulseaudio ./pulseaudio_array_bounds.patch
|
||||
patches = optional cupsSupport ./cups_allow_deprecated.patch
|
||||
++ optional pulseSupport ./pulseaudio_array_bounds.patch
|
||||
++ maybeFixPulseAudioBuild;
|
||||
|
||||
postPatch = optionalString cfg.openssl ''
|
||||
postPatch = optionalString useOpenSSL ''
|
||||
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_flags = false;
|
||||
proprietary_codecs = false;
|
||||
use_gnome_keyring = cfg.gnomeKeyring;
|
||||
use_gconf = cfg.gnome;
|
||||
use_gio = cfg.gnome;
|
||||
use_pulseaudio = cfg.pulseaudio;
|
||||
disable_nacl = !cfg.nacl;
|
||||
use_openssl = cfg.openssl;
|
||||
selinux = cfg.selinux;
|
||||
use_cups = cfg.cups;
|
||||
} // optionalAttrs cfg.proprietaryCodecs {
|
||||
use_gnome_keyring = gnomeKeyringSupport;
|
||||
use_gconf = gnomeSupport;
|
||||
use_gio = gnomeSupport;
|
||||
use_pulseaudio = pulseSupport;
|
||||
disable_nacl = !enableNaCl;
|
||||
use_openssl = useOpenSSL;
|
||||
selinux = enableSELinux;
|
||||
use_cups = cupsSupport;
|
||||
} // optionalAttrs proprietaryCodecs {
|
||||
# enable support for the H.264 codec
|
||||
proprietary_codecs = true;
|
||||
ffmpeg_branding = "Chrome";
|
||||
|
@ -6634,6 +6634,7 @@ let
|
||||
chromium = lowPrio (callPackage ../applications/networking/browsers/chromium {
|
||||
channel = "stable";
|
||||
gconf = gnome.GConf;
|
||||
pulseSupport = config.pulseaudio or false;
|
||||
});
|
||||
|
||||
chromiumBeta = chromium.override { channel = "beta"; };
|
||||
|
Loading…
Reference in New Issue
Block a user