Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Oct 2014 20:16:21 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r370219 - in head/japanese/mozc-server: . files
Message-ID:  <201410062016.s96KGLDe084645@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Mon Oct  6 20:16:21 2014
New Revision: 370219
URL: https://svnweb.freebsd.org/changeset/ports/370219
QAT: https://qat.redports.org/buildarchive/r370219/

Log:
  - Fix build failure on braches with Clang older than 3.4.
  - Fix build failure on head due to libiconv link error.
  - Remove redundant patches.
  - Add cflags and cflags_cc flags to build_mozc.py.

Deleted:
  head/japanese/mozc-server/files/patch-base_compiler_specific.h
Modified:
  head/japanese/mozc-server/Makefile
  head/japanese/mozc-server/files/patch-build_mozc.py
  head/japanese/mozc-server/files/patch-gyp_common.gypi

Modified: head/japanese/mozc-server/Makefile
==============================================================================
--- head/japanese/mozc-server/Makefile	Mon Oct  6 20:09:24 2014	(r370218)
+++ head/japanese/mozc-server/Makefile	Mon Oct  6 20:16:21 2014	(r370219)
@@ -3,7 +3,7 @@
 
 PORTNAME=	mozc
 PORTVERSION=	1.15.1868.102
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	japanese
 MASTER_SITES=	LOCAL/hrs
 DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
@@ -22,7 +22,8 @@ LIB_DEPENDS=	libprotobuf.so:${PORTSDIR}/
 		libzinnia.so:${PORTSDIR}/japanese/zinnia
 RUN_DEPENDS=	xdg-open:${PORTSDIR}/devel/xdg-utils
 
-USES=		compiler:c++0x pkgconfig iconv gmake tar:bzip2 python:build
+USES=		compiler:c++11-lang pkgconfig iconv:wchar_t gmake \
+		tar:bzip2 python:build
 
 BUILD_MOZC_LIST?=	mozc_server
 
@@ -48,6 +49,21 @@ USE_GNOME=	glib20 gtk20
 USE_EMACS=	yes
 .endif
 
+# Do not use Clang 3.3 or prior because of some C++11 library issues.
+.if exists(/usr/bin/clang)
+_CLANGVER!=	/usr/bin/clang --version 2>&1 || true
+.if !defined(_CLANGVER) || \
+    empty(_CLANGVER:M[0-9].[0-9]*:C/([0-9]).([0-9]).*/\1\2/g:M[0-9]*) || \
+    ${_CLANGVER:M[0-9].[0-9]*:C/([0-9]).([0-9]).*/\1\2/g} < 34
+USE_GCC=	yes
+_CCTYPE=	gcc
+.else
+_CCTYPE=	clang
+.endif
+.else
+_CCTYPE=	${CHOSEN_COMPILER_TYPE}
+.endif
+
 .include <bsd.port.pre.mk>
 
 .if ${OSVERSION} < 800107
@@ -61,6 +77,8 @@ BROKEN=		Does not compile: segfault
 GYP_DEFINES=	use_libprotobuf=1 \
 		channel_dev=0 \
 		enable_unittest=0 \
+		compiler_host="${_CCTYPE}" \
+		compiler_target="${_CCTYPE}" \
 		zinnia_model_file="${LOCALBASE}/share/tegaki/models/zinnia/handwriting-ja.model" \
 		ibus_mozc_icon_path="${LOCALBASE}/share/ibus-mozc/icons/product_icon.png" \
 		ibus_mozc_path="${PREFIX}/libexec/ibus-engine-mozc"
@@ -106,6 +124,8 @@ post-configure: ${WRKSRC}/mozcmake
 	    --server_dir="${PREFIX}/bin" \
 	    --localbase="${LOCALBASE}" \
 	    --ldflags="${LDFLAGS} -fstack-protector -L${LOCALBASE}/lib" \
+	    --cflags="${CFLAGS:Q}" \
+	    --cflags_cc="${CXXFLAGS:Q}" \
 	    --include_dirs="${LOCALBASE}/include" \
 	    ${GYP_OPTIONS}
 .endif

Modified: head/japanese/mozc-server/files/patch-build_mozc.py
==============================================================================
--- head/japanese/mozc-server/files/patch-build_mozc.py	Mon Oct  6 20:09:24 2014	(r370218)
+++ head/japanese/mozc-server/files/patch-build_mozc.py	Mon Oct  6 20:16:21 2014	(r370219)
@@ -1,16 +1,18 @@
 --- build_mozc.py.orig	2014-08-31 03:36:22.000000000 +0900
-+++ build_mozc.py	2014-08-31 06:04:34.000000000 +0900
-@@ -351,6 +351,9 @@
++++ build_mozc.py	2014-09-17 04:37:10.000000000 +0900
+@@ -351,6 +351,11 @@
    parser.add_option('--version_file', dest='version_file',
                      help='use the specified version template file',
                      default='mozc_version_template.txt')
 +  parser.add_option('--localbase', dest='localbase')
 +  parser.add_option('--ldflags', dest='ldflags')
++  parser.add_option('--cflags', dest='cflags')
++  parser.add_option('--cflags_cc', dest='cflags_cc')
 +  parser.add_option('--include_dirs', dest='include_dirs')
    AddTargetPlatformOption(parser)
  
    # Mac and Linux
-@@ -538,7 +541,7 @@
+@@ -538,7 +543,7 @@
    parser = optparse.OptionParser(usage='Usage: %prog build [options]')
    AddCommonOptions(parser)
    if IsLinux():
@@ -19,7 +21,7 @@
      parser.add_option('--jobs', '-j', dest='jobs',
                        default=('%d' % default_build_concurrency),
                        metavar='N', help='run build jobs in parallel')
-@@ -701,6 +704,13 @@
+@@ -701,6 +706,17 @@
    logging.info('Building GYP command line...')
    gyp_options = ['--depth=.', '--include=%s/gyp/common.gypi' % SRC_DIR]
  
@@ -28,6 +30,10 @@
 +
 +  ldflags = options.ldflags or ''
 +  gyp_options.extend(['-D', 'ldflags=%s' % ldflags])
++  cflags = options.cflags or ''
++  gyp_options.extend(['-D', 'cflags=%s' % cflags])
++  cflags_cc = options.cflags_cc or ''
++  gyp_options.extend(['-D', 'cflags_cc=%s' % cflags_cc])
 +  include_dirs = options.include_dirs or ''
 +  gyp_options.extend(['-D', 'include_dirs=%s' % include_dirs])
  

Modified: head/japanese/mozc-server/files/patch-gyp_common.gypi
==============================================================================
--- head/japanese/mozc-server/files/patch-gyp_common.gypi	Mon Oct  6 20:09:24 2014	(r370218)
+++ head/japanese/mozc-server/files/patch-gyp_common.gypi	Mon Oct  6 20:16:21 2014	(r370219)
@@ -1,6 +1,66 @@
 --- gyp/common.gypi.orig	2014-08-31 03:36:19.000000000 +0900
-+++ gyp/common.gypi	2014-08-31 03:46:27.000000000 +0900
-@@ -759,6 +759,8 @@
++++ gyp/common.gypi	2014-09-17 04:33:49.000000000 +0900
+@@ -171,9 +171,9 @@
+       ['target_platform=="Linux"', {
+         # enable_gtk_renderer represents if mozc_renderer is supported on Linux
+         # or not.
+-        'compiler_target': 'gcc',
++        'compiler_target': '<(compiler_target)',
+         'compiler_target_version_int': 406,  # GCC 4.6 or higher
+-        'compiler_host': 'gcc',
++        'compiler_host': '<(compiler_host)',
+         'compiler_host_version_int': 406,  # GCC 4.6 or higher
+         'enable_gtk_renderer%': 1,
+       }, {  # else
+@@ -631,17 +631,20 @@
+           ['compiler_target=="clang"', {
+             'cflags': [
+               '-Wtype-limits',
++	      '<@(cflags)',
+             ],
+             'cflags_cc': [
+               '-Wno-covered-switch-default',
+               '-Wno-unnamed-type-template-args',
+               '-Wno-c++11-narrowing',
+-              '-std=gnu++0x',
++              '-std=c++11',
++	      '<@(cflags_cc)',
+             ],
+           }],
+-          ['compiler_target=="clang" or compiler_target=="gcc"', {
++          ['compiler_host=="gcc"', {
+             'cflags_cc': [
+-              '-std=gnu++0x',
++              '-std=gnu++11',
++	      '<@(cflags_cc)',
+             ],
+           }],
+         ],
+@@ -651,17 +654,20 @@
+           ['compiler_host=="clang"', {
+             'cflags': [
+               '-Wtype-limits',
++	      '<@(cflags)',
+             ],
+             'cflags_cc': [
+               '-Wno-covered-switch-default',
+               '-Wno-unnamed-type-template-args',
+               '-Wno-c++11-narrowing',
+-              '-std=gnu++0x',
++              '-std=c++11',
++	      '<@(cflags_cc)',
+             ],
+           }],
+-          ['compiler_host=="clang" or compiler_host=="gcc"', {
++          ['compiler_host=="gcc"', {
+             'cflags_cc': [
+-              '-std=gnu++0x',
++              '-std=gnu++11',
++	      '<@(cflags_cc)',
+             ],
+           }],
+         ],
+@@ -759,16 +765,27 @@
        ['OS=="linux"', {
          'defines': [
            'OS_LINUX',
@@ -9,17 +69,22 @@
          ],
          'cflags': [
            '<@(warning_cflags)',
-@@ -770,6 +772,13 @@
+           '-fPIC',
+           '-fno-exceptions',
++	  '<@(cflags)',
+         ],
+         'cflags_cc': [
+           # We use deprecated <hash_map> and <hash_set> instead of upcoming
            # <unordered_map> and <unordered_set>.
            '-Wno-deprecated',
-         ],
++	  '<@(cflags_cc)',
++        ],
 +        'include_dirs': [
 +          '<@(include_dirs)'
 +        ],
 +        'ldflags': [
 +          '<@(ldflags)',
 +	  '-fstack-protector',
-+        ],
+         ],
          'conditions': [
            ['target_platform!="NaCl"', {
-             'cflags': [



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410062016.s96KGLDe084645>