That’s not really surprising … there’s a great deal more wrong than just that missing include.
I have managed to get it to build, and even to print a test page … in greyscale, when I expected colour
PKGBUILD.patch
diff --git a/PKGBUILD b/PKGBUILD
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -27,25 +27,28 @@ install=cnijfilter-mp640.install
# File size: 6552576 bytes
source=("http://gdlp01.c-wss.com/gds/7/0100002367/01/cnijfilter-source-3.20-1.tar.gz"
"id.patch"
"cups.patch"
"libpng15.patch"
- "mychanges.patch")
+ "mychanges.patch"
+ "myextra.patch")
sha512sums=('3e6e5f3ed43e4054938387298a6d116828a0928568b3a165622c5a61abe9e39a30bc6d99a336317be228a794f0a2645b8f5453939695879f209b1a061b7d9164'
'b75cdbdadac5fb396458dc9f14529c5e39a4fa47f97cd6a21a69b0dbac73f1b8dd90780068f6a348fcfb15939d0866dde1a1cf1ff7faaf0c443d2205a242ccd5'
- '747b17205a95197e8235959c691ee26b0c375ec8dae516416d16a9805c5b354c7019319d8be10c0c0230cfd8301ec5ddcd292bad245216d0a860cc2e6583c1fa'
+ 'fd56d4e86de5a7d01dfe863cceb4bc9329ae45a372312348cdb51a01d839d8545964b675270cad72014c7aa895ca50439e22406c270d62f90114b57b8055a478'
'0d8310867f45721150a870170172d3a0688bfba0267f627a630c105ff965d31f25dbcc31d3795874325bcb8eaeee395bf32b0648a743ff663dea6f977ab9070e'
- 'd4f98b8bb2413ebf07a325b48318a60be4e01794dbebf29788eabc6c68e98086826d3bc4651bba334cfd5af04966d01985801f7beed35ac65893d52eb8a7b246')
+ 'd4f98b8bb2413ebf07a325b48318a60be4e01794dbebf29788eabc6c68e98086826d3bc4651bba334cfd5af04966d01985801f7beed35ac65893d52eb8a7b246'
+ 'eda2068abdede5b698d4d7733d0b32324e7cad898777cb2dc0c8847e9c3e6d045e8cad0c5878bcb1185d15b97c17472010ca7de9e5264de46e84d0cbc9845825')
prepare() {
cd ${srcdir}/${_pkgname}-source-${pkgver}-${_pkgreview}
patch -p1 -i ${srcdir}/id.patch
patch -p1 -i ${srcdir}/cups.patch
patch -p1 -i ${srcdir}/libpng15.patch
patch -p1 -i ${srcdir}/mychanges.patch
+ patch -p1 -i ${srcdir}/myextra.patch
}
build() {
cd ${srcdir}/${_pkgname}-source-${pkgver}-${_pkgreview}
myextra.patch
diff --git a/cngpijmon/src/bjcupsmon_ui.c b/cngpijmon/src/bjcupsmon_ui.c
--- a/cngpijmon/src/bjcupsmon_ui.c
+++ b/cngpijmon/src/bjcupsmon_ui.c
@@ -828,11 +828,11 @@ PUBLIC void updateUISettings(ST_PrinterS
if (pPrinterStatus != NULL) {
memset(tempBuf, 0, sizeof(tempBuf));
if( pPrinterStatus->leverPosition != ID_LEVER_POSITION_INVALID
&& pPrinterStatus->leverPosition != ID_LEVER_POSITION_NONE )
- strncpy(tempBuf, dgettext(PACKAGE, ID_STS_MESSAGE_PAPERTHICKNESS_LEVERPOSITION), MAX_BUF_SIZE-1);
+ strncpy(tempBuf, dgettext(PACKAGE, gSTSMessageTable[ID_STS_MESSAGE_PAPERTHICKNESS_LEVERPOSITION]), MAX_BUF_SIZE-1);
//strncpy(tempBuf, dgettext(PACKAGE, N_("Paper Thickness Lever Position: ")), MAX_BUF_SIZE-1);
else
strncpy(tempBuf, " ", MAX_BUF_SIZE-1);
//strncpy(tempBuf, dgettext(PACKAGE, " "), MAX_BUF_SIZE-1);
switch (pPrinterStatus->leverPosition) {
@@ -845,16 +845,16 @@ PUBLIC void updateUISettings(ST_PrinterS
strcat(tempBuf, "Down");
//strcat(tempBuf, dgettext(PACKAGE, N_("Down")));
break;
case ID_LEVER_POSITION_LEFT: // Left.
- strcat(tempBuf, dgettext(PACKAGE,ID_STS_MESSAGE_LEFT));
+ strcat(tempBuf, dgettext(PACKAGE, gSTSMessageTable[ID_STS_MESSAGE_LEFT]));
//strcat(tempBuf, dgettext(PACKAGE, N_("Left")));
break;
case ID_LEVER_POSITION_RIGHT: // Right.
- strcat(tempBuf, dgettext(PACKAGE, ID_STS_MESSAGE_RIGHT));
+ strcat(tempBuf, dgettext(PACKAGE, gSTSMessageTable[ID_STS_MESSAGE_RIGHT]));
//strcat(tempBuf, dgettext(PACKAGE, N_("Right")));
break;
default:
break;
diff --git a/cnijfilter/src/bjfilter.c b/cnijfilter/src/bjfilter.c
--- a/cnijfilter/src/bjfilter.c
+++ b/cnijfilter/src/bjfilter.c
@@ -21,10 +21,11 @@
* libraries released as the binary modules.
* - If you write modifications of your own for these programs, it is your
* choice whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception.
*/
+#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <popt.h>
#include <time.h>
@@ -55,10 +56,13 @@
/* function prototypes */
extern short GetIPCData(LPIPCU pipc, char *sname);
extern short PsudoGetIPCData(LPIPCU pipc);
+extern void bjf_margin_init(LPBJF_MARGIN_INFO);
+extern short SetExtLevel(LPBJF_MARGIN_INFO, short);
+
extern int ppm_write_tmpfile( LPBJF_IMAGEINFO lpbjfimage, char *filename , char *outfile);
/* local function prototypes */
static short h_extend( CPKByte CPKPTR, CPKByte CPKPTR, int, int, int );
static void outCmd(CPKByte CPKPTR, CPKUInt32, int);
diff --git a/cnijfilter/src/bjfimage.c b/cnijfilter/src/bjfimage.c
--- a/cnijfilter/src/bjfimage.c
+++ b/cnijfilter/src/bjfimage.c
@@ -37,12 +37,13 @@
** Copyright (c) 1998-2001 Glenn Randers-Pehrson
*/
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <png.h>
-#include <string.h>
#include "cpktypes.h"
#include "cncl.h"
#include "cncldef.h"
#include "bjfimage.h"
@@ -416,21 +417,21 @@ onErr:
}
static short tiff_image_init( LPBJF_IMAGEINFO lpbjfimage )
{
TIFF *tif = NULL;
- uint32 width = 0;
- uint32 length = 0;
- unsigned short bpp = 1;
- unsigned short photometric = PHOTOMETRIC_RGB;
+ uint32_t width = 0;
+ uint32_t length = 0;
+ unsigned short bpp = 1;
+ unsigned short photometric = PHOTOMETRIC_RGB;
float x_resolution = 0;
float y_resolution = 0;
short outputtype;
- uint16 config;
- uint16 compress;
+ uint16_t config;
+ uint16_t compress;
short result = -1;
- static short flg = 0;
+ static short flg = 0;
short resolution_unit = RESUNIT_INCH;
/*---
Tiff format do not support plural document.
At first this api call, return 1, after second call return 0.
diff --git a/cnijfilter/src/bjfoption.c b/cnijfilter/src/bjfoption.c
--- a/cnijfilter/src/bjfoption.c
+++ b/cnijfilter/src/bjfoption.c
@@ -24,12 +24,13 @@
* If you do not wish that, delete this exception.
*/
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
#include <popt.h>
-#include <string.h>
#include "cncl.h"
#include "cncldef.h"
#include "cncl2def.h"
#include "cnclucom.h"
@@ -537,11 +538,11 @@ short SetCmdOption(
/*--- Analyze command line ---*/
init_optioninfo( lpbjfoption );
- optcon = poptGetContext( NULL, cargc, cargv, optionsTable, 0 );
+ optcon = poptGetContext( NULL, cargc, (const char **)(cargv), optionsTable, 0 );
memset(confname , 0x00 , sizeof(confname));
MakeModelnameConfname( cargv[0], modelname, confname, BJFILTERXXXXRCPATH, BJFILTERDOTCONF );
first_modelstrnum = strlen(modelname);
diff --git a/printui/src/colordlg2.c b/printui/src/colordlg2.c
--- a/printui/src/colordlg2.c
+++ b/printui/src/colordlg2.c
@@ -148,11 +148,11 @@ static short SetGammaCombo(UIColorDialog
return gamma;
}
/* Ver.2.90 */
-static short CofirmSpinValue( spinbutton )
+static short CofirmSpinValue( GtkSpinButton *spinbutton )
{
short result = 0;
if( !strncmp( gtk_entry_get_text( GTK_ENTRY( spinbutton ) ), "-0" , 2 ) )
{
diff --git a/printui/src/uimain.c b/printui/src/uimain.c
--- a/printui/src/uimain.c
+++ b/printui/src/uimain.c
@@ -228,11 +228,11 @@ void ShowUtilButtons(UIMainDialog* main_
ShowUtilButton(main_window, "util_paper_source_setting_button");
}
}
static
-void ShowPaperGapCombo(main_window)
+void ShowPaperGapCombo(UIMainDialog* main_window)
{
int show_lever_box = FALSE;
/* Ver.2.80: Set "lever_label" string according to model_name. */
GtkWidget* label = LookupWidget( UI_DIALOG(main_window)->window, "lever_label");
In addition to the new patches, which I’ve added in “myextra.patch”, I also corrected an error which appeared to have been introduced by the existing “cups.patch”:
cups.patch.correction
diff --git a/cups.patch b/cups.patch
--- a/cups.patch
+++ b/cups.patch
@@ -208,11 +208,11 @@ diff -aur cnijfilter-source-3.20-1/cngpi
+ pAttribute = ippFirstAttribute(pResponse);
while (pAttribute != NULL) {
- while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_PRINTER) {
- pAttribute = pAttribute->next;
-+ while (pAttribute != NULL && ippGetGroupTag(pAttribute != IPP_TAG_PRINTER)) {
++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_PRINTER) {
+ pAttribute = ippNextAttribute(pResponse);
}
if (pAttribute == NULL) {
break;
}
I will be doing so. As noted above, I’m not convinced that I’ve identified a final solution, because before my installation failed, the printer was working in colour, (including the printing of the test page), whereas the test page now prints only in greyscale. I did have a similar issue previously, following a pamac update in which a printer option had been changed from colour to greyscale; I was able to change that through the old XFCE printer management applet, but the clean reinstallation now directs printer management to the CUPS interface, and I can’t see a similar option setting there.