platform

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

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

View Source
var Supported = PlatformInfo{
	MacOSVersions: []MacOSVersion{
		{Major: 27, Symbol: "golden_gate"},
		{Major: 26, Symbol: "tahoe"},
		{Major: 15, Symbol: "sequoia"},
		{Major: 14, Symbol: "sonoma"},
		{Major: 13, Symbol: "ventura"},
		{Major: 12, Symbol: "monterey"},
	},
	LinuxArches: []string{"x86_64", "arm64"},
}

Supported is the platform set gobottle targets. Update it when brew adds or drops a macOS release; only the oldest entry affects the bottles produced.

Functions

func FormatPlatformList

func FormatPlatformList(info *PlatformInfo) string

FormatPlatformList returns a human-readable list of platforms

func NormalizeTag added in v0.8.2

func NormalizeTag(tag string) string

NormalizeTag maps legacy bottle tag spellings onto the ones gobottle emits (aarch64_linux -> arm64_linux), so platform filters written against older releases keep matching.

func ParsePlatformTag

func ParsePlatformTag(tag string) (os, arch, version string)

ParsePlatformTag parses a Homebrew platform tag into OS, arch, and version

Types

type MacOSVersion

type MacOSVersion struct {
	Major  int    // e.g., 15
	Symbol string // e.g., "sequoia"
}

MacOSVersion represents a macOS version with its codename

func (MacOSVersion) String

func (v MacOSVersion) String() string

type Platform

type Platform struct {
	Tag            string // e.g., "arm64_sonoma", "x86_64_linux"
	OS             string // "darwin" or "linux"
	Arch           string // "amd64" or "arm64"
	OSVersion      string // e.g., "sonoma", "ventura" (macOS codename), or empty for Linux
	OSVersionMajor int    // e.g., 14 for sonoma; 0 for Linux
}

Platform represents a Homebrew bottle platform tag

func FilterPlatforms

func FilterPlatforms(platforms []Platform, include, exclude []string) []Platform

FilterPlatforms filters platforms based on include/exclude lists

func (Platform) String

func (p Platform) String() string

type PlatformInfo

type PlatformInfo struct {
	MacOSVersions []MacOSVersion // Supported macOS versions (newest first)
	LinuxArches   []string       // e.g., ["x86_64", "arm64"]
}

PlatformInfo holds platform information

func (*PlatformInfo) AllPlatforms

func (pi *PlatformInfo) AllPlatforms() []Platform

AllPlatforms returns all possible platform tags

func (*PlatformInfo) GetPlatformsForOS

func (pi *PlatformInfo) GetPlatformsForOS(goos, goarch string) []Platform

GetPlatformsForOS returns the Homebrew platform tag for a given OS/arch. For macOS, returns only the oldest supported version (e.g., monterey). Homebrew's fallback mechanism allows older bottles to install on newer macOS.

Jump to

Keyboard shortcuts

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