Skip to content

Commit

Permalink
chromium: Move fetchurl calls to getChannel
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
aszlig committed Mar 20, 2016
1 parent 4984a2b commit 37dbd62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, patchutils, python
{ stdenv, fetchpatch, patchutils, python
, channel ? "stable"
}:

Expand All @@ -19,7 +19,7 @@ let
in stdenv.mkDerivation {
name = "chromium-source-${version}";

src = fetchurl main;
src = main;

buildInputs = [ python ]; # cannot patch shebangs otherwise

Expand Down Expand Up @@ -73,6 +73,6 @@ in stdenv.mkDerivation {

passthru = {
inherit version channel;
plugins = fetchurl binary;
plugins = binary;
};
}
8 changes: 4 additions & 4 deletions pkgs/applications/networking/browsers/chromium/update.nix
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 37dbd62

Please sign in to comment.