1 |
commit: 251405fcbb39497047cdd5f878dca0749286fd7b |
2 |
Author: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 4 20:36:51 2019 +0000 |
4 |
Commit: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 4 20:38:16 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=251405fc |
7 |
|
8 |
net-print/splix: fix for big-endian hosts |
9 |
|
10 |
Closes: https://bugs.gentoo.org/673454 |
11 |
Package-Manager: Portage-2.3.53, Repoman-2.3.12 |
12 |
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org> |
13 |
|
14 |
.../files/splix-2.0.0_p20130826-algo0x11_le.patch | 33 +++++++++++ |
15 |
net-print/splix/splix-2.0.0_p20130826-r1.ebuild | 66 ++++++++++++++++++++++ |
16 |
2 files changed, 99 insertions(+) |
17 |
|
18 |
diff --git a/net-print/splix/files/splix-2.0.0_p20130826-algo0x11_le.patch b/net-print/splix/files/splix-2.0.0_p20130826-algo0x11_le.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..e73e6ebbe9f |
21 |
--- /dev/null |
22 |
+++ b/net-print/splix/files/splix-2.0.0_p20130826-algo0x11_le.patch |
23 |
@@ -0,0 +1,33 @@ |
24 |
+--- splix-2.0.0_p20130826/src/algo0x11.cpp.orig 2018-12-19 20:55:03.216127909 +0100 |
25 |
++++ splix-2.0.0_p20130826/src/algo0x11.cpp 2018-12-19 20:58:21.986353903 +0100 |
26 |
+@@ -89,7 +89,8 @@ |
27 |
+ |
28 |
+ // Print the table |
29 |
+ for (unsigned long i=0; i < TABLE_PTR_SIZE; i++, w += 2) { |
30 |
+- *(uint16_t *)(out + w) = (uint16_t)_ptrArray[i]; |
31 |
++ out[w + 0] = (uint8_t)_ptrArray[i]; |
32 |
++ out[w + 1] = (uint8_t)(_ptrArray[i] >> 8); |
33 |
+ if (_ptrArray[i] > uncompSize) |
34 |
+ uncompSize = _ptrArray[i]; |
35 |
+ } |
36 |
+@@ -97,7 +98,10 @@ |
37 |
+ // Print the first uncompressed bytes |
38 |
+ if (uncompSize > MAX_UNCOMPRESSED_BYTES) |
39 |
+ uncompSize = MAX_UNCOMPRESSED_BYTES; |
40 |
+- *(uint32_t *)out = (uint32_t)uncompSize; |
41 |
++ out[0] = (uint8_t)uncompSize; |
42 |
++ out[1] = (uint8_t)(uncompSize >> 8); |
43 |
++ out[2] = (uint8_t)(uncompSize >> 16); |
44 |
++ out[3] = (uint8_t)(uncompSize >> 24); |
45 |
+ for (r=0; r < uncompSize; r++, w++) |
46 |
+ out[w] = data[r]; |
47 |
+ |
48 |
+@@ -234,7 +238,7 @@ |
49 |
+ // Register the result into a band plane |
50 |
+ plane = new BandPlane(); |
51 |
+ plane->setData(output, outputSize); |
52 |
+- plane->setEndian(BandPlane::Dependant); |
53 |
++ plane->setEndian(BandPlane::LittleEndian); |
54 |
+ plane->setCompression(0x11); |
55 |
+ |
56 |
+ return plane; |
57 |
|
58 |
diff --git a/net-print/splix/splix-2.0.0_p20130826-r1.ebuild b/net-print/splix/splix-2.0.0_p20130826-r1.ebuild |
59 |
new file mode 100644 |
60 |
index 00000000000..f8278234dc3 |
61 |
--- /dev/null |
62 |
+++ b/net-print/splix/splix-2.0.0_p20130826-r1.ebuild |
63 |
@@ -0,0 +1,66 @@ |
64 |
+# Copyright 1999-2019 Gentoo Authors |
65 |
+# Distributed under the terms of the GNU General Public License v2 |
66 |
+ |
67 |
+EAPI=7 |
68 |
+inherit eutils toolchain-funcs |
69 |
+ |
70 |
+DESCRIPTION="A set of CUPS printer drivers for SPL (Samsung Printer Language) printers" |
71 |
+HOMEPAGE="http://splix.sourceforge.net/" |
72 |
+SRC_URI="https://dev.gentoo.org/~voyageur/distfiles/${P}.tar.bz2 |
73 |
+ https://dev.gentoo.org/~voyageur/distfiles/samsung-cms-20120312.tar.xz" |
74 |
+ |
75 |
+LICENSE="GPL-2" |
76 |
+SLOT="0" |
77 |
+KEYWORDS="~amd64 ~x86" |
78 |
+IUSE="+jbig" |
79 |
+ |
80 |
+DEPEND=">=app-text/ghostscript-gpl-9.02 |
81 |
+ >=net-print/cups-1.4.0 |
82 |
+ jbig? ( media-libs/jbigkit )" |
83 |
+RDEPEND="${DEPEND}" |
84 |
+ |
85 |
+PATCHES=( "${FILESDIR}"/${P}-algo0x11_le.patch ) |
86 |
+ |
87 |
+src_prepare() { |
88 |
+ default |
89 |
+ |
90 |
+ # Move to correct place |
91 |
+ mv *.ppd ppd/ |
92 |
+ # Honor LDFLAGS |
93 |
+ sed -e "/[a-z]_LDFLAGS/s/:=.*/:= $\{LDFLAGS\}/" -i module.mk \ |
94 |
+ || die |
95 |
+ # Correct link comand |
96 |
+ sed -e "s/g++/$\{LINKER\}/" -i rules.mk \ |
97 |
+ || die |
98 |
+} |
99 |
+ |
100 |
+src_compile() { |
101 |
+ local options="MODE=optimized" |
102 |
+ use jbig || options="${options} DISABLE_JBIG=1" |
103 |
+ emake ${options} PSTORASTER=gstoraster CXX="$(tc-getCXX)" \ |
104 |
+ OPTIM_CFLAGS="${CFLAGS}" OPTIM_CXXFLAGS="${CXXFLAGS}" |
105 |
+} |
106 |
+ |
107 |
+src_install() { |
108 |
+ emake DESTDIR="${D}" install |
109 |
+ gzip "${ED}"/$(cups-config --datadir)/model/*/*.ppd || die |
110 |
+ |
111 |
+ emake DESTDIR="${D}" CMSDIR="${WORKDIR}"/cms MANUFACTURER=samsung installcms |
112 |
+ # Add symlinks for xerox and dell models (installed in samsung) |
113 |
+ dosym $(cups-config --datadir)/profiles/samsung $(cups-config --datadir)/profiles/xerox |
114 |
+ dosym $(cups-config --datadir)/profiles/samsung $(cups-config --datadir)/profiles/dell |
115 |
+} |
116 |
+ |
117 |
+pkg_postinst() { |
118 |
+ ewarn "You *MUST* make sure that the PPD files that CUPS is using" |
119 |
+ ewarn "for actually installed printers are updated if you upgraded" |
120 |
+ ewarn "from a previous version of splix!" |
121 |
+ ewarn "Otherwise you will be unable to print (your printer might" |
122 |
+ ewarn "spit out blank pages etc.)." |
123 |
+ ewarn "To do that, simply delete the corresponding PPD file in" |
124 |
+ ewarn "/etc/cups/ppd/, click on 'Modify Printer' belonging to the" |
125 |
+ ewarn "corresponding printer in the CUPS webinterface (usually" |
126 |
+ ewarn "reachable via http://localhost:631/) and choose the correct" |
127 |
+ ewarn "printer make and model, for example:" |
128 |
+ ewarn "'Samsung' -> 'Samsung ML-1610, 1.0 (en)'" |
129 |
+} |