Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

download

This field specifies a git repository to download the module’s source files from.

Modules with download automatically have is_build_dep set to true, and their srcdir points to the download directory.

The context must define GIT_DOWNLOAD and (if using patches) GIT_PATCH rules.

fields

  • git: Required. A map with url and one of commit, branch, or tag.
  • patches: Optional. A list of patch files to apply after download.
  • dldir: Optional. A string overriding the download directory. Defaults to build/dl/<relpath>/<module_name>.

Example:

modules:
  - name: external_lib
    download:
      git:
        url: https://github.com/example/lib.git
        commit: abc123
    sources:
      - lib.c

  - name: patched_lib
    download:
      git:
        url: https://github.com/example/lib.git
        commit: main
      patches:
        - 0001-fix-build.patch
    sources:
      - lib.c