Skip to content

Commit

Permalink
print/hplip: Fix build with llvm16
Browse files Browse the repository at this point in the history
PR:		272171
  • Loading branch information
TijlCoosemans committed Jun 25, 2023
1 parent dff3133 commit 1237fea
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 12 deletions.
34 changes: 25 additions & 9 deletions print/hplip/files/patch-Makefile.in
@@ -1,6 +1,6 @@
--- Makefile.in.orig 2022-02-23 07:42:31 UTC
--- Makefile.in.orig 2023-06-02 08:11:21 UTC
+++ Makefile.in
@@ -96,8 +96,7 @@ DIST_COMMON = $(am__configure_deps) \
@@ -113,8 +113,7 @@ DIST_COMMON = $(am__configure_deps) \
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@LIBUSB01_BUILD_TRUE@am__append_5 = io/hpmud/musb_libusb01.c
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@LIBUSB01_BUILD_TRUE@am__append_6 = -lusb
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@LIBUSB01_BUILD_FALSE@am__append_7 = io/hpmud/musb.c
Expand All @@ -10,15 +10,23 @@
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@NETWORK_BUILD_TRUE@am__append_10 = -Iprotocol/discovery
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@NETWORK_BUILD_TRUE@am__append_11 = -l$(SNMPLIB) -lcrypto

@@ -125,7 +124,6 @@ DIST_COMMON = $(am__configure_deps) \
@@ -142,7 +141,6 @@ DIST_COMMON = $(am__configure_deps) \
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@am__append_17 = libhpipp.la
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@NETWORK_BUILD_TRUE@am__append_18 = libhpdiscovery.la
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@NETWORK_BUILD_TRUE@am__append_19 = -Iprotocol/discovery
-@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@LIBUSB01_BUILD_FALSE@am__append_20 = -I/usr/include/libusb-1.0
@FULL_BUILD_TRUE@@GUI_BUILD_TRUE@@HPLIP_BUILD_TRUE@@QT3_INSTALL_TRUE@am__append_21 = ui/colorcalform2_base.ui ui/settingsdialog_base.ui ui/aligntype6form1_base.ui \
@FULL_BUILD_TRUE@@GUI_BUILD_TRUE@@HPLIP_BUILD_TRUE@@QT3_INSTALL_TRUE@ ui/aboutdlg_base.ui ui/imagepropertiesdlg_base.ui ui/paperedgealignform_base.ui ui/aligntype6form2_base.ui \
@FULL_BUILD_TRUE@@GUI_BUILD_TRUE@@HPLIP_BUILD_TRUE@@QT3_INSTALL_TRUE@ ui/nodevicesform_base.ui ui/cleaningform_base.ui ui/colorcalform_base.ui ui/devmgr4_base.ui ui/loadpaperform_base.ui \
@@ -4645,7 +4643,7 @@ dist_unrel_DATA =
@@ -453,7 +451,6 @@ scanext_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAG
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@SCAN_BUILD_TRUE@am_scanext_la_rpath = -rpath \
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@SCAN_BUILD_TRUE@ $(scanextdir)
@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@am__EXEEXT_1 = ptest$(EXEEXT)
-@FULL_BUILD_TRUE@@HPLIP_BUILD_TRUE@am__EXEEXT_2 = hppgsz$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(dat2drv_PROGRAMS) $(hp_PROGRAMS) \
$(hpcdmfax_PROGRAMS) $(hpcups_PROGRAMS) $(hpcupsfax_PROGRAMS) \
$(hpps_PROGRAMS) $(locatedriver_PROGRAMS) $(noinst_PROGRAMS)
@@ -4837,7 +4834,7 @@ dist_unrel_DATA =
@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@@SCAN_BUILD_TRUE@ $(am__append_2)
#libhpdiscovery_la_SOURCES = protocol/discovery/mdns.c protocol/discovery/mdns.h
@HPLIP_BUILD_TRUE@@NETWORK_BUILD_TRUE@libhpdiscovery_la_SOURCES = protocol/discovery/avahiDiscovery.c protocol/discovery/avahiDiscovery.h
Expand All @@ -27,7 +35,7 @@
@HPLIP_BUILD_TRUE@@NETWORK_BUILD_TRUE@libhpdiscovery_la_LDFLAGS = -version-info 0:1:0 -L$(libdir)
@HPLIP_BUILD_TRUE@@NETWORK_BUILD_TRUE@libhpdiscovery_la_LIBADD = -l$(SNMPLIB) -lcrypto -lavahi-client -lavahi-core -lavahi-common $(DBUS_LIBS)

@@ -4705,7 +4703,7 @@ dist_unrel_DATA =
@@ -4897,7 +4894,7 @@ dist_unrel_DATA =
@HPLIP_BUILD_TRUE@dist_halpre_DATA = data/rules/20-hplip-devices.fdi

# hplip.conf
Expand All @@ -36,7 +44,15 @@
@HPLIP_BUILD_TRUE@hplip_conf_DATA = hplip.conf

#pstotiff filter
@@ -5027,7 +5025,7 @@ libapdk_la_CFLAGS = $(libapdk_la_CXXFLAGS) -Iprnt/hpij
@@ -5128,7 +5125,6 @@ dist_unrel_DATA =
@RIP_INSTALL_TRUE@dist_rip_SCRIPTS = prnt/hpijs/foomatic-rip-hplip

# apdk
-noinst_LTLIBRARIES = libapdk.la
libapdk_la_SOURCES = prnt/hpijs/models.cpp prnt/hpijs/breaks_open.cpp \
prnt/hpijs/dj9xxvip.cpp prnt/hpijs/dj9xx.cpp prnt/hpijs/capture.cpp prnt/hpijs/colormatch.cpp prnt/hpijs/colormatcher_open.cpp \
prnt/hpijs/compression.cpp prnt/hpijs/context2.cpp prnt/hpijs/create_so.cpp prnt/hpijs/creator.cpp \
@@ -5219,7 +5215,7 @@ libapdk_la_CFLAGS = $(libapdk_la_CXXFLAGS) -Iprnt/hpij
@HPCUPS_INSTALL_TRUE@ prnt/hpcups/ImageProcessor.h

@HPCUPS_INSTALL_TRUE@hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS)
Expand All @@ -45,7 +61,7 @@
#else
#hpcupsdir = $(cupsfilterdir)
#hpcups_PROGRAMS = hpcups
@@ -9562,7 +9560,7 @@ install-data-am: install-apparmor_abstractionDATA \
@@ -9951,7 +9947,7 @@ install-data-am: install-apparmor_abstractionDATA \
install-dist_basepexpectDATA install-dist_cmdSCRIPTS \
install-dist_copierDATA install-dist_faxDATA \
install-dist_fax_filtersDATA install-dist_filterDATA \
Expand All @@ -54,15 +70,15 @@
install-dist_homeDATA install-dist_hpcupsfaxppdDATA \
install-dist_hpfaxSCRIPTS install-dist_hpijsfaxppdDATA \
install-dist_hplipSCRIPTS install-dist_hplip_stateDATA \
@@ -9580,7 +9578,6 @@ install-data-am: install-apparmor_abstractionDATA \
@@ -9969,7 +9965,6 @@ install-data-am: install-apparmor_abstractionDATA \
install-dist_policykit_policyDATA install-dist_postscriptDATA \
install-dist_ppdDATA install-dist_printpluginsDATA \
install-dist_prntDATA install-dist_ripSCRIPTS \
- install-dist_rulesDATA install-dist_rulessystemDATA \
install-dist_scanDATA install-dist_selinuxDATA \
install-dist_ui4DATA install-dist_ui5DATA install-dist_uiDATA \
install-dist_unrelDATA install-dist_www0DATA \
@@ -9814,14 +9811,8 @@ install-data-hook:
@@ -10207,14 +10202,8 @@ install-data-hook:
@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 \
Expand Down
16 changes: 16 additions & 0 deletions print/hplip/files/patch-prnt_cupsext_cupsext.c
@@ -0,0 +1,16 @@
--- prnt/cupsext/cupsext.c.orig 2023-06-02 08:02:35 UTC
+++ prnt/cupsext/cupsext.c
@@ -89,6 +89,13 @@ Sanjay Kumar
#include "hp_ipp.h"
#include "utils.h"

+void _releaseCupsInstance(void);
+int addCupsPrinter(char *name, char *device_uri, char *location,
+ char *ppd_file, char *model, char *info);
+int delCupsPrinter(char *pr_name);
+int setDefaultCupsPrinter(char *pr_name);
+int controlCupsPrinter(char *pr_name, int op);
+
/* Ref: PEP 353 (Python 2.5) */
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
11 changes: 11 additions & 0 deletions print/hplip/files/patch-prnt_hpcups_Mode9.cpp
@@ -0,0 +1,11 @@
--- prnt/hpcups/Mode9.cpp.orig 2023-06-02 08:02:35 UTC
+++ prnt/hpcups/Mode9.cpp
@@ -203,7 +203,7 @@ bool Mode9::Process(RASTERDATA* input)
unsigned int offset,byte_count,rem_count;
Mode9_comtype command;
char* dest= (char*) compressBuf;
- register char *dptr=dest;
+ char *dptr=dest;

while ( size > 0 )
{
13 changes: 13 additions & 0 deletions print/hplip/files/patch-prnt_hpcups_ModeDeltaPlus.cpp
@@ -0,0 +1,13 @@
--- prnt/hpcups/ModeDeltaPlus.cpp.orig 2023-06-02 08:02:35 UTC
+++ prnt/hpcups/ModeDeltaPlus.cpp
@@ -241,8 +241,8 @@ bool ModeDeltaPlus::compress (BYTE *outmem,
const uint32_t inheight,
uint32_t horz_ht_dist)
{
- register BYTE *outptr = outmem;
- register uint32_t col;
+ BYTE *outptr = outmem;
+ uint32_t col;
const BYTE *seedrow;
uint32_t seedrow_count = 0;
uint32_t location = 0;
11 changes: 11 additions & 0 deletions print/hplip/files/patch-prnt_hpps_pserror.c
@@ -0,0 +1,11 @@
--- prnt/hpps/pserror.c.orig 2023-06-02 08:02:35 UTC
+++ prnt/hpps/pserror.c
@@ -24,7 +24,7 @@ void message(int flags, char *format, ...)
void message(int flags, char *format, ...)
{
va_list args ;
- static column = 0 ; /* current screen column for message wrap */
+ static int column = 0 ; /* current screen column for message wrap */
char msgbuf[MAX_MESSAGE] ; /* buffer in which to put the message */
char *bufptr = msgbuf ; /* message buffer pointer */

10 changes: 10 additions & 0 deletions print/hplip/files/patch-scan_sane_bb__ledm.c
@@ -0,0 +1,10 @@
--- scan/sane/bb_ledm.c.orig 2023-06-02 08:02:36 UTC
+++ scan/sane/bb_ledm.c
@@ -16,6 +16,7 @@
# include <string.h>
# include <fcntl.h>
# include <math.h>
+# include <unistd.h>
# include "sane.h"
# include "saneopts.h"
# include "hpmud.h"
10 changes: 10 additions & 0 deletions print/hplip/files/patch-scan_sane_http.c
@@ -0,0 +1,10 @@
--- scan/sane/http.c.orig 2023-06-02 08:02:36 UTC
+++ scan/sane/http.c
@@ -36,6 +36,7 @@
#include <string.h>
#include <syslog.h>
#include <ctype.h>
+#include <unistd.h>
#include "hpmud.h"
#include "http.h"

22 changes: 19 additions & 3 deletions print/hplip/files/patch-scan_sane_orblite.c
@@ -1,6 +1,22 @@
--- scan/sane/orblite.c.orig 2022-03-07 20:11:09 UTC
--- scan/sane/orblite.c.orig 2023-06-25 13:07:58 UTC
+++ scan/sane/orblite.c
@@ -315,7 +315,7 @@ orblite_open (SANE_String_Const devicename, SANE_Handl
@@ -19,6 +19,7 @@
#undef NDEBUG
#include "orblitei.h"
#include "orblite.h"//Added New
+#include <dlfcn.h>
#include <math.h>
#include "utils.h"
#include "io.h"
@@ -195,7 +196,6 @@ static int bb_unload(SANE_THandle ps)

static int bb_unload(SANE_THandle ps)
{
- _DBG("Calling orblite bb_unload: \n");
if (ps->bb_handle)
{
dlclose(ps->bb_handle);
@@ -315,7 +315,7 @@ orblite_close (SANE_Handle handle)
void
orblite_close (SANE_Handle handle)
{
Expand All @@ -17,7 +33,7 @@
}


@@ -372,7 +373,7 @@ orblite_read (SANE_Handle handle, SANE_Byte * data, SA
@@ -372,7 +373,7 @@ orblite_cancel (SANE_Handle handle)
void
orblite_cancel (SANE_Handle handle)
{
Expand Down

0 comments on commit 1237fea

Please sign in to comment.