Skip to main content

add_import_util

Function add_import_util 

Source
pub fn add_import_util(lua: &Lua, current_path: &Path) -> Result<(), Error>
Expand description

Exposes the core Package DSL and lifecycle functions to the Lua environment.

This module defines the primary entry points for a .pkg.lua script:

  • metadata: Defines the static Package struct fields.
  • dependencies: Defines the runtime and build dependency graph.
  • prepare/build/package: Placeholder functions that the maintainer overrides to define the build logic.
  • IMPORT/INCLUDE: Helpers for modular package definitions.

These functions bridge the declarative metadata and the imperative build logic. Adds the IMPORT function to the Lua environment for importing data from other files.

ยงErrors

Returns an error if the IMPORT function cannot be set in the global environment.