
AUTHOR: Richard Mains <rkm@usol.com>

DATE: 2026-01-16

LICENSE: GNU GENERAL PUBLIC LICENSE

SYNOPSIS: Fixes for building hplip-3.25.8

ATTACHMENTS: https://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/hplip-3.25.8_fix.patch

HINT:

I built blfs-12.4 according to the stable book, including all the
packages I thought are involved with printing. Because I have
two HP printers I also needed to install hplip, which is mentioned
in the blfs-12.4 book but is not supported. For hplip I also needed
to install net-snmp, which is also mentioned but not supported. I
installed net-snmp (from http://www.net-snmp.org/) as follows:

unzip net-snmp-5.9.4.zip
cd net-snmp-5.9.4
# answer questions during configure
./configure
make
make install

At the time, the latest source code version was hplip-3.25.8.tar.gz.
I was able able to run .configure (along with various options)
without any problems, but "make" always ended with errors, of
which there were many. (I also ran "make -d" instead of "make",
which gives a lot more debugging information). I ended up finding
make errors in 13 different files, but unfortunately when "make"
encountered any errors in a file it would stop, so I had to first
try to correct the errors in that particular file and then run
"make" again to find errors in the next file. Most of the errors
were due to implicit function declarations, which gcc now
flags as errors, but there were some other issues as well.

I am not a C expert, although I do have a lot of experience
programming at a basic level. Its convoluted use of functions
and pointers can sometimes make my head spin. So I can't
guarantee that all of my corrections are 100% correct. In
many cases the fixes were straight-forward, but for other
ones I had to make my "best guess" to correct the problem.
All I can say for certain is that the fixes allowed me to
build the package and to use my printers (although I still
haven't been able to get the scanner part of my HP7602
all-in-one printer to work in blfs).

With the help of the blfs-support mailing list, I was able
to upload a blfs hint and a patch file (hplip-3.25.8_fix.patch,
found in the attachments to the hints) which implements the
changes that I made in the hplip-3.25.8 source code. I also
identified the changes with comments in each of the altered
files. The comment blocs all begin with "rkm mods" and end
with "end rkm mods". (Note that "end rkm mods" does not
necessarily mean that there are no other modifications further
along in the files, it just indicates the end of that particular
bloc. Also, in one case where many lines had the same change,
I didn't surround each line with comments, but rather I
included the line:
Replaced every instance of "SANE_Char**" with "void *"
within a comment bloc).

There are changes in the following files, assuming you are
in the expanded hplip-3.25.8 directory:

prnt/cupsext/
scan/sane/
scan/sane/
io/hpmud
io/hpmud
io/hpmud
prnt/hpcups/
scan/sane/
scan/sane/
pcard/pcardext/
prnt/hpps/
scan/sane/ledmi.h
scan/sane/orblite.c

For my system, I built and installed hplip-3.25.8 using the
following ./configure options:

./configure --enable-pp-build --enable-hpijs-install --enable-hpijs-only-build=no --enable-new-hpcups --enable-hpcups-install --enable-qt4=no --prefix=/usr

I also tested "make" with these options that were suggested on the
blfs-support mailing list, but I didn't install them:

./configure --prefix=/usr --enable-pp-build
./configure --prefix=/usr --sysconfdir=/etc --enable-cups-ppd-install

Both of these also allowed "make" to build successfully.

Here are the steps that I used to build and install hplip-3.25.8
on my system:

cp hplip-3.25.8_fix.patch /sources
cp hplip-3.25.8.tar.gz /sources
cd /sources
tar xvzf hplip-3.25.8.tar.gz
cd hplip-3.25.8
patch -p1 < ../hplip-3.25.8_fix.patch
./configure --enable-pp-build --enable-hpijs-install --enable-hpijs-only-build=no --enable-new-hpcups --enable-hpcups-install --enable-qt4=no --prefix=/usr
make
(as root:)
make install

I was surprised that the released hplip-3.25.8 source code had so many
issues, which leads me to suspect that there may be something I am
missing that could avoid these problems. If anyone knows of a simpler
fix I would love to know about it.

I hope that this hint will be helpful for other hplip users. And I
hope that future releases of hplip will not have such problems!
