Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mulch/expertise/alpine-printer-drivers.jsonl
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{"type":"pattern","classification":"tactical","recorded_at":"2026-09-09T08:44:50.372Z","evidence":{"commit":"df9d14d7f8120e589aa7aff8d069c18cb7e71b36"},"name":"gutenprint-cups package split","description":"On Alpine, Gutenprint is split: 'gutenprint' (libs/tools) vs 'gutenprint-cups' (CUPS filters rastertogutenprint + PPDs under /usr/share/cups/model, community repo, arch=all). To make Canon/HP/Brother/etc models appear in the CUPS add-printer list, install gutenprint-cups in addition to gutenprint (verified for PR #33: v3.23 5.3.5-r0, ~51MiB compressed/~71MiB installed).","files":[".mulch/mulch.config.yaml"],"id":"mx-e69fba"}
{"type":"pattern","classification":"tactical","recorded_at":"2026-10-30T15:47:23.381Z","evidence":{"gh":"arest/cups-addon#43","commit":"293ca7873bdf80b7c487132ac71c25f1ee0949b2"},"outcomes":[{"status":"success","test_results":"Alpine 3.24 chroot: cmake build OK; ctest 4/4 passed; validate_addon.py + shellcheck OK"}],"name":"brlaser (Brother GDI) build on Alpine","description":"Owl-Maintain/brlaser v6.2.8 (GPL-2.0) builds cleanly on Alpine 3.24 with cmake, g++, make and cups-dev. Configure with -DCUPS_DATA_DIR=/usr/share/cups -DCUPS_SERVER_BIN=/usr/lib/cups; it installs /usr/lib/cups/filter/rastertobrlaser plus /usr/share/cups/drv/brlaser.drv, and all four upstream ctest suites pass. The vendored tree matches the v6.2.8 tarball byte-for-byte.","files":["cups/Dockerfile","cups/brlaser/CMakeLists.txt"],"id":"mx-204b31"}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [1.3.5] — 2026-10-24

- Add the open-source brlaser driver (Owl-Maintain/brlaser v6.2.8) for Brother
host-based (GDI) laser printers such as the HL-2130, HL-2140, HL-1110 and
DCP-7030/7055. These printers understand neither PCL nor PostScript, so the
bundled Gutenprint drivers left them silent. The models now appear in the
add-printer list as "Brother <model>, using Owl-Maintain/brlaser v6.2.8".

## [1.3.4] — 2026-10-21

- Preserve manual `cupsd.conf` edits (for example `ServerAlias *` made from the
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ the Alpine `gutenprint-cups` package. In the add-printer list, models often
appear as a series name (for example Canon PIXMA MG5250 is **Canon MG5200
series - CUPS+Gutenprint**).

Brother host-based (GDI) lasers that speak neither PCL nor PostScript (for
example HL-2130, HL-2140, HL-1110, DCP-7030/7055) are covered by the bundled
open-source brlaser driver: pick **Brother <model>, using brlaser**.

For printers Gutenprint does not cover, supply a `.deb` through
`printer_driver_deb` (place the file in `/share`) or use a PPD from:

Expand Down
23 changes: 23 additions & 0 deletions cups/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,29 @@ RUN \
rm -rf /tmp/dymo-cups-drivers && \
apk del .dymo-build

# Build and install brlaser, the open-source CUPS driver for Brother
# host-based (GDI) laser printers such as the HL-2130, HL-2140, HL-1110,
# DCP-7030 and many more. These printers speak neither PCL nor PostScript,
# so Gutenprint cannot drive them, and Brother's own Linux driver is an
# i386/glibc binary that does not run on Alpine. The vendored source is
# Owl-Maintain/brlaser v6.2.8 (GPL-2.0). Paths are pinned explicitly
# because the CUPS_DATADIR environment variable above points at /share.
COPY brlaser /tmp/brlaser
RUN \
apk add --no-cache --virtual .brlaser-build \
cmake \
g++ \
make \
cups-dev && \
cmake -S /tmp/brlaser -B /tmp/brlaser/build \
-DCMAKE_BUILD_TYPE=Release \
-DCUPS_DATA_DIR=/usr/share/cups \
-DCUPS_SERVER_BIN=/usr/lib/cups && \
cmake --build /tmp/brlaser/build && \
cmake --install /tmp/brlaser/build && \
rm -rf /tmp/brlaser && \
apk del .brlaser-build

# Copy data
COPY rootfs /

Expand Down
47 changes: 47 additions & 0 deletions cups/brlaser/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''

---

<!--
PLEASE FILL THIS TEMPLATE TO MAKE YOUR REPORT MORE HELPFUL FOR THE DEVELOPER!!

NOTE:
- Color Printers are not supported
- Ink-jet Printers are not supported
- Label Printers are not supported
-->

**Describe the bug**
A clear and concise description of what the bug is.

**Steps to Reproduce**
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Current behavior**
A clear and concise description of what is currently happening.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Terminal Output**
````
IF APPLICABLE, PASTE CODE OUTPUT HERE
````

**Desktop:**
- Operating System:
- brlaser Version:

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions cups/brlaser/.github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem?**
A clear and concise description of what the problem is.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
30 changes: 30 additions & 0 deletions cups/brlaser/.github/ISSUE_TEMPLATE/report-compatible-printer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Report Compatible Printer
about: Report a printer that has been verified as compatible
title: "[Compatible]"
labels: Verified Compatible
assignees: ''

---

<!--
TO MAKE YOUR REPORT MORE HELPFUL, PLEASE FILL IN THIS TEMPLATE
-->

**Printer Entry**:
<!-- sudo lpinfo --include-schemes usb -l -v -->
<!-- /usr/lib/cups/backend/snmp IP_ADDRESS_HERE -->
````
INSERT TERMINAL OUTPUT HERE
````

**Verified**: <!-- please mark [x] what you have tested -->
- [ ] test page printed
- [ ] tested 300dpi
- [ ] tested 600dpi
- [ ] tested 1200dpi
- [ ] tested simplex <!-- single-sided printing -->
- [ ] tested duplex <!-- if applicable -->

**Additional notes**:
<!-- Add any notes such as unexpected behavior, or possible issues. -->
39 changes: 39 additions & 0 deletions cups/brlaser/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build
on: [ push, pull_request ]
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [ clang++, gcc++ ]
steps:
- name: Add repository
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- name: Install packages
run: sudo apt install libcups2-dev
- uses: actions/checkout@v3
- name: Configure
run: cmake .
- name: Make
run: make
env:
CXX: ${{ matrix.compiler }}
- name: Run tests
run: make check
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
compiler: [ clang++, gcc++ ]
steps:
- uses: actions/checkout@v3
- name: Configure
run: cmake .
- name: Make
run: make
env:
CXX: ${{ matrix.compiler }}
- name: Run tests
run: make check
27 changes: 27 additions & 0 deletions cups/brlaser/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: release
run-name: ${{ github.actor }} is publishing release ${{ github.ref_name }}
on:
release:
types: [published]
workflow_dispatch:
jobs:
sha256:
name: sha256
runs-on: ubuntu-latest
steps:
- name: Zip url
run: echo "${{ github.server_url }}/${{ github.repository }}/archive/refs/tags/${{ github.ref_name }}.zip"
- name: Tarball url
run: echo "${{ github.server_url }}/${{ github.repository }}/archive/refs/tags/${{ github.ref_name }}.tar.gz"
- name: Create Source Code Checksums
run: |
curl -sL "${{ github.server_url }}/${{ github.repository }}/archive/refs/tags/${{ github.ref_name }}.zip" | shasum -a 256 | cut -d " " -f 1 >> "${{ github.ref_name }}.zip.sha256"
curl -sL "${{ github.server_url }}/${{ github.repository }}/archive/refs/tags/${{ github.ref_name }}.tar.gz" | shasum -a 256 | cut -d " " -f 1 >> "${{ github.ref_name }}.tar.gz.sha256"
- name: Upload Source Code Checksums
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.ref_name }}*
file_glob: true
tag: ${{ github.ref }}
overwrite: false
2 changes: 2 additions & 0 deletions cups/brlaser/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*~
build/
140 changes: 140 additions & 0 deletions cups/brlaser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
cmake_minimum_required(VERSION 3.10)
project(Owl-Maintain/brlaser CXX)
set(BRLASER_VERSION "6.2.8")

if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No build type selected, default to RelWithDebInfo")
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Build type (default RelWithDebInfo)" FORCE)
endif()

include(CMakePushCheckState)
include(CheckCXXCompilerFlag)
include(CheckIncludeFileCXX)


## Enable assertions for all builds
## (cmake by default sets NDEBUG for release builds)

foreach(var
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL)
string(REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " " "${var}" "${${var}}")
endforeach()


## Configure the compiler

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

macro(extra_cxx_compiler_flag FLAG)
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SFLAG ${FLAG})
check_cxx_compiler_flag(${FLAG} COMPILER_SUPPORT_${SFLAG})
if(COMPILER_SUPPORT_${SFLAG})
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} ${FLAG}")
endif()
endmacro(extra_cxx_compiler_flag)

# Compiler warnings
extra_cxx_compiler_flag("-Wall")
extra_cxx_compiler_flag("-Wno-missing-braces")
extra_cxx_compiler_flag("-Wdate-time")
# Some hardening flags
extra_cxx_compiler_flag("-fstack-protector-strong")
extra_cxx_compiler_flag("-Wformat")
extra_cxx_compiler_flag("-Wformat -Werror=format-security")
extra_cxx_compiler_flag("-D_FORTIFY_SOURCE=2")
# Enable the supported flags, but give priority to CXXFLAGS env var
set(CMAKE_CXX_FLAGS "${EXTRA_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")


## Configure CUPS

find_program(CUPS_CONFIG NAMES cups-config)
if(NOT CUPS_CONFIG)
message(FATAL_ERROR "cups-config command not found. Are the CUPS development packages installed?")
endif()

if(NOT CUPS_DATA_DIR)
execute_process(
COMMAND "${CUPS_CONFIG}" --datadir
OUTPUT_VARIABLE CUPS_DATA_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT CUPS_SERVER_BIN)
execute_process(
COMMAND "${CUPS_CONFIG}" --serverbin
OUTPUT_VARIABLE CUPS_SERVER_BIN
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT CUPS_CFLAGS)
execute_process(
COMMAND "${CUPS_CONFIG}" --cflags
OUTPUT_VARIABLE CUPS_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT CUPS_LDFLAGS)
execute_process(
COMMAND "${CUPS_CONFIG}" --ldflags
OUTPUT_VARIABLE CUPS_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT CUPS_LIBS)
execute_process(
COMMAND "${CUPS_CONFIG}" --image --libs
OUTPUT_VARIABLE CUPS_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

cmake_push_check_state()
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${CUPS_CFLAGS}")
check_include_file_cxx(cups/raster.h HAVE_CUPS_RASTER_H)
cmake_pop_check_state()
if(NOT HAVE_CUPS_RASTER_H)
message(SEND_ERROR "<cups/raster.h> header not found. Are the CUPS development packages installed?")
endif()


## Build instructions

configure_file(
"${PROJECT_SOURCE_DIR}/brlaser.drv.in"
"${PROJECT_BINARY_DIR}/brlaser.drv")

configure_file(
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_BINARY_DIR}/config.h")

include_directories("${PROJECT_BINARY_DIR}")

add_executable(rastertobrlaser src/main.cc src/job.cc src/line.cc src/debug.cc)
target_compile_options(rastertobrlaser PRIVATE ${CUPS_CFLAGS})
target_link_libraries(rastertobrlaser ${CUPS_LIBS})
target_link_libraries(rastertobrlaser ${CUPS_LDFLAGS})

add_executable(brdecode EXCLUDE_FROM_ALL src/brdecode.cc)
add_executable(test_lest test/test_lest.cc)
add_executable(test_line test/test_line.cc src/line.cc)
add_executable(test_block test/test_block.cc)
add_executable(test_job test/test_job.cc src/job.cc src/line.cc)

enable_testing()
add_test(test_lest test_lest)
add_test(test_line test_line)
add_test(test_block test_block)
add_test(test_job test_job)

# Autotools-style "make check" command
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
add_dependencies(check test_lest test_line test_block test_job)


# Installation

install(
TARGETS rastertobrlaser
DESTINATION "${CUPS_SERVER_BIN}/filter")
install(
FILES "${PROJECT_BINARY_DIR}/brlaser.drv"
DESTINATION "${CUPS_DATA_DIR}/drv")
Loading
Loading