pkgconfig

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package pkgconfig creates, configures, and queries pkg-config metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CFlags

func CFlags(name string) (string, error)

CFlags returns the compiler flags for name.

func Libs

func Libs(name string) (string, error)

Libs returns the linker flags for name.

func Lookup

func Lookup(name string) (string, error)

Lookup returns the compiler and linker flags for name.

func StaticLibs

func StaticLibs(name string) (string, error)

StaticLibs returns the static linker flags for name.

func Use

func Use(root string)

Use makes pkg-config metadata installed at root available to subsequent queries.

Types

type File added in v0.3.3

type File struct {
	// contains filtered or unexported fields
}

File is pkg-config metadata ready to be written.

func New added in v0.3.3

func New(spec *Spec) (*File, error)

New creates a relocatable pkg-config file.

func (*File) Cflags added in v0.3.3

func (f *File) Cflags() *fragments

Cflags returns the compiler fragments.

func (*File) Libs added in v0.3.3

func (f *File) Libs() *fragments

Libs returns the linking fragments.

func (*File) WriteTo added in v0.3.3

func (f *File) WriteTo(w io.Writer) (n int64, err error)

WriteTo encodes the pkg-config file and writes it to w.

type Spec added in v0.3.3

type Spec struct {
	// Variables defines pkg-config variables. Values override the default
	// prefix, exec_prefix, libdir, and includedir variables with the same name.
	Variables map[string]string

	// Name: The displayed name of the package.
	Name string
	// Description: A description of the package.
	Description string
	// Version: The version of the package.
	Version string
	// URL: A URL to a webpage for the package. This is used to recommend where
	// newer versions of the package can be acquired.
	URL string
	// Requires: Required dependencies that must be met for the package to be
	// usable. All dependencies must be satisfied or the pkg-config
	// implementation must not use the package.
	Requires []string
	// Libs: Required linking flags for this package.
	Libs []string
	// Cflags: Required compiler flags. These flags are always used, regardless
	// of whether static compilation is requested.
	Cflags []string
}

Spec describes the variables and properties written to a pkg-config file.

Jump to

Keyboard shortcuts

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