Documentation
¶
Index ¶
- func ArchMap(format, goarch string) string
- func Build(pkg *spec.Packaging, opts BuildOptions) ([]string, error)
- func BuildInfo(pkg *spec.Packaging, format string, opts BuildOptions) (*nfpm.Info, error)
- func FamilyNames(pkg *spec.Packaging, format string) []string
- func InjectOptDepends(path string, optDepends map[string]string) error
- func LoadPackaging(path string) (*spec.Packaging, error)
- func ParsePackaging(data []byte) (*spec.Packaging, error)
- func ResolveVariant(pkg *spec.Packaging, format, variant string) (name string, plugins []string, err error)
- func VariantNames(pkg *spec.Packaging, format string) []string
- type BuildOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(pkg *spec.Packaging, opts BuildOptions) ([]string, error)
Build builds the requested formats for one (variant, arch) and returns the written package file paths. Formats defaults to all registered nFPM formats.
func BuildInfo ¶
BuildInfo constructs the nfpm.Info for one (format, variant) from the packaging section + the build options. A variant naming a plugin absent from the plugins dir fails loudly (R4 — never a silently-dropped plugin).
func FamilyNames ¶ added in v0.2026279.2204
FamilyNames returns every package name this (name, variants) packaging produces for a format — the format's default variant packages as the plain name, every other as <name>-<variant>, and FamilyNames applies that SAME rule to every variant. The set is format-dependent because `default_variant` is per-format. It is the input the nFPM config uses to declare the family's mutual Provides/Conflicts/Replaces: every variant installs the SAME paths, so the family members are mutually-exclusive packages over a shared file set.
func InjectOptDepends ¶
InjectOptDepends rewrites a .pkg.tar.zst in place, injecting the optdepends into its .PKGINFO. A no-op when optDepends is empty.
func LoadPackaging ¶
LoadPackaging reads the `packaging:` section from a charly.yml on disk.
func ParsePackaging ¶
ParsePackaging parses the `packaging:` section from charly.yml bytes. A candy charly.yml is `candy-name: {candy: {…}}` — the candy name is dynamic, so the parser walks the top-level keys and returns the first `candy.packaging` block.
The document is decoded into a yaml.Node rather than a map[string]struct{…} because a REAL candy charly.yml carries a top-level `version: <calver>` SCALAR alongside the `candy:` map. Unmarshalling the whole document into a typed map fails on that scalar before ever reaching the candy body, so `charly generate-packages` errored on every real candy. Walking the node lets a top-level scalar be tolerated while the `candy:` map is decoded into the CUE-generated spec.Packaging type.
Types ¶
type BuildOptions ¶
type BuildOptions struct {
Binary string // the charly binary to package
PluginsDir string // the plugins dir to package
Version string // the CalVer
Arch string // GOARCH name (amd64/arm64)
Variant string // the variant name ("" = the format's default)
Formats []string // the nFPM formats to build
Out string // the output dir
SigningKey string // deb/rpm GPG key file (passphrase via NFPM_PASSPHRASE)
APKKey string // apk RSA key file (passphrase via NFPM_APK_PASSPHRASE)
MSIXPFX string // msix PFX cert file (passphrase via NFPM_MSIX_PASSPHRASE)
MSIXLogo string // msix logo file (required by the msix packager)
}
BuildOptions is the input to a package build: the binary + plugins to package, the version/arch/variant, the formats, and the signing keys.