Skip to content

Commit

Permalink
epson-escpr: 1.7.20 -> 1.8.6
Browse files Browse the repository at this point in the history
Also fixed gcc14 build issues
Got patches from Gentoo repo
  • Loading branch information
Arjun31415 committed Dec 30, 2024
1 parent 070ae1c commit 013b629
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 7 deletions.
129 changes: 129 additions & 0 deletions pkgs/by-name/ep/epson-escpr/1.8-missing-include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
--- /dev/null 2024-02-07 07:14:59.428332875 -0500
+++ b/lib/epson-escpage.h 2024-02-07 12:39:28.463235607 -0500
@@ -0,0 +1,126 @@
+/*__________________________________ epson-escpage.h ________________________________*/
+
+/* 1 2 3 4 5 6 7 8 */
+/*34567890123456789012345678901234567890123456789012345678901234567890123456789012345678*/
+/*******************************************|********************************************/
+/*
+ * Copyright (c) 2010 Seiko Epson Corporation All rights reserved.
+ *
+ * Copyright protection claimed includes all forms and matters of
+ * copyrightable material and information now allowed by statutory or judicial
+ * law or hereinafter granted, including without limitation, material generated
+ * from the software programs which are displayed on the screen such as icons,
+ * screen display looks, etc.
+ *
+ */
+/*******************************************|********************************************/
+/* */
+/* Epson ESC/Page command Functions */
+/* */
+/*******************************************|********************************************/
+
+#ifndef __EPSON_ESCPAGE_H__
+#define __EPSON_ESCPAGE_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*------------------------------------ Includes -------------------------------------*/
+/*******************************************|********************************************/
+#include "epson-escpr-pvt.h"
+#include "epson-escpr-media.h"
+
+/*------------------------------- Global Compiler Switch -------------------------------*/
+/*******************************************|********************************************/
+#define EPS_PAGE_RIT (1)
+#define EPS_PAGE_TONER_SAVE (0)
+#define EPS_PAGE_OUTUNIT_FACEDOWN (1)
+#define EPS_PAGE_LOWRES_MODE (1) /* OFF=0 / ON=1 */
+#define EPS_PAGE_HT_ERR_DIFFUSION (1) /* Halftoning mode */
+
+/*----------------------------------- Definitions ------------------------------------*/
+/*******************************************|********************************************/
+#define dim(x) (sizeof(x) / sizeof(x[0]))
+#define EPS_EJL_LINEMAX (256)
+
+/*--------------------------- ESC/Page Media Declarations ---------------------------*/
+/*******************************************|********************************************/
+typedef struct _tagEPS_PAGE_MEDIASIZE_ {
+ EPS_INT32 id;
+ EPS_INT32 paper_x;
+ EPS_INT32 paper_y;
+ EPS_INT32 print_area_x_border;
+ EPS_INT32 print_area_y_border;
+ const EPS_INT8 *name;
+} EPS_PAGE_MEDIASIZE;
+
+/* Size 600dpi */
+static const EPS_PAGE_MEDIASIZE pageMediaSize[] = {
+ { EPS_MSID_A4, 4960, 7016, 4720, 6776, "A4" },
+ { EPS_MSID_A3, 7016, 9920, 6776, 9680, "A3" },
+ { EPS_MSID_B4, 6072, 8600, 5832, 8360, "B4" },
+ { EPS_MSID_B5, 4300, 6072, 4060, 5832, "B5" },
+ { EPS_MSID_LETTER, 5100, 6600, 4860, 6360, "LT" },
+ { EPS_MSID_LEGAL, 5100, 8400, 4860, 8160, "LGL"},
+ { EPS_MSID_POSTCARD,2362, 3496, 2122, 3256, "PC" }
+};
+
+/*--------------------------- Data Structure Declarations ---------------------------*/
+/*******************************************|********************************************/
+/* command data buffer */
+typedef struct tagEPS_COMMAND_BUFFER
+{
+ EPS_UINT32 size; /* allocated buffer size */
+ EPS_UINT32 len; /* data size */
+ EPS_INT8* p;
+ void* pExtent;
+} EPS_COMMAND_BUFFER;
+
+/*-------------------------- Public Function Declarations ---------------------------*/
+/*******************************************|********************************************/
+extern EPS_ERR_CODE pageInitJob (const EPS_JOB_ATTRIB *pJobAttr);
+extern EPS_ERR_CODE pageAllocBuffer (void);
+extern void pageRelaseBuffer (void);
+extern EPS_ERR_CODE pageStartJob (void);
+extern EPS_ERR_CODE pageEndJob (void);
+extern EPS_ERR_CODE pageStartPage (void);
+extern EPS_ERR_CODE pageEndPage (void);
+extern EPS_ERR_CODE pageColorRow (const EPS_BANDBMP*, EPS_RECT*);
+extern EPS_ERR_CODE pageSendLeftovers (void);
+
+ /*** Get Supported Media Function */
+ /*** -------------------------------------------------------------------------------*/
+extern EPS_ERR_CODE pageCreateMediaInfo (EPS_PRINTER_INN* printer, EPS_UINT8* pmString,
+ EPS_INT32 pmSize );
+extern void pageClearSupportedMedia (EPS_PRINTER_INN* printer );
+extern EPS_ERR_CODE pageGetPrintAreaInfoFromTable(const EPS_JOB_ATTRIB*,
+ EPS_UINT32*, EPS_UINT32*, EPS_LAYOUT_INFO*);
+extern EPS_ERR_CODE pageCreatePrintAreaInfoFromTable (EPS_UINT32,EPS_PRINT_AREA_INFO* );
+
+ /*** Get Printable Area */
+ /*** -------------------------------------------------------------------------------*/
+extern EPS_ERR_CODE pageGetPrintableArea (EPS_JOB_ATTRIB*, EPS_UINT32*, EPS_UINT32* );
+
+
+/*----------------------- ESC/Page Local Function Declarations ----------------------*/
+/*******************************************|********************************************/
+typedef EPS_ERR_CODE (*PAGE_CmdBuffGrow )(EPS_COMMAND_BUFFER *pCmdBuff, EPS_INT32 addSize);
+
+extern EPS_ERR_CODE ejlStart (EPS_COMMAND_BUFFER *pCmdBuff, PAGE_CmdBuffGrow pfncGrow);
+extern EPS_ERR_CODE ejlEnd (EPS_COMMAND_BUFFER *pCmdBuff, PAGE_CmdBuffGrow pfncGrow,
+ EPS_INT32 pageCount );
+extern EPS_ERR_CODE ejlPageEsc (EPS_COMMAND_BUFFER *pCmdBuff, PAGE_CmdBuffGrow pfncGrow);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* def __EPSON_ESCPAGE_H__ */
+
+/*__________________________________ epson-escpage.h ________________________________*/
+
+/*34567890123456789012345678901234567890123456789012345678901234567890123456789012345678*/
+/* 1 2 3 4 5 6 7 8 */
+/*******************************************|********************************************/
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+/***** End of File *** End of File *** End of File *** End of File *** End of File ******/
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
13 changes: 13 additions & 0 deletions pkgs/by-name/ep/epson-escpr/1.8.6-warnings-lib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/lib/epson-escpr-api.h 2024-10-30 12:42:07.278862232 -0400
+++ b/lib/epson-escpr-api.h 2024-10-30 12:43:46.975989499 -0400
@@ -111,6 +111,10 @@ extern EPS_ERR_CODE epsGetUsersizeRange
/*** -------------------------------------------------------------------------------*/
extern EPS_ERR_CODE epsMakeMainteCmd (EPS_INT32, EPS_UINT8*, EPS_UINT32* );

+extern EPS_ERR_CODE SetupJobAttrib (const EPS_JOB_ATTRIB* );
+extern EPS_ERR_CODE SendStartJob (EPS_BOOL );
+extern EPS_ERR_CODE PrintBand (const EPS_UINT8*, EPS_UINT32, EPS_UINT32* );
+
#ifdef __cplusplus
}
#endif
40 changes: 40 additions & 0 deletions pkgs/by-name/ep/epson-escpr/1.8.6-warnings-src.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--- a/src/filter.c 2024-10-30 12:44:02.992729085 -0400
+++ b/src/filter.c 2024-10-30 12:44:49.836274137 -0400
@@ -32,7 +32,9 @@

#include "epson-protocol.h"
#include "epson-escpr-api.h"
+#include "epson-escpr-services.h"
#include "epson-escpr-mem.h"
+#include "epson-escpage.h"

#include "err.h"
#include "mem.h"
@@ -42,6 +44,7 @@
#include "optBase.h"
#include "linux_cmn.h"
#include "custompage.h"
+#include "xfifo.h"

#define WIDTH_BYTES(bits) (((bits) + 31) / 32 * 4)

--- a/src/mem.c 2024-10-30 12:42:31.732309679 -0400
+++ b/src/mem.c 2024-10-30 12:43:15.375844801 -0400
@@ -22,6 +22,7 @@
#endif

#include <stdlib.h>
+#include "err.h"
#include "mem.h"

void *
--- a/src/wrapper.c 2024-10-30 12:48:35.673934604 -0400
+++ b/src/wrapper.c 2024-10-30 12:49:00.237373816 -0400
@@ -35,6 +35,7 @@
#include <signal.h>

#include "libprtX.h"
+#include "custompage.h"

#define WIDTH_BYTES(bits) (((bits) + 31) / 32 * 4)

33 changes: 26 additions & 7 deletions pkgs/by-name/ep/epson-escpr/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{ lib, stdenv, fetchurl, cups }:
{
lib,
stdenv,
fetchurl,
cups,
}:

let version = "1.7.20";
in stdenv.mkDerivation {
let
version = "1.8.6-1";
in
stdenv.mkDerivation {
pname = "epson-escpr";
inherit version;

Expand All @@ -12,15 +19,27 @@ in stdenv.mkDerivation {
# version.
# NOTE: Don't forget to update the webarchive link too!
urls = [
"https://download3.ebz.epson.net/dsc/f/03/00/13/76/45/5ac2ea8f9cf94a48abd64afd0f967f98c4fc24aa/epson-inkjet-printer-escpr-${version}-1lsb3.2.tar.gz"
"https://download3.ebz.epson.net/dsc/f/03/00/16/21/81/74d098a47c3a616713079c9cd5904b468bb33dea/epson-inkjet-printer-escpr-${version}.tar.gz"

"https://web.archive.org/web/https://download3.ebz.epson.net/dsc/f/03/00/13/76/45/5ac2ea8f9cf94a48abd64afd0f967f98c4fc24aa/epson-inkjet-printer-escpr-${version}-1lsb3.2.tar.gz"
"https://web.archive.org/web/https://download3.ebz.epson.net/dsc/f/03/00/16/21/81/74d098a47c3a616713079c9cd5904b468bb33dea/epson-inkjet-printer-escpr-${version}.tar.gz"
];
sha256 = "sha256:09rscpm557dgaflylr93wcwmyn6fnvr8nc77abwnq97r6hxwrkhk";
sha256 = "sha256-hVbX4OXPe4y37Szju3uVdXlVdjX4DFSN/A2Emz3eCcQ=";
};

patches = [ ./cups-filter-ppd-dirs.patch ];
patches = [
./cups-filter-ppd-dirs.patch
# DOS Line Endings in /lib directory and UNIX Line endings in /src directory.
# So a separate patch for /lib and /src
./1.8.6-warnings-lib.patch
./1.8.6-warnings-src.patch
./1.8-missing-include.patch
];

# To suppress error (Stripping trailing CRs from patch; use --binary to disable.)
patchFlags = [
"--binary"
"-p1"
];
buildInputs = [ cups ];

meta = with lib; {
Expand Down

0 comments on commit 013b629

Please sign in to comment.