packagekit

package
v0.2026328.2210 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 19 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, format string) []string

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: 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 ResolveVariant

func ResolveVariant(pkg *spec.Packaging, format, variant string) (name string, plugins []string, err error)

ResolveVariant returns the package name + the variant's plugin list for a (format, variant) pair. variant == "" selects the format's default variant.

func VariantNames

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

VariantNames returns the sorted variant names for a format (the default variant first). Used by the distro workflows to loop over variants.

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/apk/ipk, -1 for rpm/archlinux)
	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)
}

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