From d6bb98afab1a65836d7817dc96bd1c45ae6117f4 Mon Sep 17 00:00:00 2001 From: Mu Qiao Date: Wed, 18 Apr 2012 01:30:59 +0000 Subject: Fix for gcc-4.7 and multilib-strict check (bug #412389) Thanks to Alphat-PC for the help. (Portage version: 2.1.10.56/cvs/Linux x86_64) --- app-i18n/sunpinyin/ChangeLog | 10 ++++- .../sunpinyin/files/sunpinyin-2.0.3-gcc-4.7.patch | 49 ++++++++++++++++++++++ app-i18n/sunpinyin/sunpinyin-2.0.3-r1.ebuild | 28 +++++++++---- 3 files changed, 78 insertions(+), 9 deletions(-) create mode 100644 app-i18n/sunpinyin/files/sunpinyin-2.0.3-gcc-4.7.patch (limited to 'app-i18n') diff --git a/app-i18n/sunpinyin/ChangeLog b/app-i18n/sunpinyin/ChangeLog index 2ed57d86b4f1..fab99f360923 100644 --- a/app-i18n/sunpinyin/ChangeLog +++ b/app-i18n/sunpinyin/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-i18n/sunpinyin -# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-i18n/sunpinyin/ChangeLog,v 1.8 2011/04/17 09:03:04 qiaomuf Exp $ +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-i18n/sunpinyin/ChangeLog,v 1.9 2012/04/18 01:30:59 qiaomuf Exp $ + + 18 Apr 2012; Mu Qiao sunpinyin-2.0.3-r1.ebuild, + +files/sunpinyin-2.0.3-gcc-4.7.patch: + Fix for gcc-4.7 and multilib-strict check (bug #412389) + + Thanks to Alphat-PC for the help. 17 Apr 2011; Mu Qiao sunpinyin-2.0.3-r1.ebuild, metadata.xml: diff --git a/app-i18n/sunpinyin/files/sunpinyin-2.0.3-gcc-4.7.patch b/app-i18n/sunpinyin/files/sunpinyin-2.0.3-gcc-4.7.patch new file mode 100644 index 000000000000..c523449ef514 --- /dev/null +++ b/app-i18n/sunpinyin/files/sunpinyin-2.0.3-gcc-4.7.patch @@ -0,0 +1,49 @@ +From 3d35aa0370d9c7bd455098caa9ba22ebe1f82968 Mon Sep 17 00:00:00 2001 +From: Yong Sun +Date: Wed, 4 Apr 2012 18:41:39 +0800 +Subject: [PATCH] Integrated patch from YunQiang Su, fixed FTBFS with gcc-4.7 + +--- + SConstruct | 3 ++- + src/portability.h | 5 ++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/SConstruct b/SConstruct +index 97abf47..354fd19 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -313,7 +313,8 @@ def DoConfigure(): + conf.CheckCHeader('sys/param.h') + conf.CheckCHeader('sys/stat.h') + conf.CheckCHeader('sys/types.h') +- conf.CheckCHeader('unistd.h') ++ if conf.CheckCHeader('unistd.h'): ++ conf.Define('DHAVE_UNISTD_H', 1) + conf.CheckCHeader('wchar.h') + + # add essential package requirements +diff --git a/src/portability.h b/src/portability.h +index 949d4f2..cf43bd0 100644 +--- a/src/portability.h ++++ b/src/portability.h +@@ -44,15 +44,14 @@ + #include + #include + +-#if defined(sun) ++#if defined(HAVE_UNISTD_H) + #include + #ifdef __cplusplus + #include + #else + #include + #endif //__cpluscplus +-#endif //defined(sun) +- ++#endif //defined(HAVE_UNISTD_H) + + #ifndef HOST_OS_GNUC_2 + #if defined(DEBUG) && !defined(NDEBUG) +-- +1.7.8.5 + diff --git a/app-i18n/sunpinyin/sunpinyin-2.0.3-r1.ebuild b/app-i18n/sunpinyin/sunpinyin-2.0.3-r1.ebuild index ab98a0cd7f30..9e018238917a 100644 --- a/app-i18n/sunpinyin/sunpinyin-2.0.3-r1.ebuild +++ b/app-i18n/sunpinyin/sunpinyin-2.0.3-r1.ebuild @@ -1,9 +1,10 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-i18n/sunpinyin/sunpinyin-2.0.3-r1.ebuild,v 1.2 2011/04/17 09:03:04 qiaomuf Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-i18n/sunpinyin/sunpinyin-2.0.3-r1.ebuild,v 1.3 2012/04/18 01:30:59 qiaomuf Exp $ -EAPI="1" -inherit eutils scons-utils +EAPI="3" + +inherit eutils multilib scons-utils toolchain-funcs DESCRIPTION="SunPinyin is a SLM (Statistical Language Model) based IME" HOMEPAGE="http://sunpinyin.googlecode.com" @@ -24,15 +25,28 @@ src_unpack() { unpack "${P}.tar.gz" ln -s "${DISTDIR}/dict.utf8.tar.bz2" "${S}/raw/" || die "dict file not found" ln -s "${DISTDIR}/lm_sc.t3g.arpa.tar.bz2" "${S}/raw/" || die "dict file not found" - cd "${S}" && epatch "${FILESDIR}/${P}-force-switch.patch" +} + +src_prepare() { + epatch "${FILESDIR}/${P}-force-switch.patch" + epatch "${FILESDIR}/${P}-gcc-4.7.patch" +} + +src_configure() { + tc-export CXX + myesconsargs=( + --prefix="${EPREFIX}"/usr + --libdir="${EPREFIX}"/usr/$(get_libdir) + --libdatadir="${EPREFIX}"/usr/lib + ) } src_compile() { - escons --prefix="/usr" || die + escons || die } src_install() { - escons --prefix="/usr" --install-sandbox="${D}" install || die + escons --install-sandbox="${ED}" install || die } pkg_postinst() { -- cgit v1.2.3-65-gdbad