NAME
Alien::Xrepo::Build::Recipe - Load and validate an xrepo.json recipe
SYNOPSIS
my $recipe = Alien::Xrepo::Build::Recipe->new( dir => 'dist-root' );
my $recipe = Alien::Xrepo::Build::Recipe->new( file => 'xrepo.json' );
my $recipe = Alien::Xrepo::Build::Recipe->new(
packages => [
'zstd',
{ name => 'libsdl3', version => '3.4.12', kind => 'shared', configs => { wayland => 1 } }
],
defaults => { mode => 'release' }
);
DESCRIPTION
xrepo.json is a small JSON recipe consumed by Alien::Xrepo::Build. This class loads it (from a file/directory or inline data), validates it, and normalizes the package entries. The allowed per-package keys are the installer flags taken by Alien::Xrepo (plat, arch, mode, kind, toolchain, vs*, ndk, sdk, mingw, jobs, force, ..., plus name, version, and the nested recipe options under configs).
RECIPE FORMAT
{
"name" : "Alien-Zstandard",
"packages" : [
{ "name" : "zstd", "kind" : "shared" }
],
"defaults" : { "mode" : "release", "configs" : { "legacy" : 1 } },
"pkg_roots" : { "ZSTD" : "$ZSTD" },
"local_repos" : [ "vendor/recipes" ],
"hooks" : [ "Alien::Zstandard::Hooks" ]
}
packages is required and must not be empty; order matters (the first entry is the primary package). local_repos are registered with xrepo during the configure stage. pkg_roots maps a package name to an advanced-user environment variable (mirroring Alien::Build's pkg_roots): when the variable names an existing directory, Alien::Xrepo::Build treats the package as system-provided there and never touches xrepo for it. hooks names recipe hook modules; each is loaded once at the configure stage and invited to register its own stage hooks (see Alien::Xrepo::Build).
METHODS
name()-
The recipe's
name, orundefwhen the recipe does not set one. packages()-
The normalized package names in declaration order (the first entry is the primary package).
package_defs()-
A hashref of the normalized per-package definitions, keyed by package name.
defaults()-
The ambient options applied under every package: the same key set a package def accepts (
plat,arch,mode,kind,jobs, ...), plus the nestedconfigshashref. pkg_roots()-
A hashref mapping a package name to an advanced-user environment variable name, mirroring Alien::Build's
pkg_roots. When the variable names an existing directory, Alien::Xrepo::Build treats the package as system-provided there (see Alien::Xrepo::Build). local_repos()-
An arrayref of directory paths to local xmake-repo trees (each containing a
packages/subdirectory). Alien::Xrepo::Build registers each of them with xrepo during the configure stage, so packages that are not in the central xmake-repo can be installed. hooks()-
An arrayref of recipe hook module names. Alien::Xrepo::Build loads each module once during the configure stage and invokes its class method
register_hooks($build)so it can attach its own stage hooks (see Alien::Xrepo::Build). version_for( $name )-
The per-package version constraint, or
undefwhen the recipe does not pin one. opts_for( $name, %ambient )-
Ambient options with the package's per-package def merged over them (flag keys override;
configsmerge per-key).
SEE ALSO
Alien::Xrepo::Build, Alien::Xrepo::Runtime, Alien::Xrepo
LICENSE
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module.
AUTHOR
Sanko Robinson https://github.com/sanko