Skip to content

Instantly share code, notes, and snippets.

@samliu
Forked from kktse/README.md
Created August 11, 2024 07:49
Show Gist options
  • Save samliu/1abe9f38f82edc4d01a4156d17ead657 to your computer and use it in GitHub Desktop.
Save samliu/1abe9f38f82edc4d01a4156d17ead657 to your computer and use it in GitHub Desktop.
Installing brlaser CUPS drivers for printing on Apple Silicon Macs and Brother printers

Installing brlaser CUPS drivers for printing on Apple Silicon Macs and Brother printers

Problem

You own a Mac running MacOS and want to print a document using a Brother printer. You also prefer not to use MacPorts because you have another package maanger installed.

Environment

  • I used a 2021 Macbook Pro 14" running Sonoma 14.0
  • I am using Homebrew as a package manager
  • The printer is a Brother DCP-7030

Current solutions

Build & Install

Prerequisites

You will need a C compiler (clang) and cmake. I installed cmake using homebrew

$ brew install cmake

Clone or download the latest brlaser source code.

$ curl -LO https://github.com/pdewacht/brlaser/archive/refs/tags/v6.tar.gz
$ tar xvzf v6.tar.gz

Compile

$ cd brlaser-6
$ cmake .
$ make
$ ppdc brlaser.drv -d ppd

Fun fact: ppdc is deprecated according to its man page

Install

The make install error

Apparently /usr/share is a protected directory for MacOS which causes problems when running sudo make install. Since installation is relatively straightforward, I will just do it manually. If you figure out a better way of doing this just leave a comment and I will update the steps.

$ sudo make install
Password:
[ 41%] Built target rastertobrlaser
[ 58%] Built target test_lest
[ 83%] Built target test_line
[100%] Built target test_block
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/libexec/cups/filter/rastertobrlaser
-- Installing: /usr/share/cups/drv/brlaser.drv
CMake Error at cmake_install.cmake:67 (file):
  file INSTALL cannot copy file
  "/Users/kktse/src/build/brlaser-6/brlaser.drv" to
  "/usr/share/cups/drv/brlaser.drv": Operation not permitted.

Manual installation

Install rastertobrlaser

$ sudo mv rastertobrlaser /usr/libexec/cups/filter/rastertobrlaser
$ sudo chown root:wheel /usr/libexec/cups/filter/rastertobrlaser

Install PPD files

$ sudo mv ppd/*.ppd /Library/Printers/PPDs/Contents/Resources/
$ sudo shown root:wheel /Library/Printers/PPDs/Contents/Resources/*.ppd

Printer setup

Plug in the printer and select the brlaser6 driver.

You may now celebrate by doing a dance, or putting away your baseball bats.

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