These notes walk through building standalone binaries for each supported platform without requiring Go on the target machine.
- Go 1.21+ and the project dependencies installed on this machine.
- Poppler CLI tools (
pdftotext,pdfinfo) available so you can test the Linux build; end users still need these tools, but not Go.
From the repo root (/home/han/Projects/go-pdf):
mkdir -p dist- Linux (amd64)
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \ go build -o dist/gorae-linux-amd64 ./cmd/gorae ./dist/gorae-linux-amd64 -help # sanity-check - macOS (Intel)
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 \ go build -o dist/gorae-darwin-amd64 ./cmd/gorae
- macOS (Apple Silicon)
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 \ go build -o dist/gorae-darwin-arm64 ./cmd/gorae
- Windows (amd64)
sudo apt-get update sudo apt-get install -y mingw-w64 CGO_ENABLED=1 GOOS=windows GOARCH=amd64 \ CC=x86_64-w64-mingw32-gcc \ go build -o dist/gorae-windows-amd64.exe ./cmd/gorae
- Share the files inside
dist/that match each user's platform. Compress them if needed. - Users copy the binary to a directory on their
PATH(e.g.,~/.local/bin,/usr/local/bin,%USERPROFILE%\\bin) and rungorae -root /path/to/Papers. - No Go toolchain required on the target system, but Poppler tools must be installed for metadata/text extraction features.
(Keep this file out of version control; see .gitignore.)