diff --git a/packages/zvelte-check-bin/build.ncl b/packages/zvelte-check-bin/build.ncl new file mode 100644 index 00000000..07d836aa --- /dev/null +++ b/packages/zvelte-check-bin/build.ncl @@ -0,0 +1,49 @@ +let { Attrs, BuildSpec, Local, OutputBin, Source, .. } = import "minimal.ncl" in +let { target, .. } = import "config.ncl" in +let base = import "../base/build.ncl" in + +# Imported from the Homebrew formula `ampcode/homebrew-tap/zvelte-check` by `pkgmgr import homebrew`. +# +# PREBUILT vendor binary — there is no source build. The pinned sha256 +# per architecture is the ONLY integrity anchor for this package. +let version = "0.2.0" in +let target_suffix = match { { arch = 'Amd64, .. } => "x86_64", { arch = 'Arm64, .. } => "aarch64" } target in +{ + name = "zvelte-check-bin", + build_deps = [ + { file = "build.sh" } | Local, + match { + { arch = 'Amd64, .. } => + { + url = "https://github.com/ampcode/zvelte-check/releases/download/v%{version}/zvelte-check-linux-x86_64.tar.gz", + sha256 = "f3326fe48a0a2bc056b16ce424abd705ca7864d3632fd8f02ace1ea8ecfc8b9b", + } | Source, + { arch = 'Arm64, .. } => + { + url = "https://github.com/ampcode/zvelte-check/releases/download/v%{version}/zvelte-check-linux-aarch64.tar.gz", + sha256 = "05a2661648952ba12b2da618242698c3065d2db375340cb605288a38f59c4105", + } | Source, + } target, + base, + ], + # No runtime_deps: the installed binary is statically linked + # (verified against the built tree, not assumed). + + cmd = "./build.sh", + build_args = { include version, arch = target_suffix }, + + outputs = { + zvelte-check = { glob = "usr/bin/zvelte-check" } | OutputBin, + }, + + attrs = + { + upstream_version = version, + license_spdx = "MIT", + source_provenance = { + category = 'GithubRepo, + owner = "ampcode", + repo = "zvelte-check", + }, + } | Attrs, +} | BuildSpec diff --git a/packages/zvelte-check-bin/build.sh b/packages/zvelte-check-bin/build.sh new file mode 100755 index 00000000..b5894863 --- /dev/null +++ b/packages/zvelte-check-bin/build.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Imported from the Homebrew formula `ampcode/homebrew-tap/zvelte-check` by `pkgmgr import homebrew`. +# Prebuilt vendor binary: unpacked and installed, never compiled. +set -ex + +tar -xof "zvelte-check-linux-${MINIMAL_ARG_ARCH}.tar.gz" +install -D -m 755 "zvelte-check" "$OUTPUT_DIR/usr/bin/zvelte-check"