forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app-i18n/sunpinyin: fix gcc-6 build err
thanks Peter Levine for creating the patch Gentoo-Bug: 594380 Package-Manager: portage-2.3.1
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
app-i18n/sunpinyin/files/sunpinyin-2.0.4_pre20130108-gcc6-use-float.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- sunpinyin-2.0.4_pre20130108/src/slm/tslmpack/common.h.old 2016-09-20 02:54:15.046257131 -0400 | ||
+++ sunpinyin-2.0.4_pre20130108/src/slm/tslmpack/common.h 2016-09-20 02:55:48.041124978 -0400 | ||
@@ -53,10 +53,10 @@ | ||
typedef std::map<float, int> RealIndexMap; // map real values to their indices | ||
typedef std::map<std::string, unsigned int> TLexicon; // map word to wid | ||
|
||
-#define EffectivePr(a) (float((usingLogPr) ? ((a) / log(2.0)) : (-log2((a))))) | ||
-#define OriginalPr(b) (float((usingLogPr) ? ((b) * log(2.0)) : (exp2(-(b))))) | ||
-#define EffectiveBow(a) (float((usingLogPr) ? (exp(-(a))) : ((a)))) | ||
-#define OriginalBow(b) (float((usingLogPr) ? (-log((b))) : ((b)))) | ||
+#define EffectivePr(a) (float((usingLogPr) ? ((a) / logf(2.0f)) : (-log2f((a))))) | ||
+#define OriginalPr(b) (float((usingLogPr) ? ((b) * logf(2.0f)) : (exp2f(-(b))))) | ||
+#define EffectiveBow(a) (float((usingLogPr) ? (expf(-(a))) : ((a)))) | ||
+#define OriginalBow(b) (float((usingLogPr) ? (-logf((b))) : ((b)))) | ||
|
||
#endif //_SLM_PACK_COMMON_H | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright 1999-2016 Gentoo Foundation | ||
# Distributed under the terms of the GNU General Public License v2 | ||
# $Id$ | ||
|
||
EAPI=5 | ||
PYTHON_COMPAT=( python2_7 ) | ||
inherit eutils multilib python-any-r1 scons-utils toolchain-funcs | ||
|
||
DESCRIPTION="A Statistical Language Model based Chinese input method library" | ||
HOMEPAGE="https://github.com/sunpinyin/sunpinyin" | ||
SRC_URI="https://dev.gentoo.org/~yngwin/distfiles/${P}.tar.xz" | ||
|
||
LICENSE="LGPL-2.1 CDDL" | ||
SLOT="0/1" | ||
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" | ||
IUSE="" | ||
|
||
RDEPEND="dev-db/sqlite:3" | ||
DEPEND="${RDEPEND} | ||
${PYTHON_DEPS} | ||
dev-util/intltool | ||
sys-devel/gettext | ||
virtual/pkgconfig" | ||
PDEPEND="app-i18n/sunpinyin-data" | ||
|
||
src_prepare() { | ||
epatch "${FILESDIR}"/${PN}-2.0.4-pod2man.patch | ||
epatch "${FILESDIR}"/${P}-gcc6-use-float.patch | ||
epatch_user | ||
} | ||
|
||
src_configure() { | ||
tc-export CXX | ||
myesconsargs=( | ||
--prefix="${EPREFIX}"/usr | ||
--libdir="${EPREFIX}"/usr/$(get_libdir) | ||
) | ||
} | ||
|
||
src_compile() { | ||
escons | ||
} | ||
|
||
src_install() { | ||
escons --install-sandbox="${D}" install | ||
rm -rf "${D}"/usr/share/doc/${PN} || die | ||
dodoc doc/{README,SLM-inst.mk,SLM-train.mk} | ||
} |