4.5.2 Downloading Files: The download Method

The download method can be used to download a file from a given URL.

Example use:

default do
  download "https://ftp.gnu.org/gnu/gcc/gcc-#{gcc_version}/gcc-#{gcc_version}.tar.xz",
    "#{build_dir}/gcc-#{gcc_version}.tar.xz",
    sha256_sum: gcc_checksum
end

The download method downloads the file specified by the URL in the first parameter, and writes it to the local file specified by the second parameter. If the :sha256sum option is given, this causes two changes to the default behavior: