HPLIP on Mac OS X

Bug #694216 reported by John Freed
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
HPLIP
In Progress
Undecided
Unassigned

Bug Description

I have been working on porting HPLIP via MacPorts, and it works like a charm. This will be of tremendous use to people who want to scan using an HP All-In-One on the Mac. It works with xsane, and the scanner can be placed on the network with saned -- it all "just works."

There are a very few small problems with building the project -- two files won't compile because of scoping errors with "strnlen", and there is a symbol conflict in one file that prevents linking. Other than that, everything works fine.

I have attached patches for your consideration.

Revision history for this message
John Freed (oklp) wrote :
Revision history for this message
John Freed (oklp) wrote :
Revision history for this message
John Freed (oklp) wrote :
Revision history for this message
Naga Samrat Chowdary, Narla (samrat-hplip) wrote :

Nice to know that HP LIP is working on Mac.
Thanks for providing these patches. i have few questions, can you please give me the details?

1. In the patches "patch-prnt_hpijs_context2.cpp" and "patch-prnt_hpijs_ljzjscolor.cpp" you have added functions LJ_strnlen() and APDK_strnlen() to strnlen().
we have included <string.h> in jinclude.h file and this header file we are given at the compile time through makefile.
can you give compilation errors displaying on MAC?
Instead of 2nd and 3rd patches, can you please try the following steps
open file "prnt/hpijs/context2.cpp" "prnt/hpijs/ljzjscolor.cpp" and put the line below the header files inclusion "# include <string.h>"

2. Instead of the first patch, can you apply the following settings and let me know the result
open file scan/sane/common.c
put "#ifdef HP_DEBUG" just above line of sysdump() definition and "#endif" in next line after end of sysdump() definition.

Thanks,
Naga Samrat Chowdary, Narla

Changed in hplip:
status: New → In Progress
Revision history for this message
John Freed (oklp) wrote :

I note that the same (or similar) solution was adopted for the file ijs_server.c

Here is the error

prnt/hpijs/context2.cpp: In member function ‘apdk::DRIVER_ERROR apdk::PrintContext::SelectDevice(const char*)’:
prnt/hpijs/context2.cpp:1302: error: ‘strnlen’ was not declared in this scope
make: *** [libapdk_la-context2.lo] Error 1

I presume you did not mean to include the space after the # in the line "#include <string.h>". It now looks like this near the top:

// PrintContext

#include "header.h"
#include "pmselect.h"
#include "printerfactory.h"

#include "halftoner.h"
#include "colormatch.h"
//#include "bug.h"
#include <string.h>

APDK_BEGIN_NAMESPACE

No improvement. The error is identical except for the line number.

For the sysdump, the #ifdef solves it, thanks.

Revision history for this message
John Freed (oklp) wrote :

Sure enough, I just looked at /usr/include/string.h on the Mac, and Apple's (darwin) version does NOT include a strnlen. Anywhere. It appears that strnlen is a GNU extension and not supported on Darwin (and some other platforms, Google tells me...)

Revision history for this message
Naga Samrat Chowdary, Narla (samrat-hplip) wrote :

Thanks for the detailed information. I will update tip with #def patch.
And let you know more updates

Thanks,
Naga Samrat Chowdary, Narla

Revision history for this message
Ricardo Fabbri (rfabbri) wrote :

Hi,

I've ported hplip to Mac OSX 10.9.4 (Mavericks). I had to make a series of minor fixes to the source code and build system.
The entire build procedure are available at

http://wiki.nosdigitais.teia.org.br/Mac#Using_old_scanners_and_printers_through_SANE

The changes I had to made on top of the official hplip are available in my github account:
http://github.com/rfabbri/hplip

Best regards & Thanks for releasing HPLIP's source code.

Revision history for this message
John Freed (oklp) wrote :

Thanks so much, Ricardo! I will look over your changes and incorporate them into the HPLIP port for Macports. Even though I submitted this port several years ago, and continue to update it, it has never been accepted by the "official" Macports maintainers. Sigh.

This takes on some urgency for me, because ever since I upgraded to Mavericks, I have been getting a segfault from scanimage. I hope this fixes it!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.