From nobody@FreeBSD.org  Mon Jan 30 03:04:08 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1B9B61065680
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 30 Jan 2012 03:04:08 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 052B08FC1F
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 30 Jan 2012 03:04:08 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q0U347GC094934
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 30 Jan 2012 03:04:07 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q0U3476W094933;
	Mon, 30 Jan 2012 03:04:07 GMT
	(envelope-from nobody)
Message-Id: <201201300304.q0U3476W094933@red.freebsd.org>
Date: Mon, 30 Jan 2012 03:04:07 GMT
From: Paul Ambrose <ambrosehua@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [textproc/scim] building with clang failed
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         164618
>Category:       ports
>Synopsis:       [patch] textproc/scim: building with clang failed
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lx
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 30 03:10:11 UTC 2012
>Closed-Date:    Tue Oct 22 14:15:02 CEST 2013
>Last-Modified:  Tue Oct 22 12:20:00 UTC 2013
>Originator:     Paul Ambrose
>Release:        release-9 AMD64
>Organization:
Freecomm
>Environment:
FreeBSD capoor-daemon 9.0-RELEASE FreeBSD 9.0-RELEASE #1 r+0015927: Sun Jan 29 15:15:54 CST 2012     root@capoor-daemon:/usr/obj/usr/src/sys/MYKERNEL  amd64

>Description:
[textproc/scim] building with clang failed
>How-To-Repeat:
cd /usr/ports/textproc/scim;
make CXX=clang++ CC=clang
>Fix:
--- src/scim_helper_manager_server.cpp      2008-11-02 14:42:38.000000000 +0800
+++ src/scim_helper_manager_server.new.cpp  2012-01-30 10:42:53.000000000 +0800
@@ -95,9 +95,8 @@
     //      so I added a workaround: have an array of modules and unload them all together in the end only.
     //      TODO Need to figure out what's going on with this issue.

-    HelperModule module[mod_list.size ()];
-
     if (mod_list.size ()) {
+               HelperModule * module = new HelperModule[mod_list.size()];

         for (size_t i = 0; i < mod_list.size (); ++i) {

@@ -120,6 +119,8 @@
         for (size_t i = 0; i < mod_list.size (); ++i) {
             module[i].unload ();
         }
+
+               delete [] module;
     }
 }
--- gtkimcontextscim.cpp        2012-01-30 10:38:46.000000000 +0800
+++ gtkimcontextscim.new.cpp    2012-01-30 10:38:28.000000000 +0800
@@ -1710,7 +1710,7 @@
         // And set manual to false.
         if (!check_socket_frontend ()) {
             std::cerr << "Launching a SCIM daemon with Socket FrontEnd...\n";
-            char *new_argv [] = { stack_cast<char*> ("--no-stay"), 0 };
+            char *new_argv [] = { const_cast<char*> ("--no-stay"), 0 };
             scim_launch (true,
                          config_module_name,
                          (load_engine_list.size () ? scim_combine_string_list (load_engine_list, ',') : "all"),






>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->lx 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jan 30 03:10:22 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164618 
State-Changed-From-To: open->closed 
State-Changed-By: tijl 
State-Changed-When: Tue Oct 22 14:14:27 CEST 2013 
State-Changed-Why:  
Committed in r331255. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164618 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/164618: commit references a PR
Date: Tue, 22 Oct 2013 12:10:43 +0000 (UTC)

 Author: tijl
 Date: Tue Oct 22 12:10:35 2013
 New Revision: 331255
 URL: http://svnweb.freebsd.org/changeset/ports/331255
 
 Log:
   - Fix linker problem by removing libtool dependency.  The combination of
     USE_AUTOTOOLS, USE_GCC and C++ is broken because /usr/local/bin/libtool
     has hardcoded the linker it was built with.  So on FreeBSD 10 it tries
     to link gcc compiled C++ code with clang which does not work.
   - Remove USE_GCC and fix build with clang with two new patches. [1]
   - Fix build with libc++ by removing -lstdc++ from linker flags.  The
     compiler automatically adds the right runtime library.
   - Add LICENSE.
   - Convert gnomehack to pathfix.
   - Remove references to PTHREAD_LIBS and PTHREAD_CFLAGS.
   - Support staging.
   - Remove an old patch that's no longer needed.
   
   PR:		ports/164618 [1]
   Submitted by:	Paul Ambrose <ambrosehua@gmail.com> [1]
   Approved by:	maintainer timeout (2 weeks)
 
 Added:
   head/textproc/scim/files/patch-extras-gtk2_immodule-gtkimcontextscim.cpp   (contents, props changed)
   head/textproc/scim/files/patch-src-scim_helper_manager_server.cpp   (contents, props changed)
 Deleted:
   head/textproc/scim/files/patch-configure
 Modified:
   head/textproc/scim/Makefile
 Directory Properties:
   head/textproc/scim/distinfo   (props changed)
   head/textproc/scim/pkg-descr   (props changed)
   head/textproc/scim/pkg-message   (props changed)
   head/textproc/scim/pkg-plist   (props changed)
 
 Modified: head/textproc/scim/Makefile
 ==============================================================================
 --- head/textproc/scim/Makefile	Tue Oct 22 12:02:58 2013	(r331254)
 +++ head/textproc/scim/Makefile	Tue Oct 22 12:10:35 2013	(r331255)
 @@ -3,37 +3,29 @@
  
  PORTNAME=	scim
  PORTVERSION=	1.4.9
 -PORTREVISION=	1
 +PORTREVISION=	2
  CATEGORIES=	textproc
  MASTER_SITES=	SF
  
  MAINTAINER=	lx@FreeBSD.org
  COMMENT=	Smart Common Input Method platform
  
 -USE_GNOME=	gnomehack gnomehier gtk20 intlhack
 +LICENSE=	LGPL21
  
 -USE_AUTOTOOLS=	libtool
 -USE_GCC=	any
 +USE_GNOME=	gnomehier gtk20 intlhack
  USE_XORG=	x11 xpm
  USE_LDCONFIG=	yes
 -USES=		gettext gmake iconv pkgconfig
 +USES=		gettext gmake iconv pathfix pkgconfig
  GNU_CONFIGURE=	yes
 -CONFIGURE_ENV=	PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
 -		PTHREAD_LIBS="${PTHREAD_LIBS}"
 -
 -NO_STAGE=	yes
 -.include <bsd.port.pre.mk>
  
  CPPFLAGS+=	-I${LOCALBASE}/include -D__STDC_ISO_10646__
  LDFLAGS+=	-L${LOCALBASE}/lib -lintl ${ICONV_LIB}
  
  post-patch:
 -	${REINPLACE_CMD} -e '/^libscim@SCIM_EPOCH@_la_LDFLAGS/s|=|= ${PTHREAD_LIBS}|' \
 -		${WRKSRC}/src/Makefile.in
 -
 -post-install:
 -	@${LOCALBASE}/bin/gtk-query-immodules-2.0 > ${LOCALBASE}/etc/gtk-2.0/gtk.immodules
 -	@${CAT} ${PKGMESSAGE}
 -	@${ECHO} To display this message again, type ${PKG_INFO} -D ${PKGNAME}
 +	@${REINPLACE_CMD} 's/-lstdc++//'				\
 +		${WRKSRC}/extras/gtk2_immodule/Makefile.in		\
 +		${WRKSRC}/extras/setup/Makefile.in			\
 +		${WRKSRC}/src/Makefile.in				\
 +		${WRKSRC}/tests/Makefile.in
  
 -.include <bsd.port.post.mk>
 +.include <bsd.port.mk>
 
 Added: head/textproc/scim/files/patch-extras-gtk2_immodule-gtkimcontextscim.cpp
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/textproc/scim/files/patch-extras-gtk2_immodule-gtkimcontextscim.cpp	Tue Oct 22 12:10:35 2013	(r331255)
 @@ -0,0 +1,11 @@
 +--- extras/gtk2_immodule/gtkimcontextscim.cpp.orig	2008-11-02 07:43:15.000000000 +0100
 ++++ extras/gtk2_immodule/gtkimcontextscim.cpp	2013-10-08 18:16:29.000000000 +0200
 +@@ -1710,7 +1710,7 @@
 +         // And set manual to false.
 +         if (!check_socket_frontend ()) {
 +             std::cerr << "Launching a SCIM daemon with Socket FrontEnd...\n";
 +-            char *new_argv [] = { static_cast<char*> ("--no-stay"), 0 };
 ++            char *new_argv [] = { const_cast<char*> ("--no-stay"), 0 };
 +             scim_launch (true,
 +                          config_module_name,
 +                          (load_engine_list.size () ? scim_combine_string_list (load_engine_list, ',') : "all"),
 
 Added: head/textproc/scim/files/patch-src-scim_helper_manager_server.cpp
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/textproc/scim/files/patch-src-scim_helper_manager_server.cpp	Tue Oct 22 12:10:35 2013	(r331255)
 @@ -0,0 +1,21 @@
 +--- src/scim_helper_manager_server.cpp.orig	2008-11-02 07:42:38.000000000 +0100
 ++++ src/scim_helper_manager_server.cpp	2013-10-08 17:37:59.000000000 +0200
 +@@ -95,9 +95,8 @@
 +     //      so I added a workaround: have an array of modules and unload them all together in the end only.
 +     //      TODO Need to figure out what's going on with this issue.
 + 
 +-    HelperModule module[mod_list.size ()];
 +-
 +     if (mod_list.size ()) {
 ++        HelperModule *module = new HelperModule[mod_list.size ()];
 + 
 +         for (size_t i = 0; i < mod_list.size (); ++i) {
 + 
 +@@ -120,6 +119,7 @@
 +         for (size_t i = 0; i < mod_list.size (); ++i) {
 +             module[i].unload ();
 +         }
 ++        delete[] module;
 +     }
 + }
 + 
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
