+++ /dev/null
-Fix unaligned reads.
-https://bugs.gentoo.org/show_bug.cgi?id=304921
-
-Upstream:
-https://sourceforge.net/tracker/?func=detail&aid=2995413&group_id=66144&atid=513479
-
-Index: silgraphite-2.3.1/engine/src/segment/FileInput.cpp
-===================================================================
---- silgraphite-2.3.1.orig/engine/src/segment/FileInput.cpp
-+++ silgraphite-2.3.1/engine/src/segment/FileInput.cpp
-@@ -41,6 +41,10 @@ DEFINE_THIS_FILE
-
- //:End Ignore
-
-+#define RAW_READ(var,size,buf) \
-+ for(int i = 0; i < isizeof(size);i++){\
-+ var |= buf[i]<<8*(isizeof(size)-i-1);\
-+ }
- //:>********************************************************************************************
- //:> Forward declarations
- //:>********************************************************************************************
-@@ -133,11 +137,11 @@ byte GrBufferIStream::ReadByteFromFont()
- ----------------------------------------------------------------------------------------------*/
- short GrBufferIStream::ReadShortFromFont()
- {
-- short snInput = *(short *)m_pbNext;
-+ short snInput = 0;
-+ RAW_READ(snInput,short,m_pbNext);
- m_pbNext += isizeof(short);
- if (m_pbLim && m_pbNext > m_pbLim)
- THROW(kresReadFault);
-- snInput = lsbf(snInput);
- return snInput;
- }
-
-@@ -147,11 +151,11 @@ short GrBufferIStream::ReadShortFromFont
- ----------------------------------------------------------------------------------------------*/
- utf16 GrBufferIStream::ReadUShortFromFont()
- {
-- utf16 chwInput = *(utf16 *)m_pbNext;
-+ utf16 chwInput = 0;
-+ RAW_READ(chwInput,utf16,m_pbNext);
- m_pbNext += isizeof(utf16);
- if (m_pbLim && m_pbNext > m_pbLim)
- THROW(kresReadFault);
-- chwInput = lsbf(chwInput);
- return chwInput;
- }
-
-@@ -161,11 +165,11 @@ utf16 GrBufferIStream::ReadUShortFromFon
- ----------------------------------------------------------------------------------------------*/
- int GrBufferIStream::ReadIntFromFont()
- {
-- int nInput = *(int *)m_pbNext;
-+ int nInput = 0;
-+ RAW_READ(nInput,int,m_pbNext);
- m_pbNext += isizeof(int);
- if (m_pbLim && m_pbNext > m_pbLim)
- THROW(kresReadFault);
-- nInput = lsbf(nInput);
- return nInput;
- }
-
+++ /dev/null
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=4
-
-inherit eutils
-
-DESCRIPTION="Rendering engine for complex non-Roman writing systems"
-HOMEPAGE="http://graphite.sil.org/"
-SRC_URI="mirror://sourceforge/${PN}/${PV}/${P}.tar.gz"
-
-LICENSE="|| ( CPL-0.5 LGPL-2.1 )"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="pango static-libs truetype xft"
-
-RDEPEND="
- pango? ( x11-libs/pango media-libs/fontconfig )
- truetype? ( media-libs/freetype:2 )
- xft? ( x11-libs/libXft )"
-DEPEND="${RDEPEND}
- virtual/pkgconfig"
-
-src_prepare() {
- epatch "${FILESDIR}/${P}-aligned_access.patch"
-
- # Drop DEPRECATED flags, bug #385533
- sed -i -e 's:-D[A-Z_]*DISABLE_DEPRECATED:$(NULL):g' \
- wrappers/pangographite/Makefile.am wrappers/pangographite/Makefile.in \
- wrappers/pangographite/graphite/Makefile.am || die
-}
-
-src_configure() {
- econf \
- $(use_enable static-libs static) \
- $(use_with xft) \
- $(use_with truetype freetype) \
- $(use_with pango pangographite)
-}
-
-src_install() {
- default
- find "${ED}" -name '*.la' -exec rm -f {} +
-}