Skip to content

Fix build on macOS - #31

Open
zeddapuras wants to merge 1 commit into
OpenPrinting:masterfrom
zeddapuras:macos-build
Open

zeddapuras wants to merge 1 commit into
OpenPrinting:masterfrom
zeddapuras:macos-build

Conversation

@zeddapuras

Copy link
Copy Markdown

Building on macOS currently fails. macOS ships no cups.pc, so the pkg-config calls in module.mk expand to nothing, and the jbigkit headers are not found (see #3).

This adds a Darwin branch to module.mk:

  • cups-config for compiler/linker flags and CUPS directories
  • link libcups only: on macOS the raster API is in libcups, so -lcupsimage is not needed
  • look for jbigkit in Homebrew (/opt/homebrew, /usr/local) and MacPorts (/opt/local), overridable with JBIGDIR
  • honour ARCHFLAGS, e.g. ARCHFLAGS="-arch arm64 -arch x86_64" for a universal binary

Linux and other platforms are unchanged.

Testing

  • macOS 26.6 on Apple Silicon, Apple clang 21, Homebrew jbigkit 2.1: plain make builds a native arm64 rastertoqpdl linked only against system libraries. With ARCHFLAGS="-arch arm64 -arch x86_64" it builds a universal binary, and both slices produce identical output.
  • Printing on a Samsung ML-2160 over Wi-Fi through CUPS works with the resulting filter. This replaces the vendor driver, which is Intel-only and crashes under Rosetta ("Filter failed").

Notes

🤖 Generated with Claude Code

macOS has no cups.pc, so the pkg-config calls in module.mk expand to
nothing and the build fails (see OpenPrinting#3). The raster API also lives in libcups
itself, so -lcupsimage is not needed.

On Darwin:
- use cups-config for compiler/linker flags and CUPS directories
- look for jbigkit in Homebrew (Apple Silicon and Intel) and MacPorts,
  overridable with JBIGDIR
- honour ARCHFLAGS, e.g. ARCHFLAGS="-arch arm64 -arch x86_64" for a
  universal binary

Other platforms are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant