packagekit

package
v0.2026336.2310 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 20 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchMap

func ArchMap(format, goarch string) string

ArchMap returns the nFPM arch name for a GOARCH name + format.

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

func BuildInfo(pkg *spec.Packaging, format string, opts BuildOptions) (*nfpm.Info, error)

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

func FamilyNames(pkg *spec.Packaging) []string

FamilyNames returns every package name the packaging section produces, sorted. It is the input the nFPM config uses to declare the family's mutual Provides/Conflicts: every variant installs the SAME paths, so the family members are mutually-exclusive packages over a shared file set, with the base name provided by whichever member is installed and no Replaces between them (a mutual replace makes `-Syu` unresolvable — see nfpm_config.go).

func InjectOptDepends

func InjectOptDepends(path string, optDepends map[string]string) error

InjectOptDepends rewrites a .pkg.tar.zst in place, injecting the optdepends into its .PKGINFO. A no-op when optDepends is empty.

func LoadPackaging

func LoadPackaging(path string) (*spec.Packaging, error)

LoadPackaging reads the `packaging:` section from a charly.yml on disk.

func ParsePackaging

func ParsePackaging(data []byte) (*spec.Packaging, error)

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.

func PluginDepends added in v0.2026336.1151

func PluginDepends(pluginsDir string, plugins []string, nfpmFormat, osID string) ([]string, error)

PluginDepends returns, in first-seen order without duplicates, the OS packages the listed plugins declare for one nFPM format, resolved for the OS family osID.

The resolution is the candy package cascade: a candy's top `package:` list, then its format-level `distro:` section (deb/rpm/pac/apk), then its section for osID. osID may be empty: then only the OS-agnostic declarations apply, and a plugin that declares an OS-level section FAILS the call by name — its packages would otherwise be dropped silently. Every listed plugin's candy is read for every format; a missing candy, or a section that carries anything a package Depends cannot express (repo, copr, options, exclude, module), fails loudly. An nFPM format no candy can declare packages for (msix) then contributes nothing.

Only the plugin candy's OWN package declarations count: D-CANDY-6 makes a plugin candy's `package:`/`os_override:` the statement of "the OS packages the plugin needs in order to run". The candies it composes (`require:`, inner candies) are image composition, not that statement, so they do not enter the union.

func ResolveVariant

func ResolveVariant(pkg *spec.Packaging, format, variant string) (name string, v *spec.PackagingVariant, err error)

ResolveVariant returns the package name and the variant for a (format, variant) pair. variant == "" selects the variant keyed by the packaging name. The format must be one the section builds (a `formats` entry).

func VariantNames

func VariantNames(pkg *spec.Packaging) []string

VariantNames returns the variant keys, the one keyed by the packaging name first and the rest sorted. The distro workflows loop over them.

Types

type BuildOptions

type BuildOptions struct {
	Binary     string   // the charly binary to package
	PluginsDir string   // the plugins dir to package
	Version    string   // the CalVer
	Release    string   // the package release (pkgrel) for a REPUBLISH; "" keeps nFPM's own naming (no suffix for deb, -1 for rpm/archlinux)
	Arch       string   // GOARCH name (amd64/arm64)
	Variant    string   // the variant name ("" = the format's default)
	OS         string   // the target OS family the variant plugins' packages resolve for ("" = OS-agnostic declarations only, see PluginDepends)
	Formats    []string // the nFPM formats to build
	Out        string   // the output dir
	SigningKey string   // deb/rpm GPG key file (passphrase via NFPM_PASSPHRASE)
	MSIXPFX    string   // msix PFX cert file (passphrase via NFPM_MSIX_PASSPHRASE)
}

BuildOptions is the input to a package build: the binary + plugins to package, the version/arch/variant, the formats, and the signing keys.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL