Documentation
¶
Overview ¶
Package options provides build and packaging option utilities, including binary stripping functionality.
Index ¶
- func Apply(packageDir string, o Options) error
- func ApplyWithEnv(packageDir string, o Options, env map[string]string) error
- func Purge(packageDir string) error
- func RemoveDocs(packageDir string) error
- func RemoveEmptyDirs(packageDir string) error
- func RemoveLibtool(packageDir string) error
- func RemoveStatic(packageDir string) error
- func SetDebugDir(dir string)
- func Strip(packageDir string) error
- func StripWithEnv(packageDir string, env map[string]string) error
- func ZipMan(packageDir string) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply runs all enabled/disabled option handlers against packageDir in the correct order (strip first, then cleanup passes). STRIP/OBJCOPY are read from the process environment; use ApplyWithEnv for parallel-safe overrides.
func ApplyWithEnv ¶ added in v2.1.2
ApplyWithEnv is the env-overlay variant of Apply. The env map is consulted before os.Getenv for STRIP/OBJCOPY during the strip pass, allowing parallel builds to scope cross-compilation toolchain selection without mutating the global process environment.
func Purge ¶
Purge removes files matching PURGE_TARGETS from the package directory, mirroring makepkg's purge option.
func RemoveDocs ¶
RemoveDocs removes documentation directories from the package directory, mirroring makepkg's !docs option.
func RemoveEmptyDirs ¶
RemoveEmptyDirs removes empty directories from the package directory, mirroring makepkg's !emptydirs option. It walks bottom-up so that newly emptied parent dirs are also removed.
func RemoveLibtool ¶
RemoveLibtool removes libtool .la files from the package directory, mirroring makepkg's !libtool option.
func RemoveStatic ¶
RemoveStatic removes static library .a files from the package directory, mirroring makepkg's !static option.
func SetDebugDir ¶
func SetDebugDir(dir string)
SetDebugDir sets the output directory for debug symbols. This function is safe to call concurrently from multiple goroutines.
func Strip ¶
Strip walks through the directory to process each file. STRIP/OBJCOPY are read from the process environment.
func StripWithEnv ¶ added in v2.1.2
StripWithEnv is the env-overlay variant of Strip. STRIP/OBJCOPY are looked up in env first, falling back to os.Getenv when absent. Makes parallel builds safe: each goroutine can pass its own toolchain env without process-env mutation.