chromium: Move fetchurl calls to getChannel

We always do something like "fetchurl channelProduct", so let's move it
to getChannel directly so we can avoid those fetchurl calls all over the
place.

Also, we can still access subattributes from the fetchurl call if we
need to, so there really is no need to expose the product's attributes
directly.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2016-03-20 17:13:12 +01:00
parent 4984a2bf76
commit 37dbd62a83
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961
2 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, patchutils, python
{ stdenv, fetchpatch, patchutils, python
, channel ? "stable"
}:
@ -19,7 +19,7 @@ let
in stdenv.mkDerivation {
name = "chromium-source-${version}";
src = fetchurl main;
src = main;
buildInputs = [ python ]; # cannot patch shebangs otherwise
@ -73,6 +73,6 @@ in stdenv.mkDerivation {
passthru = {
inherit version channel;
plugins = fetchurl binary;
plugins = binary;
};
}

View File

@ -3,7 +3,7 @@
let
inherit (import ../../../../../. {
inherit system;
}) lib runCommand writeText stdenv curl cacert nix;
}) lib runCommand fetchurl writeText stdenv curl cacert nix;
sources = if builtins.pathExists ./upstream-info.nix
then import ./upstream-info.nix
@ -34,12 +34,12 @@ in rec {
in {
inherit (chanAttrs) version;
main = {
main = fetchurl {
url = mkVerURL chanAttrs.version;
inherit (chanAttrs) sha256;
};
binary = let
binary = fetchurl (let
mkUrls = arch: let
mkURLForMirror = getDebURL channel chanAttrs.version arch;
in map mkURLForMirror ([ debURL ] ++ debMirrors);
@ -49,7 +49,7 @@ in rec {
} else if !stdenv.is64bit && chanAttrs ? sha256bin32 then {
urls = mkUrls "i386";
sha256 = chanAttrs.sha256bin32;
} else throw "No Chrome plugins are available for your architecture.";
} else throw "No Chrome plugins are available for your architecture.");
};
update = let