options

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package options provides build and packaging option utilities, including binary stripping functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(packageDir string, o Options) error

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

func ApplyWithEnv(packageDir string, o Options, env map[string]string) error

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

func Purge(packageDir string) error

Purge removes files matching PURGE_TARGETS from the package directory, mirroring makepkg's purge option.

func RemoveDocs

func RemoveDocs(packageDir string) error

RemoveDocs removes documentation directories from the package directory, mirroring makepkg's !docs option.

func RemoveEmptyDirs

func RemoveEmptyDirs(packageDir string) error

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

func RemoveLibtool(packageDir string) error

RemoveLibtool removes libtool .la files from the package directory, mirroring makepkg's !libtool option.

func RemoveStatic

func RemoveStatic(packageDir string) error

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

func Strip(packageDir string) error

Strip walks through the directory to process each file. STRIP/OBJCOPY are read from the process environment.

func StripWithEnv added in v2.1.2

func StripWithEnv(packageDir string, env map[string]string) error

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.

func ZipMan

func ZipMan(packageDir string) error

ZipMan compresses man and info pages with gzip, mirroring makepkg's zipman option.

Types

type Options

type Options struct {
	DebugEnabled     bool
	DocsEnabled      bool
	EmptyDirsEnabled bool
	LibtoolEnabled   bool
	PurgeEnabled     bool
	StaticEnabled    bool
	StripEnabled     bool
	ZipManEnabled    bool
}

Options holds the resolved flags from a PKGBUILD options array.

Jump to

Keyboard shortcuts

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