Source Recipe

A source recipe describes how to fetch and prepare files (often source code) to be used by other recipes. In addition to the common options, source recipes allow the following options:

FieldDescriptionValue
typeThe source type."tar.gz" | "tar.xz" | "git" | "local"
See source type specific options.
patchA path to a patchfile, the path is relative to the root chariot file.String
regenerateA script to run on the source, explained further here.Code Block

Source Type

There are currently three methods supported:

  • "tar.gz" | "tar.xz"

    This method fetches an archive from an URL, checks a checksum against it, extracts it.

    Options:

    FieldDescriptionValue
    urlURL to a tar archive.String
    b2sumBlake2 checksum of the archive.String
    ```
    source/autoconf {
        type: "tar.gz"
        url: "https://ftp.gnu.org/gnu/autoconf/autoconf-2.72.tar.gz"
        b2sum: "48fff54704176cbf2642230229c628b75c43ef3f810c39eea40cae91dd02e1203d04a544407de96f9172419a94b952865909d969d9e9b6c10879a9d9aeea5ad0"
    }
    ```
    
  • "git"

    This method clones a repo and checks out a specific revision.

    Options:

    FieldDescriptionValue
    urlURL to a tar archive.String
    revisionGit revision to check out. Can be a commit hash, tag, branch.String
    ```
    source/chariot {
        type: "git"
        url: "https://github.com/elysium-os/chariot"
        revision: "ece5664ddc1c7b0111ae870af0fc2aaa3fdb4c98"
    }
    ```
    
    If the revision is set to a branch or tag, chariot will not check for updates.
    In order to update the source the recipe needs to be explicitly built again.
    
  • "local"

    This method copies a local directory.

    Options:

    FieldDescriptionValue
    urlPath to local directory, the path is relative to the root chariot file.String
    ```
    source/support {
        type: "local"
        url: "support"
    }
    ```
    
    Chariot will check every file/directory(s) timestamp (ctime) to determine whether it has changed.
    Although this is convenient it can result in significant performance issues for large sources because of the nature of recursing through every directory and checking timestamps.
    

Regenerate

The regenerate field allows for a script to modify the source before it is used by other recipes. The regenerate step runs after the patch is applied if one is specified. Regenerate follows the standard execution environment with the exception that the current working directory is set to the source root.