aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2016-05-24 01:55:06 +0800
committerhrs <hrs@FreeBSD.org>2016-05-24 01:55:06 +0800
commitacf57655294e84e5a53ddc30bb8f793e8d391717 (patch)
treef0421e78be30f7265d7742601896c332bc09ddc0
parentc5627aa5748eb674848bf0673dc34862f7fa5169 (diff)
downloadfreebsd-ports-gnome-acf57655294e84e5a53ddc30bb8f793e8d391717.tar.gz
freebsd-ports-gnome-acf57655294e84e5a53ddc30bb8f793e8d391717.tar.zst
freebsd-ports-gnome-acf57655294e84e5a53ddc30bb8f793e8d391717.zip
- Add workaround for broken C++11 support in GCC.
- Remove extra -9 for GZIP_CMD.
-rw-r--r--japanese/mozc-server/Makefile2
-rw-r--r--japanese/mozc-server/files/patch-src-base-flags.cc80
-rw-r--r--japanese/mozc-server/files/patch-src-rewriter-calculator-calculator.cc12
3 files changed, 93 insertions, 1 deletions
diff --git a/japanese/mozc-server/Makefile b/japanese/mozc-server/Makefile
index 36e0218934da..555934b02d80 100644
--- a/japanese/mozc-server/Makefile
+++ b/japanese/mozc-server/Makefile
@@ -404,7 +404,7 @@ do-build-mozc_el:
cd ${BUILD_WRKSRC}/unix/emacs && \
${EMACS_CMD} -batch -q -no-site-file -no-init-file \
-f batch-byte-compile mozc.el && \
- ${GZIP_CMD} -9 mozc.el
+ ${GZIP_CMD} mozc.el
do-install-mozc_el:
@${MKDIR} ${STAGEDIR}${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/mozc
diff --git a/japanese/mozc-server/files/patch-src-base-flags.cc b/japanese/mozc-server/files/patch-src-base-flags.cc
new file mode 100644
index 000000000000..d1bc31fafa69
--- /dev/null
+++ b/japanese/mozc-server/files/patch-src-base-flags.cc
@@ -0,0 +1,80 @@
+--- src/base/flags.cc.orig 2016-03-13 11:22:55.000000000 +0900
++++ src/base/flags.cc 2016-05-24 02:06:01.861439000 +0900
+@@ -36,6 +36,9 @@
+ #include <sstream>
+ #include <string>
+ #include <vector>
++#if defined(__GNUC__) && !defined(__clang__)
++#include <cstdlib>
++#endif
+
+ #include "base/port.h"
+ #include "base/singleton.h"
+@@ -78,6 +81,59 @@
+ // function, compiler may warn of "unused function".
+ template <typename T> struct StrToNumberImpl;
+
++#if defined(__GNUC__) && !defined(__clang__)
++static int stoi(const std::string& s) {
++ std::istringstream str(s);
++ int i;
++ str >> i;
++ return i;
++}
++static long stol(const std::string& s) {
++ std::istringstream str(s);
++ long i;
++ str >> i;
++ return i;
++}
++static long long stoll(const std::string& s) {
++ std::istringstream str(s);
++ long long i;
++ str >> i;
++ return i;
++}
++static unsigned long stoul(const std::string& s) {
++ std::istringstream str(s);
++ unsigned long i;
++ str >> i;
++ return i;
++}
++static unsigned long long stoull(const std::string& s) {
++ std::istringstream str(s);
++ unsigned long long i;
++ str >> i;
++ return i;
++}
++template <> struct StrToNumberImpl<int> {
++ static int Do(const string &s) { return stoi(s); }
++};
++
++template <> struct StrToNumberImpl<long> { // NOLINT
++ static long Do(const string &s) { return stol(s); } // NOLINT
++};
++
++template <> struct StrToNumberImpl<long long> { // NOLINT
++ static long long Do(const string &s) { return stoll(s); } // NOLINT
++};
++
++template <> struct StrToNumberImpl<unsigned long> { // NOLINT
++ static unsigned long Do(const string &s) { return stoul(s); } // NOLINT
++};
++
++template <> struct StrToNumberImpl<unsigned long long> { // NOLINT
++ static unsigned long long Do(const string &s) { // NOLINT
++ return stoull(s);
++ }
++};
++#else
+ template <> struct StrToNumberImpl<int> {
+ static int Do(const string &s) { return std::stoi(s); }
+ };
+@@ -99,6 +155,7 @@
+ return std::stoull(s);
+ }
+ };
++#endif
+
+ template <typename T> inline T StrToNumber(const string &s) {
+ return StrToNumberImpl<T>::Do(s);
diff --git a/japanese/mozc-server/files/patch-src-rewriter-calculator-calculator.cc b/japanese/mozc-server/files/patch-src-rewriter-calculator-calculator.cc
new file mode 100644
index 000000000000..35a01558811b
--- /dev/null
+++ b/japanese/mozc-server/files/patch-src-rewriter-calculator-calculator.cc
@@ -0,0 +1,12 @@
+--- src/rewriter/calculator/calculator.cc.orig 2016-03-13 11:22:55.000000000 +0900
++++ src/rewriter/calculator/calculator.cc 2016-05-24 02:06:47.310077000 +0900
+@@ -44,6 +44,9 @@
+ #include <map>
+ #include <string>
+ #include <vector>
++#if defined(__GNUC__) && !defined(__clang__)
++#include <cstdlib>
++#endif
+
+ #include "base/compiler_specific.h"
+ #include "base/logging.h"