hplip = https://sourceforge.net/projects/hplip/files/hplip/3.26.4/hplip-3.26.4.tar.gz ``` sh *** patch *** sed -i '/#include "utils.h"/a\ \ /* Missing prototypes for internal HPLIP functions */\ extern void _releaseCupsInstance(void);\ extern int addCupsPrinter(const char *name, const char *device_uri,\ const char *location, const char *ppd_file,\ const char *model, const char *info);\ extern int delCupsPrinter(const char *name);\ extern int setDefaultCupsPrinter(const char *name);\ extern int controlCupsPrinter(const char *name, int op);' prnt/cupsext/cupsext.c sed -i '/#include "orblitei.h"/a\ \ /* Forward declarations for orblite backend to fix implicit-function-declaration errors */\ extern SANE_Status orblite_init(SANE_Int *version_code, SANE_Auth_Callback authorize);\ extern void orblite_get_devices(SANE_Device ***device_list, SANE_Bool local_only);\ extern SANE_Status orblite_open(SANE_String_Const devicename, SANE_Handle *handle);\ extern void orblite_close(SANE_Handle handle);\ extern SANE_Status orblite_control_option(SANE_Handle handle, SANE_Int option, SANE_Action action, void *value, SANE_Int *info);\ extern SANE_Status orblite_get_parameters(SANE_Handle handle, SANE_Parameters *params);\ extern SANE_Status orblite_start(SANE_Handle handle);\ extern SANE_Status orblite_read(SANE_Handle handle, SANE_Byte *data, SANE_Int max_length, SANE_Int *length);\ extern void orblite_cancel(SANE_Handle handle);' scan/sane/hpaio.c sed -i 's/int bb_is_paper_in_adf();/int bb_is_paper_in_adf(struct ledm_session *ps);/' scan/sane/ledmi.h sed -i '/# include /a\ # include ' scan/sane/bb_ledm.c sed -i '/#include /a\ #include ' scan/sane/http.c sed -i '/#include /a\ #include ' scan/sane/sclpml.c sed -i \ -e '/#include "io.h"/a\ #include ' \ -e 's/(SANE_Char\*\*)&SANE_rangeLeft/(const SANE_Char * const*)\&SANE_rangeLeft/g' \ -e 's/(SANE_Char\*\*)&SANE_rangeTop/(const SANE_Char * const*)\&SANE_rangeTop/g' \ -e 's/(SANE_Char\*\*)&SANE_rangeRight/(const SANE_Char * const*)\&SANE_rangeRight/g' \ -e 's/(SANE_Char\*\*)&SANE_rangeBottom/(const SANE_Char * const*)\&SANE_rangeBottom/g' \ -e 's/(SANE_Char\*\*)SANE_resolutions/(const SANE_Char * const*)SANE_resolutions/g' \ -e 's/(SANE_Char\*\*)SANE_modes/(const SANE_Char * const*)SANE_modes/g' \ -e 's/(SANE_Char\*\*)SANE_sources/(const SANE_Char * const*)SANE_sources/g' \ -e 's/(SANE_Char\*\*)SANE_paper_sizes/(const SANE_Char * const*)SANE_paper_sizes/g' \ -e 's/_DBG("Calling orblite bb_unload/DBG("Calling orblite bb_unload/' \ -e 's/bb_orblite_open(devicename, &g_handle)/bb_orblite_open(devicename, (void **)\&g_handle)/' \ scan/sane/orblite.c sed -i '/^#include /a\ \ /* Python 2\/3 compatibility */\ #if PY_MAJOR_VERSION >= 3\ #define PyString_AsStringAndSize(obj, buf, len) PyBytes_AsStringAndSize((obj), (buf), (len))\ #define PyString_FromStringAndSize(str, len) PyBytes_FromStringAndSize((str), (len))\ #define PyInt_AS_LONG(obj) PyLong_AsLong(obj)\ #endif' pcard/pcardext/pcardext.c sed -i '/^void initpcardext/,/^}$/c\ PyMODINIT_FUNC PyInit_pcardext(void)\ {\ static struct PyModuleDef moduledef = {\ PyModuleDef_HEAD_INIT, "pcardext", pcardext_documentation, -1, pcardext_methods,\ };\ PyObject *mod = PyModule_Create(\&moduledef);\ if (mod == NULL)\ return NULL;\ return mod;\ }' pcard/pcardext/pcardext.c sed -i 's/static column = 0 ;/static int column = 0 ;/' prnt/hpps/pserror.c ``` ``` sh *** build *** ./configure --prefix=$pkgpath --disable-network-build --disable-pcard-build make -j$(nproc) make install ``` ``` cfg *** build deps *** libusb sane-backends cups ``` sane-backends - scan