Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Oct 2012 02:55:52 +0900
From:      KATO Tsuguru <tkato432@yahoo.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/172724: cad/gnucap: Fix build with clang
Message-ID:  <20121016025552.377c79255c702cf718e77d10@yahoo.com>
Resent-Message-ID: <201210151810.q9FIA2PY043622@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         172724
>Category:       ports
>Synopsis:       cad/gnucap: Fix build with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 15 18:10:02 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     KATO Tsuguru
>Release:        FreeBSD 7.4-RELEASE-p10 i386
>Organization:
>Environment:
>Description:
- Fix build with clang
- Support USE_READLINE

New file:
files/patch-modelgen__mg_.h

>How-To-Repeat:
>Fix:

diff -urN /usr/ports/cad/gnucap/Makefile cad/gnucap/Makefile
--- /usr/ports/cad/gnucap/Makefile	2012-10-10 07:12:13.000000000 +0900
+++ cad/gnucap/Makefile	2012-10-15 15:00:34.000000000 +0900
@@ -1,10 +1,5 @@
-# ex:ts=8
-# Ports collection makefile for:	gnucap
-# Date created:			Feb 7, 2002
-# Whom:				ijliao
-#
+# Created by: ijliao
 # $FreeBSD: ports/cad/gnucap/Makefile,v 1.29 2012/10/09 22:12:13 linimon Exp $
-#
 
 PORTNAME=	gnucap
 PORTVERSION=	2009.12.07
@@ -17,9 +12,11 @@
 COMMENT=	The GNU Circuit Analysis Package
 
 LICENSE=	GPLv3
-LICENSE_FILE=	${WRKSRC}/COPYING
 
-USE_GCC=	any
+OPTIONS_DEFINE=	READLINE DOCS EXAMPLES
+OPTIONS_DEFAULT=READLINE
+READLINE_DESC=	Enable readline support
+
 USE_GMAKE=	yes
 GNU_CONFIGURE=	yes
 MAKE_JOBS_SAFE=	yes
@@ -29,20 +26,33 @@
 PORTEXAMPLES=	*
 PLIST_FILES=	bin/gnucap bin/gnucap-modelgen
 
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MREADLINE}
+USE_READLINE=	yes
+.else
+CONFIGURE_ARGS+=--with-readline=no
+.endif
+
 post-patch:
-	${REINPLACE_CMD} -e \
+	@${REINPLACE_CMD} -e \
 		'/^SUBDIRS/s|doc examples||' ${WRKSRC}/Makefile.in
+.for i in src/ap_match.cc modelgen/ap_match.cc
+	@${REINPLACE_CMD} -e \
+		"s:strchr(str2, '|'):const_cast<char*>(strchr(str2, '|')):" \
+		${WRKSRC}/${i}
+.endfor
 
 post-install:
 	${INSTALL_MAN} ${WRKSRC}/doc/*.1 ${MANPREFIX}/man/man1
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/doc/acs-tutorial ${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/doc/history ${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/doc/relnotes.* ${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/doc/whatisit ${DOCSDIR}
 .endif
-.if !defined(NOPORTEXAMPLES)
+.if ${PORT_OPTIONS:MEXAMPLES}
 	@${MKDIR} ${EXAMPLESDIR}
 	${INSTALL_DATA} ${WRKSRC}/examples/README ${EXAMPLESDIR}
 	${INSTALL_DATA} ${WRKSRC}/examples/runall ${EXAMPLESDIR}
diff -urN /usr/ports/cad/gnucap/files/patch-modelgen__mg_.h cad/gnucap/files/patch-modelgen__mg_.h
--- /usr/ports/cad/gnucap/files/patch-modelgen__mg_.h	1970-01-01 09:00:00.000000000 +0900
+++ cad/gnucap/files/patch-modelgen__mg_.h	2012-10-14 00:54:52.000000000 +0900
@@ -0,0 +1,44 @@
+--- modelgen/mg_.h.orig	2009-12-08 08:19:15.000000000 +0900
++++ modelgen/mg_.h	2012-10-14 00:54:09.000000000 +0900
+@@ -108,6 +108,20 @@
+   size_t	 size()const	 {return _list.size();}
+ };
+ /*--------------------------------------------------------------------------*/
++class C_Comment
++  :public Base
++{
++public:
++  void parse(CS& f);
++};
++/*--------------------------------------------------------------------------*/
++class Cxx_Comment
++  :public Base
++{
++public:
++  void parse(CS& f);
++};
++/*--------------------------------------------------------------------------*/
+ /* A "Collection" differs from a "List" in how it is parsed.
+  * Each parse of a "Collection" created one more object and stores
+  * it in the Collection.  The size of the Collection therefore grows by 1.
+@@ -200,20 +214,6 @@
+   }
+ };
+ /*--------------------------------------------------------------------------*/
+-class C_Comment
+-  :public Base
+-{
+-public:
+-  void parse(CS& f);
+-};
+-/*--------------------------------------------------------------------------*/
+-class Cxx_Comment
+-  :public Base
+-{
+-public:
+-  void parse(CS& f);
+-};
+-/*--------------------------------------------------------------------------*/
+ class Key
+   :public Base
+ {
diff -urN /usr/ports/cad/gnucap/pkg-descr cad/gnucap/pkg-descr
--- /usr/ports/cad/gnucap/pkg-descr	2008-06-19 05:15:20.000000000 +0900
+++ cad/gnucap/pkg-descr	2012-10-15 15:06:42.000000000 +0900
@@ -1,22 +1,22 @@
 GnuCap is the GNU Circuit Analysis Package.
 
-The primary component is a general purpose circuit simulator. It performs
-nonlinear dc and transient analyses, fourier analysis, and ac analysis. It is
-fully interactive and command driven. It can also be run in batch mode or as a
-server. Spice compatible models for the MOSFET (level 1-7) and diode are
-included in this release.
+The primary component is a general purpose circuit simulator. It
+performs nonlinear dc and transient analyses, fourier analysis, and ac
+analysis. It is fully interactive and command driven. It can also be
+run in batch mode or as a server. Spice compatible models for the
+MOSFET (level 1-7) and diode are included in this release.
 
-GnuCap is not based on Spice, but some of the models have been derived from
-the Berkeley models.
+GnuCap is not based on Spice, but some of the models have been derived
+from the Berkeley models.
 
-Unlike Spice, the engine is designed to do true mixed-mode simulation. Most
-of the code is in place for future support of event driven analog simulation,
-and true multi-rate simulation.
+Unlike Spice, the engine is designed to do true mixed-mode simulation.
+Most of the code is in place for future support of event driven analog
+simulation, and true multi-rate simulation.
 
-If you are tired of Spice and want a second opinion, you want to play with the
-circuit and want a simulator that is interactive, you want to study the source
-code and want something easier to follow than Spice, or you are a researcher
-working on modeling and want automated model generation tools to make your job
-easier, try GnuCap.
+If you are tired of Spice and want a second opinion, you want to play
+with the circuit and want a simulator that is interactive, you want to
+study the source code and want something easier to follow than Spice,
+or you are a researcher working on modeling and want automated model
+generation tools to make your job easier, try GnuCap.
 
 WWW: http://www.gnucap.org/
>Release-Note:
>Audit-Trail:
>Unformatted:



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