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:
parent
4984a2bf76
commit
37dbd62a83
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchurl, fetchpatch, patchutils, python
|
{ stdenv, fetchpatch, patchutils, python
|
||||||
, channel ? "stable"
|
, channel ? "stable"
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ let
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = "chromium-source-${version}";
|
name = "chromium-source-${version}";
|
||||||
|
|
||||||
src = fetchurl main;
|
src = main;
|
||||||
|
|
||||||
buildInputs = [ python ]; # cannot patch shebangs otherwise
|
buildInputs = [ python ]; # cannot patch shebangs otherwise
|
||||||
|
|
||||||
|
@ -73,6 +73,6 @@ in stdenv.mkDerivation {
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit version channel;
|
inherit version channel;
|
||||||
plugins = fetchurl binary;
|
plugins = binary;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
let
|
let
|
||||||
inherit (import ../../../../../. {
|
inherit (import ../../../../../. {
|
||||||
inherit system;
|
inherit system;
|
||||||
}) lib runCommand writeText stdenv curl cacert nix;
|
}) lib runCommand fetchurl writeText stdenv curl cacert nix;
|
||||||
|
|
||||||
sources = if builtins.pathExists ./upstream-info.nix
|
sources = if builtins.pathExists ./upstream-info.nix
|
||||||
then import ./upstream-info.nix
|
then import ./upstream-info.nix
|
||||||
|
@ -34,12 +34,12 @@ in rec {
|
||||||
in {
|
in {
|
||||||
inherit (chanAttrs) version;
|
inherit (chanAttrs) version;
|
||||||
|
|
||||||
main = {
|
main = fetchurl {
|
||||||
url = mkVerURL chanAttrs.version;
|
url = mkVerURL chanAttrs.version;
|
||||||
inherit (chanAttrs) sha256;
|
inherit (chanAttrs) sha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
binary = let
|
binary = fetchurl (let
|
||||||
mkUrls = arch: let
|
mkUrls = arch: let
|
||||||
mkURLForMirror = getDebURL channel chanAttrs.version arch;
|
mkURLForMirror = getDebURL channel chanAttrs.version arch;
|
||||||
in map mkURLForMirror ([ debURL ] ++ debMirrors);
|
in map mkURLForMirror ([ debURL ] ++ debMirrors);
|
||||||
|
@ -49,7 +49,7 @@ in rec {
|
||||||
} else if !stdenv.is64bit && chanAttrs ? sha256bin32 then {
|
} else if !stdenv.is64bit && chanAttrs ? sha256bin32 then {
|
||||||
urls = mkUrls "i386";
|
urls = mkUrls "i386";
|
||||||
sha256 = chanAttrs.sha256bin32;
|
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
|
update = let
|
||||||
|
|
Loading…
Reference in New Issue