diff options
author | Florian Klink <flokli@flokli.de> | 2019-11-27 21:21:24 +0100 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2019-11-27 21:57:41 +0100 |
commit | cedbdc934de08dbc85177f49052ab52bc8a9c177 (patch) | |
tree | 737c2fb5e9ab2610a3ce0d7c9239dfd69d33dfea /pkgs | |
parent | b34564981104e68984078d548632bb4182d1abe8 (diff) |
buildUBoot: allow passing custom src
We allowed passing another version, but that wasn't too useful, given we
hardcoded the hash of the fetchurl.
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/misc/uboot/default.nix | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index f7663c8e4470..0c30e76b3fa9 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -4,24 +4,27 @@ }: let - buildUBoot = { version ? "2019.10" - , filesToInstall - , installDir ? "$out" - , defconfig - , extraConfig ? "" - , extraPatches ? [] - , extraMakeFlags ? [] - , extraMeta ? {} - , ... } @ args: - stdenv.mkDerivation ({ - + defaultVersion = "2019.10"; + defaultSrc = fetchurl { + url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${defaultVersion}.tar.bz2"; + sha256 = "053hcrwwlacqh2niisn0zas95zkbffw5aw5sdhixs8lmfdq60vcd"; + }; + buildUBoot = { + version ? null + , src ? null + , filesToInstall + , installDir ? "$out" + , defconfig + , extraConfig ? "" + , extraPatches ? [] + , extraMakeFlags ? [] + , extraMeta ? {} + , ... } @ args: stdenv.mkDerivation ({ pname = "uboot-${defconfig}"; - inherit version; - src = fetchurl { - url = "ftp://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2"; - sha256 = "053hcrwwlacqh2niisn0zas95zkbffw5aw5sdhixs8lmfdq60vcd"; - }; + version = if src == null then defaultVersion else version; + + src = if src == null then defaultSrc else src; patches = [ (fetchpatch { |