# Coral Package Definition
# /usr/ports/<category>/<name>/package.toml
#
# This is a sample package.toml showing all available options.
# Only [package] section with name and version is required.

[package]
# Required: Package name (lowercase, alphanumeric, hyphens allowed)
name = "example-package"

# Required: Package version (semantic versioning recommended)
version = "1.2.3"

# Package release number (increment when rebuilding same version)
release = 1

# Short description of the package
description = "An example package demonstrating all package.toml options"

# Project homepage URL
url = "https://example.com/example-package"

# License identifier (SPDX recommended: MIT, BSD-2-Clause, GPL-3.0, etc.)
license = "MIT"

# Package maintainer
maintainer = "Your Name <you@example.com>"

# Target architecture (x86_64, aarch64, or "any" for arch-independent)
arch = "x86_64"

# Alternative package names this provides (for dependency resolution)
# If another package depends on "editor", this package can satisfy it
alternatives = ["editor", "text-editor"]

# Packages this conflicts with (cannot be installed together)
conflicts = ["other-editor"]

[dependencies]
# Packages required at runtime
runtime = ["libfoo", "libbar"]

# Packages required only for building
build = ["gcc", "gmake", "pkg-config"]

# Alternative dependencies: any one of the listed packages satisfies the dep
# Format: "base_name:option1,option2,option3"
# Example: depends on any database
# runtime = ["database:postgresql,mysql,sqlite"]

# =============================================================================
# Source Files - New format with mirror support (recommended)
# =============================================================================

# Each [[source]] block defines a source file to download
[[source]]
# Output filename (what to save the file as)
file = "example-package-1.2.3.tar.gz"

# URLs to download from (tried in order until success)
# Can mix remote URLs and local files (relative to port directory)
urls = [
    "https://example.com/releases/example-package-1.2.3.tar.gz",
    "https://mirror.example.org/example-package-1.2.3.tar.gz",
    "example-package-1.2.3.tar.gz"
]

# SHA256 checksum for verification
# Use "SKIP" to skip verification (not recommended for production)
checksum = "abc123def456789..."

# Whether to extract the archive (default: true)
# Set to false for files that shouldn't be extracted (patches, data files)
extract = true

# Multiple sources example:
# [[source]]
# file = "extra-data.tar.gz"
# urls = ["https://example.com/extra-data.tar.gz"]
# checksum = "789xyz..."
# extract = false

# =============================================================================
# Legacy Source Format (deprecated, still supported)
# =============================================================================
# [sources]
# urls = ["https://example.com/example-package-1.2.3.tar.gz"]
# checksums = ["abc123def456789..."]

[patches]
# Patch files to apply (in order), relative to port directory
files = [
    "patches/fix-build.patch",
    "patches/add-feature.patch"
]

# Strip level for patch command (-p flag)
strip = 1

[build]
# Enable parallel builds
parallel = true

# Number of parallel jobs (0 = auto-detect, uses JOBS env var)
jobs = 0
