This commit is contained in:
ziggi
2021-04-12 15:14:02 +00:00
parent ba2f98877d
commit e8f2519b54
18 changed files with 1848 additions and 2 deletions

162
print/cups-hplip20/Makefile Normal file
View File

@@ -0,0 +1,162 @@
#
# $Id$
#
PORTNAME= hplip
PORTVERSION= 3.20.6
CATEGORIES= print
MASTER_SITES= SF
PKGNAMEPREFIX= cups-
MAINTAINER= onborodin@gmail.com
COMMENT= Drivers and utilities for HP Printers and All-in-One devices
LIB_DEPENDS+= libjpeg.so:graph/libjpeg
LIB_DEPENDS+= libcups.so:print/cups-base
LIB_DEPENDS+= libcupsimage.so:print/cups-base
CONFLICTS= hpijs-[0-9]*
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --with-cupsbackenddir=${PREFIX}/libexec/cups/backend
CONFIGURE_ARGS+= --with-cupsfilterdir=${PREFIX}/libexec/cups/filter
CONFIGURE_ARGS+= --with-icondir=${DESKTOPDIR}
CONFIGURE_ARGS+= --with-systraydir=${PREFIX}/etc/xdg/autostart
CONFIGURE_ARGS+= --with-hpppddir=${PREFIX}/share/cups/model/hplip/HP
CONFIGURE_ARGS+= --with-mimedir=${PREFIX}/etc/cups
CONFIGURE_ARGS+= --with-docdir=${DOCSDIR}
CONFIGURE_ARGS+= --with-drvdir=${PREFIX}/share/cups/driver
CPPFLAGS+= -I${LOCALBASE}/include -pthread
LDFLAGS+= -L${LOCALBASE}/lib ${PTHREAD_LIBS} -pthread
#CONFIGURE_ARGS+= --enable-cups11-build
#CONFIGURE_ARGS+= --enable-dbus-build
#CONFIGURE_ARGS+= --enable-fax-build
#CONFIGURE_ARGS+= --enable-gui-build
#CONFIGURE_ARGS+= --enable-hpcups-only-build
#CONFIGURE_ARGS+= --enable-hpijs-only-build
#CONFIGURE_ARGS+= --enable-network-build
#CONFIGURE_ARGS+= --enable-new-hpcups
#CONFIGURE_ARGS+= --enable-policykit
#CONFIGURE_ARGS+= --enable-pp-build
#CONFIGURE_ARGS+= --enable-qt3
#CONFIGURE_ARGS+= --enable-qt4
#CONFIGURE_ARGS+= --enable-scan-build
#CONFIGURE_ARGS+= --enable-shadow-build
CONFIGURE_ARGS+= --disable-dbus-build
CONFIGURE_ARGS+= --disable-doc-build
CONFIGURE_ARGS+= --disable-fax-build
CONFIGURE_ARGS+= --enable-foomatic-drv-install
CONFIGURE_ARGS+= --disable-foomatic-rip-hplip-install
CONFIGURE_ARGS+= --disable-gui-build
CONFIGURE_ARGS+= --disable-hpcups-install
CONFIGURE_ARGS+= --disable-network-build
CONFIGURE_ARGS+= --disable-qt4
CONFIGURE_ARGS+= --disable-scan-build
CONFIGURE_ARGS+= --enable-cups-drv-install
CONFIGURE_ARGS+= --enable-cups-ppd-install
CONFIGURE_ARGS+= --enable-foomatic-ppd-install
CONFIGURE_ARGS+= --enable-hpijs-install
CONFIGURE_ARGS+= --enable-hpijs-only-build
#CONFIGURE_ARGS+= --enable-lite-build
USES+= gmake
USE_LDCONFIG= yes
MAKE_JOBS_SAFE= yes
post-patch:
${REINPLACE_CMD} -e 's|-ldld||g;' \
-e 's|-ldl||g' \
-e 's,-lusb-1.0,-lusb,g' \
-e 's,libusb-1.0/libusb.h,libusb.h,g' \
${WRKSRC}/configure \
${WRKSRC}/Makefile.in
${REINPLACE_CMD} -e '/[[:space:]]install-dist_rulesDATA/ s,install-dist_rulesDATA,,' \
-e '/[[:space:]]install-dist_rulessystemDATA/ s,install-dist_rulessystemDATA,,' \
${WRKSRC}/Makefile.in
${REINPLACE_CMD} -e 's,/etc/hp,${PREFIX}&,g' \
-e 's,/etc/cups,${LOCALBASE}&,g' \
-e 's,/etc/init.d,${LOCALBASE}/etc/rc.d,g' \
-e 's,/etc/sane.d,${LOCALBASE}&,g' \
-e 's,/usr/share,${LOCALBASE}/share,g' \
-e 's,/usr/include,${LOCALBASE}/include,g' \
${WRKSRC}/Makefile.in \
${WRKSRC}/base/codes.py \
${WRKSRC}/base/g.py \
${WRKSRC}/base/password.py \
${WRKSRC}/base/pkit.py \
${WRKSRC}/base/queues.py \
${WRKSRC}/base/services.py \
${WRKSRC}/base/utils.py \
${WRKSRC}/check.py \
${WRKSRC}/fax/backend/hpfax.py \
${WRKSRC}/fax/coverpages.py \
${WRKSRC}/fax/filters/pstotiff \
${WRKSRC}/hplip.list.in \
${WRKSRC}/installer/core_install.py \
${WRKSRC}/installer/dcheck.py \
${WRKSRC}/installer/pluginhandler.py \
${WRKSRC}/logcapture.py \
${WRKSRC}/prnt/cups.py \
${WRKSRC}/prnt/filters/hpps \
${WRKSRC}/prnt/hpcups/HPCupsFilter.cpp \
${WRKSRC}/prnt/hpijs/globals.cpp \
${WRKSRC}/prnt/hpijs/hpcupsfax.cpp \
${WRKSRC}/prnt/hpijs/hpijs.cpp \
${WRKSRC}/ui/devmgr4.py \
${WRKSRC}/ui4/devmgr5.py \
${WRKSRC}/ui5/devmgr5.py
${REINPLACE_CMD} -e 's/umask(0)/umask(0o022)/' \
-e 's/umask(0o111)/umask(0o133)/' \
${WRKSRC}/base/os_utils.py \
${WRKSRC}/base/validation.py \
${WRKSRC}/fax/backend/hpfax.py \
${WRKSRC}/hpdio.py \
${WRKSRC}/installer/pluginhandler.py
_post-patch:
${REINPLACE_CMD} -e 's,-lpthread,${PTHREAD_LIBS},g' \
-e 's|-ldld||g; s|-ldl||g' \
${WRKSRC}/configure \
${WRKSRC}/Makefile.in
${REINPLACE_CMD} -e '/[[:space:]]install-dist_rulesDATA/ s,install-dist_rulesDATA,,' \
-e '/[[:space:]]install-hplip_confDATA/ s,install-hplip_confDATA,,' \
${WRKSRC}/Makefile.in
# ${REINPLACE_CMD} -e 's,/etc/hp,${PREFIX}&,g' \
# -e 's,/etc/cups,${LOCALBASE}&,g' \
# -e 's,/etc/init.d,${LOCALBASE}/etc/rc.d,g' \
# -e 's,/etc/sane.d,${LOCALBASE}&,g' \
# -e 's,/usr/share,${LOCALBASE}/share,g' \
# -e 's,/usr/include,${LOCALBASE}/include,g' \
# ${FILES4FIX:S,^,${WRKSRC}/,}
${REINPLACE_CMD} -e 's,%USB_INCLUDE%,${USB_INCLUDE},' \
${WRKSRC}/installer/core_install.py
${REINPLACE_CMD} -e '/[[:space:]]install-docDATA/ s|install-docDATA||' \
${WRKSRC}/Makefile.in
_post-install:
# ${INSTALL_DATA} ${WRKSRC}/hplip-systray.desktop ${PREFIX}/etc/xdg/autostart/hplip-systray.desktop
# ${MKDIR} ${PREFIX}/etc/hp
# ${INSTALL_DATA} ${WRKSRC}/hplip.conf ${EXAMPLESDIR}/hplip.conf.sample
# if [ ! -f ${PREFIX}/etc/hp/hplip.conf ]; then \
# ${INSTALL_DATA} ${PREFIX}/etc/hp/hplip.conf.sample \
# ${PREFIX}/etc/hp/hplip.conf; \
# fi
# @${CAT} ${PKGMESSAGE}
cd ${STAGEDIR}${PREFIX}/share/cups/model/hplip/HP && ${GZIP_CMD} -d *.gz
# ${INSTALL_SCRIPT} ${WRKSRC}/prnt/hpijs/foomatic-rip-hplip \
# ${PREFIX}/libexec/cups/filter/foomatic-rip-hplip
${REINPLACE_CMD} -e 's,foomatic-rip-hplip,foomatic-rip,g' ${STAGEDIR}${PREFIX}/share/cups/model/hplip/HP/*.ppd
.include <bsd.port.mk>

View File

@@ -0,0 +1,3 @@
TIMESTAMP = 1618215383
SHA256 (hplip-3.20.6.tar.gz) = c64b2d334348010a9911f4feb075b2aa669047e7adb86c72d4a6ee7d392a7c20
SIZE (hplip-3.20.6.tar.gz) = 25908476

View File

@@ -0,0 +1,78 @@
--- Makefile.in.orig 2019-10-22 06:32:27 UTC
+++ Makefile.in
@@ -103,7 +103,7 @@ DIST_COMMON = $(am__configure_deps) \
# ip library
@HPLIP_BUILD_TRUE@am__append_12 = libhpip.la
-@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@am__append_13 = prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so
+@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@am__append_13 = prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@am__append_14 = dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@am__append_15 = scan/sane/hpaio.desc \
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ installer/text_install.py \
@@ -377,6 +377,7 @@ am__libsane_hpaio_la_SOURCES_DIST = scan/sane/hpaio.c
scan/sane/sclpml.h common/utils.c common/utils.h \
scan/sane/escl.h scan/sane/escli.h scan/sane/escl.c \
scan/sane/orblitei.h scan/sane/orblite.h scan/sane/orblite.c \
+ scan/sane/OrbliteScan/BSDCommon.h \
scan/sane/OrbliteScan/LinuxCommon.h \
scan/sane/OrbliteScan/MacCommon.h
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@SCAN_BUILD_TRUE@am_libsane_hpaio_la_OBJECTS = libsane_hpaio_la-hpaio.lo \
@@ -500,8 +501,7 @@ am__hpcups_SOURCES_DIST = prnt/hpcups/HPCupsFilter.cpp
prnt/hpcups/RunLenEncoding.h prnt/hpcups/common_defines.h \
prnt/hpcups/genPCLm.h common/utils.c common/utils.h \
prnt/hpcups/Hbpl1_Wrapper.cpp prnt/hpcups/genPCLm.cpp \
- prnt/hpcups/genJPEGStrips.cpp prnt/hpcups/RunLenEncoding.cpp \
- prnt/hpcups/ImageProcessor.h
+ prnt/hpcups/genJPEGStrips.cpp prnt/hpcups/RunLenEncoding.cpp
@HPCUPS_INSTALL_TRUE@am_hpcups_OBJECTS = \
@HPCUPS_INSTALL_TRUE@ hpcups-HPCupsFilter.$(OBJEXT) \
@HPCUPS_INSTALL_TRUE@ hpcups-dbuscomm.$(OBJEXT) \
@@ -728,8 +728,6 @@ am__dist_locatedriver_DATA_DIST = locatedriver
am__dist_models_DATA_DIST = data/models/models.dat
am__dist_noinst_DATA_DIST = prnt/drv/hpijs.drv.in.template \
prnt/drv/hpcups.drv.in.template \
- prnt/hpcups/libImageProcessor-x86_64.so \
- prnt/hpcups/libImageProcessor-x86_32.so scan/sane/hpaio.desc \
installer/text_install.py data/localization/hplip_de.ts \
data/localization/hplip_es.ts data/localization/hplip_fr.ts \
data/localization/hplip_it.ts data/localization/hplip_pt.ts \
@@ -4407,7 +4405,7 @@ dist_unrel_DATA =
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@SCAN_BUILD_TRUE@ scan/sane/bb_ledm.c scan/sane/http.h scan/sane/http.c scan/sane/sclpml.c scan/sane/sclpml.h common/utils.c common/utils.h \
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@SCAN_BUILD_TRUE@ scan/sane/escl.h scan/sane/escli.h scan/sane/escl.c \
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@SCAN_BUILD_TRUE@ scan/sane/orblitei.h scan/sane/orblite.h scan/sane/orblite.c \
-@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@SCAN_BUILD_TRUE@ scan/sane/OrbliteScan/LinuxCommon.h scan/sane/OrbliteScan/MacCommon.h
+@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@SCAN_BUILD_TRUE@ scan/sane/OrbliteScan/BSDCommon.h scan/sane/OrbliteScan/LinuxCommon.h scan/sane/OrbliteScan/MacCommon.h
@DARWIN_BUILD_FALSE@@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@SCAN_BUILD_TRUE@libsane_hpaio_la_LDFLAGS = -version-info 1:0:0
@DARWIN_BUILD_TRUE@@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@SCAN_BUILD_TRUE@libsane_hpaio_la_LDFLAGS = -module -framework CoreFoundation -version-info 1:0:0
@@ -4802,11 +4800,10 @@ libapdk_la_CFLAGS = $(libapdk_la_CXXFLAGS) -Iprnt/hpij
@HPCUPS_INSTALL_TRUE@ prnt/hpcups/flate_colorspace.h prnt/hpcups/RunLenEncoding.h prnt/hpcups/common_defines.h \
@HPCUPS_INSTALL_TRUE@ prnt/hpcups/genPCLm.h \
@HPCUPS_INSTALL_TRUE@ common/utils.c common/utils.h prnt/hpcups/Hbpl1_Wrapper.cpp prnt/hpcups/genPCLm.cpp \
-@HPCUPS_INSTALL_TRUE@ prnt/hpcups/genJPEGStrips.cpp prnt/hpcups/RunLenEncoding.cpp \
-@HPCUPS_INSTALL_TRUE@ prnt/hpcups/ImageProcessor.h
+@HPCUPS_INSTALL_TRUE@ prnt/hpcups/genJPEGStrips.cpp prnt/hpcups/RunLenEncoding.cpp
@HPCUPS_INSTALL_TRUE@hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS)
-@HPCUPS_INSTALL_TRUE@hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS)
+@HPCUPS_INSTALL_TRUE@hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS)
#else
#hpcupsdir = $(cupsfilterdir)
#hpcups_PROGRAMS = hpcups
@@ -9577,16 +9574,6 @@ uninstall-am: uninstall-apparmor_abstractionDATA \
install-data-hook:
-@HPLIP_BUILD_TRUE@ if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \
-@HPLIP_BUILD_TRUE@ cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \
-@HPLIP_BUILD_TRUE@ chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \
-@HPLIP_BUILD_TRUE@ ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \
-@HPLIP_BUILD_TRUE@ fi; \
-@HPLIP_BUILD_TRUE@ if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \
-@HPLIP_BUILD_TRUE@ cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \
-@HPLIP_BUILD_TRUE@ chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \
-@HPLIP_BUILD_TRUE@ ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \
-@HPLIP_BUILD_TRUE@ fi
# If scanner build, add hpaio entry to sane dll.conf.
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ if [ "$(scan_build)" = "yes" ]; then \
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ $(mkinstalldirs) $(DESTDIR)/etc/sane.d; \

View File

@@ -0,0 +1,24 @@
--- installer/dcheck.py.orig 2019-11-03 15:17:23 UTC
+++ installer/dcheck.py
@@ -48,7 +48,11 @@ mod_output = ''
def update_ld_output():
# For library checks
global ld_output
- status, ld_output = utils.run('%s -p' % os.path.join(utils.which('ldconfig'), 'ldconfig'), log_output=False)
+ if sys.platform.startswith('freebsd'):
+ ld_cmd = '%s -r'
+ else: # linux
+ ld_cmd = '%s -p'
+ status, ld_output = utils.run(ld_cmd % os.path.join(utils.which('ldconfig'), 'ldconfig'), log_output=False)
if status != 0:
log.debug("ldconfig failed.")
@@ -378,6 +385,8 @@ def get_libpthread_version():
except ImportError:
return '-'
else:
+ if sys.platform.startswith('freebsd'):
+ return '-'
# LIBC = ctypes.CDLL(ctypes.util.find_library('c'), use_errno=True)
LIBC = ctypes.CDLL(ctypes.util.find_library('c'),ctypes.DEFAULT_MODE,None, True)
LIBC.gnu_get_libc_version.restype = ctypes.c_char_p

View File

@@ -0,0 +1,31 @@
--- io/hpmud/musb.c.orig 2016-08-26 10:05:31 UTC
+++ io/hpmud/musb.c
@@ -139,10 +139,16 @@ static int get_string_descriptor(libusb_
0x409,
tbuf, sizeof(tbuf), LIBUSB_CONTROL_REQ_TIMEOUT);
- if (ret==0)
+ if (ret==0
+#ifdef __FreeBSD__
+ || ret == -EIO
+#endif
+ )
{
- /* This retry is necessary for lj1000 and lj1005. des 12/12/07 */
- BUG("get_string_descriptor zero result, retrying...");
+ /* This retry is necessary for lj1000 and lj1005. des 12/12/07
+ Also HP Photosmart 42xx seems to suffer transient errors with serial id */
+ BUG("get_string_descriptor error result %d, retrying in 2 secs...", ret);
+ sleep(2);
continue;
}
break;
@@ -385,7 +391,7 @@ static int detach(libusb_device_handle *
{
int ret ;
/* If any kernel module has claimed this interface, detach it. */
- ret = libusb_kernel_driver_active (hd, interface);
+ ret = 0;
DBG("Active kernel driver on interface=%d ret=%d\n", interface, ret);
if (ret == 1)
{

View File

@@ -0,0 +1,10 @@
--- prnt/hpcups/CommonDefinitions.h.orig 2016-09-23 08:47:53 UTC
+++ prnt/hpcups/CommonDefinitions.h
@@ -41,6 +41,7 @@
#include <sys/stat.h>
#include <cups/cups.h>
#include <cups/raster.h>
+#include <cups/ppd.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

View File

@@ -0,0 +1,12 @@
--- prnt/hpcups/ErnieFilter.cpp.orig 2016-08-26 10:03:22 UTC
+++ prnt/hpcups/ErnieFilter.cpp
@@ -50,7 +50,8 @@
#include "ErnieFilter.h"
-#if defined(__APPLE__) || defined(__linux) || defined(__GLIBC__) || defined(__NetBSD__)
+#if defined(__APPLE__) || defined(__linux) || defined(__GLIBC__) \
+ || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
#include <math.h>
#endif

View File

@@ -0,0 +1,62 @@
--- prnt/hpcups/HPCupsFilter.cpp.orig 2019-10-22 06:14:20 UTC
+++ prnt/hpcups/HPCupsFilter.cpp
@@ -31,7 +31,6 @@
\*****************************************************************************/
#include "HPCupsFilter.h"
-#include "ImageProcessor.h"
#include <signal.h>
#include <sys/wait.h>
@@ -637,16 +636,10 @@ int HPCupsFilter::processRasterData(cups_raster_t *cup
sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name);
- image_processor_t* imageProcessor = imageProcessorCreate();
while (cupsRasterReadHeader2(cups_raster, &cups_header))
{
- IMAGE_PROCESSOR_ERROR result = imageProcessorStartPage(imageProcessor, &cups_header);
- if (result != IPE_SUCCESS){
- dbglog("DEBUG: imageProcessorStartPage failed result = %d\n", result);
- }
-
current_page_number++;
if (current_page_number == 1) {
@@ -745,12 +738,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cup
color_raster = rgbRaster;
black_raster = kRaster;
- result = imageProcessorProcessLine(imageProcessor, m_pPrinterBuffer, cups_header.cupsBytesPerLine);
- if (result != IPE_SUCCESS){
- dbglog("DEBUG: imageProcessorProcessLine failed result = %d\n", result);
- }
-
-
if ((y == 0) && !is_ljmono) {
//For ljmono, make sure that first line is not a blankRaster line.Otherwise printer
//may not skip blank lines before actual data
@@ -780,12 +767,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cup
}
} // for() loop end
- result = imageProcessorEndPage(imageProcessor);
- if (result != IPE_SUCCESS){
- dbglog("DEBUG: imageProcessorEndPage failed result = %d\n", result);
- }
-
-
m_Job.NewPage();
if (err != NO_ERROR) {
break;
@@ -799,8 +780,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cup
kRaster = NULL;
rgbRaster = NULL;
}
-
- imageProcessorDestroy(imageProcessor);
unlink(hpPreProcessedRasterFile);
return ret_status;

View File

@@ -0,0 +1,10 @@
--- prnt/hpcups/genJPEGStrips.cpp.orig 2017-12-19 19:39:29 UTC
+++ prnt/hpcups/genJPEGStrips.cpp
@@ -28,7 +28,6 @@ extern "C"
#include <setjmp.h>
-#include <malloc.h>
#include <memory.h>

View File

@@ -0,0 +1,11 @@
--- prnt/hpps/hppsfilter.c.orig 2019-11-04 10:12:15 UTC
+++ prnt/hpps/hppsfilter.c
@@ -104,7 +104,7 @@ static void open_tempbookletfile(char *mode)
if(ptempbooklet_file == NULL)
{
fprintf(stderr, "ERROR: Unable to open temp file %s\n", temp_filename);
- return 1;
+ return;
}
chmod(temp_filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);

View File

@@ -0,0 +1,86 @@
Use a dynamically allocated port instead of binding port 5353. The bind(2)
call fails when Avahi has already claimed port 5353. On top of that, HPLIP
only performs one-shot queries and those shouldn't be using port 5353 according
to RFC 6762.
Don't disable loop-back. It's harmless.
Use default TTL of 1. RFC 6762 requires 255 for responses, not for queries.
There's no need to join the multicast group for one-shot queries. Responses
are sent to the unicast address.
--- protocol/discovery/mdns.c.orig 2020-07-01 14:48:56 UTC
+++ protocol/discovery/mdns.c
@@ -24,7 +24,11 @@
Author: Sanjay Kumar
\*****************************************************************************/
-//#include <stdio.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/select.h>
#include <string.h>
#include <syslog.h>
#include <sys/socket.h>
@@ -70,57 +74,13 @@ static int mdns_convert_name_to_dns(const char *name,
static int mdns_open_socket(int *psocket)
{
int stat = MDNS_STATUS_ERROR;
- int udp_socket = -1, yes = 1;
- char loop = 0, ttl = 255;
- struct sockaddr_in recv_addr , addr;
- struct ip_mreq mreq;
+ int udp_socket;
DBG("mdns_open_socket entry.\n");
if ((udp_socket = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
{
BUG("unable to create udp socket: %m\n");
- goto bugout;
- }
-
- /* Get rid of "address already in use" error message. */
- if (setsockopt(udp_socket, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) == -1)
- {
- BUG("unable to setsockopt: %m\n");
- goto bugout;
- }
-
- /* Bind the socket to port and IP equal to INADDR_ANY. */
- bzero(&recv_addr, sizeof(recv_addr));
- recv_addr.sin_family = AF_INET;
- recv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
- recv_addr.sin_port = htons(5353);
- if (bind(udp_socket, (struct sockaddr *) &recv_addr, sizeof(recv_addr)) == -1)
- {
- BUG("unable to bind udp socket: %m\n");
- goto bugout;
- }
-
- /* Set multicast loopback off. */
- if (setsockopt(udp_socket, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)) == -1)
- {
- BUG("unable to setsockopt: %m\n");
- goto bugout;
- }
-
- /* Set ttl to 255. Required by mdns. */
- if (setsockopt(udp_socket, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl))== -1)
- {
- BUG("unable to setsockopt: %m\n");
- goto bugout;
- }
-
- /* Join the .local multicast group */
- mreq.imr_multiaddr.s_addr = inet_addr("224.0.0.251");
- mreq.imr_interface.s_addr = htonl(INADDR_ANY);
- if (setsockopt(udp_socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(struct ip_mreq)) == -1) {
- BUG("unable to add to multicast group: %m\n");
- close(udp_socket);
goto bugout;
}

View File

@@ -0,0 +1,63 @@
--- scan/sane/OrbliteScan/BSDCommon.h.orig 2019-11-03 16:02:42 UTC
+++ scan/sane/OrbliteScan/BSDCommon.h
@@ -0,0 +1,60 @@
+#ifndef H_BSDCommon
+#define H_BSDCommon
+
+#include <sys/types.h>
+
+/* Common typedefs for BSD */
+
+typedef unsigned char * StringPtr;
+typedef unsigned char Boolean;
+typedef char * Ptr;
+
+typedef unsigned char UInt8;
+typedef UInt8* PUInt8;
+typedef signed char SInt8;
+typedef unsigned short UInt16;
+typedef signed short SInt16;
+typedef u_int32_t UInt32;
+typedef int32_t SInt32;
+//typedef unsigned long UInt32;
+//typedef signed long SInt32;
+typedef int64_t SInt64;
+typedef uint64_t UInt64;
+//typedef __S64_TYPE int64_t;
+//typedef __U64_TYPE uint64_t;
+
+//typedef unsigned long ULONG;
+//typedef void* LPVOID;
+//typedef long HRESULT;
+//typedef int32_t HRESULT;
+
+typedef SInt16 OSErr;
+
+typedef unsigned long FourCharCode;
+typedef FourCharCode OSType;
+
+typedef void IUnknown;
+
+#define FAILED(Status) ((HRESULT)(Status) < 0)
+
+/* dummy definitions - TODO: define these ... or not? */
+
+typedef int FSSpec;
+typedef int CFURLRef;
+typedef int CFBundleRef;
+typedef void* Handle; // needed by Python driver
+
+/* re-define MAC-only memory API to POSIX-compliant */
+#define NewPtr malloc /* MAC */
+#define DisposePtr free /* MAC */
+
+/* re-define WinDoze-only memory API to POSIX-compliant */
+/* currently not used because we are using #ifdef __MAC__ */
+
+// #define CoTaskMemAlloc malloc
+// #define CoTaskMemFree free
+// #define CoTaskMemRealloc realloc
+
+
+#endif /* H_BSDCommon */
+

View File

@@ -0,0 +1,31 @@
--- scan/sane/OrbliteScan/MacCommon.h.orig 2019-10-22 06:21:36 UTC
+++ scan/sane/OrbliteScan/MacCommon.h
@@ -1,7 +1,7 @@
#ifndef H_MacCommon
#define H_MacCommon
-#ifndef __linux__
+#if !defined(__linux__) && !defined(__FreeBSD__)
#include <CoreFoundation/CFPlugInCOM.h>
#define __CFPlugInCOM_Included__
#endif
@@ -10,6 +10,10 @@
# include "LinuxCommon.h"
#endif
+#if defined(__FreeBSD__)
+# include "BSDCommon.h"
+#endif
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -257,7 +261,7 @@ typedef struct _GUID {
typedef GUID CLSID;
-#ifndef __linux__
+#if !defined(__linux__) && !defined(__FreeBSD__)
const extern CLSID CLSID_NULL;
const extern GUID GUID_NULL;
#else

View File

@@ -0,0 +1,20 @@
--- scan/sane/hpaio.c.orig 2019-10-22 06:25:58 UTC
+++ scan/sane/hpaio.c
@@ -419,7 +419,7 @@ extern void sane_hpaio_close(SANE_Handle handle)
if (strcmp(*((char **)handle), "ESCL") == 0)
return escl_close(handle);
if (strcmp(*((char **)handle), "ORBLITE") == 0)
- return orblite_close(handle);
+ orblite_close(handle);
} /* sane_hpaio_close() */
extern const SANE_Option_Descriptor * sane_hpaio_get_option_descriptor(SANE_Handle handle, SANE_Int option)
@@ -552,7 +552,7 @@ extern void sane_hpaio_cancel( SANE_Handle handle )
if (strcmp(*((char **)handle), "ESCL") == 0)
return escl_cancel(handle);
if (strcmp(*((char **)handle), "ORBLITE") == 0)
- return orblite_cancel(handle);
+ orblite_cancel(handle);
} /* sane_hpaio_cancel() */
extern SANE_Status sane_hpaio_set_io_mode(SANE_Handle handle, SANE_Bool nonBlocking)

View File

@@ -0,0 +1,13 @@
=====================================================================
HPLIP expects printers to be attached as a ugen(4) devices. This
means that you must NOT have "device ulpt" in your kernel and ulpt
must NOT be loaded as a kernel module (you may also want to compile
print/cups-base with LIBUSB support). Please, follow the instructions
from print/cups-base pkg-message to setup correct permission for
usb devices.
In order to enable full functionality of hp tools, users must be
added to group `cups'.
=====================================================================

View File

@@ -0,0 +1,8 @@
HPLIP is an HP developed solution for printing, scanning,
and faxing with HP inkjet and laser based printers in Linux.
The HP driver project provides printing support for nearly
1000 printer models, including Deskjet, Officejet, Photosmart,
PSC (Print Scan Copy), Business Inkjet, LaserJet, and LaserJet MFP.
WWW: http://hplipopensource.com/hplip-web/index.html

1222
print/cups-hplip20/pkg-plist Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -3,8 +3,8 @@
PORTNAME= ghostscript
PORTVERSION= 9.06
CATEGORIES= print
MASTER_SITES+= http://downloads.ghostscript.com/public/:gs_srcs
MASTER_SITES+= SF/ghostscript/GPL%20Ghostscript/${PORTVERSION}:gs_srcs
#MASTER_SITES+= http://downloads.ghostscript.com/public/:gs_srcs
#MASTER_SITES+= SF/ghostscript/GPL%20Ghostscript/${PORTVERSION}:gs_srcs
MASTER_SITES+= http://www.humblesoft.com/pub/:epag
#PKGNAMESUFFIX= 9-base
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:gs_srcs ${EPAG_SRCS}:epag