Brewfile: libheif, because the Go binding is cgo and does not carry the codec - #84
Merged
Conversation
Hit on a work repo: `go run` died at `pkg-config --cflags -- libheif`, because github.com/strukturag/libheif is a binding, not a port — the codec itself has to be on the machine already. Portable CLI tooling, so one unguarded line: homebrew-core builds libheif on Linux too.
Go development: decoding HEIF/HEIC and rendering thumbnails from it. Plus the upstream link, since one repo carries both the C library and the cgo binding and that is the part that surprises.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One line in the
Brewfile, plus the comment that says why it is there.What it is for
Go development that handles images: decoding HEIF/HEIC — the format phones now shoot by default — and rendering thumbnails from it. strukturag/libheif is the upstream, and the surprise worth writing down is that one repo holds both halves: the C library, and the Go binding under
go/heif.Why it has to be installed
make runin a work Go repo, on this Mac, with the toolchain otherwise complete:The Go module is a binding, not a port. Its
go/heifpackage is cgo with#cgo pkg-config: libheif, sogo buildshells out topkg-configat compile time and fails there unless the C library and itslibheif.pcare already on the machine. Nothing ingo.modcan fix that —go mod downloadfetches the wrapper and the wrapper alone.So it belongs to the machine, next to
libpqandpoppler, which are here for the same reason.Placement
Unguarded, in the portable-CLI half — homebrew-core builds
libheifforx86_64_linuxas well, so the Kubuntu side needs noos/ubuntuentry. Alphabetical, beforelibpq.brew install libheifalso pullslibde265as a dependency; Homebrew resolves that itself, no line of its own.Checks
make apps-testpasses, andbrew bundle list --file Brewfileprintslibheif— so the Ruby parses and the entry is really in the list, not just in the file. After installing,pkg-config --modversion libheif→1.23.1and the build that started this gets through cgo.Not verified: the Linux bottle, since this was done on the Mac. It is in homebrew-core's
x86_64_linuxbottle list, which is the same evidence every other unguarded line here rests on.