darwin

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package darwin handles macOS-specific build steps — wrapping the raw binary into a .app bundle and (host-darwin only) further wrapping that into a .dmg disk image. Pure-Go .app construction works from any host; .dmg requires the macOS-only `hdiutil` tool.

Index

Constants

This section is empty.

Variables

View Source
var ErrSkippedDMG = errors.New("dmg: hdiutil unavailable on non-darwin host")

ErrSkippedDMG is returned when DMG creation is skipped because the host OS is not darwin (hdiutil is macOS-only). Callers may treat this as a non-fatal warning.

Functions

func PackageApp

func PackageApp(binPath, appName, appVersion, bundleID string) (string, error)

PackageApp wraps a built darwin binary into a standard .app bundle:

bin/<app>.app/
├── Contents/
│   ├── Info.plist
│   ├── MacOS/<app>          (the binary, copied)
│   └── Resources/icon.icns  (rendered from the brand W)

Returns the bundle root path. The source binary at binPath is COPIED (not moved) so the raw artifact remains available for the self-updater and for naming-consistent CI uploads.

func PackageDMG

func PackageDMG(appPath, dmgPath, volName string) (string, error)

PackageDMG wraps an existing .app bundle into a UDZO-compressed .dmg disk image via the macOS `hdiutil` tool. Returns the .dmg path on success; returns ErrSkippedDMG when the host is not darwin (the .app bundle alone is still useful in that case).

volName is the visible name when the user mounts the disk image; dmgPath is the output filename (typically <app>-darwin-<arch>.dmg).

Types

This section is empty.

Jump to

Keyboard shortcuts

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