From 251405fcbb39497047cdd5f878dca0749286fd7b Mon Sep 17 00:00:00 2001 From: Bernard Cafarelli Date: Fri, 4 Jan 2019 21:36:51 +0100 Subject: net-print/splix: fix for big-endian hosts Closes: https://bugs.gentoo.org/673454 Package-Manager: Portage-2.3.53, Repoman-2.3.12 Signed-off-by: Bernard Cafarelli --- .../files/splix-2.0.0_p20130826-algo0x11_le.patch | 33 +++++++++++ net-print/splix/splix-2.0.0_p20130826-r1.ebuild | 66 ++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 net-print/splix/files/splix-2.0.0_p20130826-algo0x11_le.patch create mode 100644 net-print/splix/splix-2.0.0_p20130826-r1.ebuild (limited to 'net-print/splix') 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 new file mode 100644 index 000000000000..e73e6ebbe9fc --- /dev/null +++ b/net-print/splix/files/splix-2.0.0_p20130826-algo0x11_le.patch @@ -0,0 +1,33 @@ +--- splix-2.0.0_p20130826/src/algo0x11.cpp.orig 2018-12-19 20:55:03.216127909 +0100 ++++ splix-2.0.0_p20130826/src/algo0x11.cpp 2018-12-19 20:58:21.986353903 +0100 +@@ -89,7 +89,8 @@ + + // Print the table + for (unsigned long i=0; i < TABLE_PTR_SIZE; i++, w += 2) { +- *(uint16_t *)(out + w) = (uint16_t)_ptrArray[i]; ++ out[w + 0] = (uint8_t)_ptrArray[i]; ++ out[w + 1] = (uint8_t)(_ptrArray[i] >> 8); + if (_ptrArray[i] > uncompSize) + uncompSize = _ptrArray[i]; + } +@@ -97,7 +98,10 @@ + // Print the first uncompressed bytes + if (uncompSize > MAX_UNCOMPRESSED_BYTES) + uncompSize = MAX_UNCOMPRESSED_BYTES; +- *(uint32_t *)out = (uint32_t)uncompSize; ++ out[0] = (uint8_t)uncompSize; ++ out[1] = (uint8_t)(uncompSize >> 8); ++ out[2] = (uint8_t)(uncompSize >> 16); ++ out[3] = (uint8_t)(uncompSize >> 24); + for (r=0; r < uncompSize; r++, w++) + out[w] = data[r]; + +@@ -234,7 +238,7 @@ + // Register the result into a band plane + plane = new BandPlane(); + plane->setData(output, outputSize); +- plane->setEndian(BandPlane::Dependant); ++ plane->setEndian(BandPlane::LittleEndian); + plane->setCompression(0x11); + + return plane; diff --git a/net-print/splix/splix-2.0.0_p20130826-r1.ebuild b/net-print/splix/splix-2.0.0_p20130826-r1.ebuild new file mode 100644 index 000000000000..f8278234dc38 --- /dev/null +++ b/net-print/splix/splix-2.0.0_p20130826-r1.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit eutils toolchain-funcs + +DESCRIPTION="A set of CUPS printer drivers for SPL (Samsung Printer Language) printers" +HOMEPAGE="http://splix.sourceforge.net/" +SRC_URI="https://dev.gentoo.org/~voyageur/distfiles/${P}.tar.bz2 + https://dev.gentoo.org/~voyageur/distfiles/samsung-cms-20120312.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+jbig" + +DEPEND=">=app-text/ghostscript-gpl-9.02 + >=net-print/cups-1.4.0 + jbig? ( media-libs/jbigkit )" +RDEPEND="${DEPEND}" + +PATCHES=( "${FILESDIR}"/${P}-algo0x11_le.patch ) + +src_prepare() { + default + + # Move to correct place + mv *.ppd ppd/ + # Honor LDFLAGS + sed -e "/[a-z]_LDFLAGS/s/:=.*/:= $\{LDFLAGS\}/" -i module.mk \ + || die + # Correct link comand + sed -e "s/g++/$\{LINKER\}/" -i rules.mk \ + || die +} + +src_compile() { + local options="MODE=optimized" + use jbig || options="${options} DISABLE_JBIG=1" + emake ${options} PSTORASTER=gstoraster CXX="$(tc-getCXX)" \ + OPTIM_CFLAGS="${CFLAGS}" OPTIM_CXXFLAGS="${CXXFLAGS}" +} + +src_install() { + emake DESTDIR="${D}" install + gzip "${ED}"/$(cups-config --datadir)/model/*/*.ppd || die + + emake DESTDIR="${D}" CMSDIR="${WORKDIR}"/cms MANUFACTURER=samsung installcms + # Add symlinks for xerox and dell models (installed in samsung) + dosym $(cups-config --datadir)/profiles/samsung $(cups-config --datadir)/profiles/xerox + dosym $(cups-config --datadir)/profiles/samsung $(cups-config --datadir)/profiles/dell +} + +pkg_postinst() { + ewarn "You *MUST* make sure that the PPD files that CUPS is using" + ewarn "for actually installed printers are updated if you upgraded" + ewarn "from a previous version of splix!" + ewarn "Otherwise you will be unable to print (your printer might" + ewarn "spit out blank pages etc.)." + ewarn "To do that, simply delete the corresponding PPD file in" + ewarn "/etc/cups/ppd/, click on 'Modify Printer' belonging to the" + ewarn "corresponding printer in the CUPS webinterface (usually" + ewarn "reachable via http://localhost:631/) and choose the correct" + ewarn "printer make and model, for example:" + ewarn "'Samsung' -> 'Samsung ML-1610, 1.0 (en)'" +} -- cgit v1.2.3-65-gdbad