hcl

package
v0.0.0-...-21e25c3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package hcl is an HCL2 front-end for pkgx pantry recipes. A package.hcl is decoded into the SAME pantry.Recipe as a package.yml — via the same schema validation — so a recipe written either way produces an identical build.

Example (equivalent to the curl.se package.yml):

distributable {
  url              = "https://curl.se/download/curl-{{version}}.tar.bz2"
  strip-components = 1
}
dependencies = { "openssl.org" = "^1.1", "zlib.net" = "^1.2.11" }
build {
  script = ["./configure $ARGS", "make --jobs {{ hw.concurrency }} install"]
  env    = { ARGS = ["--prefix={{prefix}}", "--with-openssl"] }
}
provides = ["bin/curl", "bin/curl-config"]

Blocks express nested maps (build, test, distributable); object attributes express maps whose keys aren't HCL identifiers (eg. "openssl.org").

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(src []byte, filename string) (*pantry.Recipe, error)

Parse decodes a package.hcl into a validated pantry.Recipe.

func ToMap

func ToMap(src []byte, filename string) (map[string]any, error)

ToMap parses package.hcl into the generic map[string]any document shape that a package.yml decodes to.

Types

This section is empty.

Jump to

Keyboard shortcuts

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