toolchain_extras v0.2.2 NervesExtras.Toolchain behaviour

Link to this section Summary

Functions

Create an archive of the artifact

Bootstrap is called as the final phase of loading the Nerves environment. It is used typically for setting / unsetting any system environment variables. For example, if we were building a C cross compiler, we would use the bootstrap phase to override CC to point to our compiler

Build path link should return the location inside the Artifact.build_path that represents the final artifact. This is used to symlink the global artifact to the local build_path location

Clean up all the build files

Callbacks

The bootstrap callback is the called during the final setup of a Nerves “build” environment. This platform package looks for the :toolchain_extras key in the nerves package configuration

Return the location in the build path to where the global artifact is linked

Link to this section Functions

Link to this function archive(pkg, toolchain, opts)

Create an archive of the artifact

Bootstrap is called as the final phase of loading the Nerves environment. It is used typically for setting / unsetting any system environment variables. For example, if we were building a C cross compiler, we would use the bootstrap phase to override CC to point to our compiler.

Callback implementation for Nerves.Package.Platform.bootstrap/1.

Link to this function build(pkg, toolchain, opts)

Callback implementation for Nerves.Artifact.BuildRunner.build/3.

Link to this function build_path_link(pkg)

Build path link should return the location inside the Artifact.build_path that represents the final artifact. This is used to symlink the global artifact to the local build_path location.

Callback implementation for Nerves.Package.Platform.build_path_link/1.

Clean up all the build files

Link to this section Callbacks

Link to this callback bootstrap(arg0)
bootstrap(Nerves.Package.t()) :: :ok | {:error, error :: term()}

The bootstrap callback is the called during the final setup of a Nerves “build” environment. This platform package looks for the :toolchain_extras key in the nerves package configuration.

An example from the :toolchain_extras_pru_cgt extras toolchain mix.exs nerves_package function:

  toolchain_extras: [
    env_var: "PRU_CGT",
    build_path_link: "ti-cgt-pru",
    build_script: "build.sh",
    clean_files: ["ti-cgt-pru"],
    archive_script: "scripts/archive.sh"
  ]

TODO: Fill out documentation for configuration options.

Link to this callback build_path_link(package)
build_path_link(package :: Nerves.Package.t()) :: build_path_link :: String.t()

Return the location in the build path to where the global artifact is linked