aboutsummaryrefslogtreecommitdiffstats
path: root/cad/spice
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2013-05-01 04:30:22 +0800
committerhrs <hrs@FreeBSD.org>2013-05-01 04:30:22 +0800
commit777cc3234a1818d3acab10df9dd46a2655636463 (patch)
treebd871439f3f6a45b297ffdb0e81172bb64536e27 /cad/spice
parent4c1d50c650556222641948d2d03c12df55c0a165 (diff)
downloadfreebsd-ports-gnome-777cc3234a1818d3acab10df9dd46a2655636463.tar.gz
freebsd-ports-gnome-777cc3234a1818d3acab10df9dd46a2655636463.tar.zst
freebsd-ports-gnome-777cc3234a1818d3acab10df9dd46a2655636463.zip
- Fix SIGSEGV when there are spaces after a comma like ".PRINT TRAN v(2, 1)".
- Style clean-ups. PR: ports/157313 Spotted by: Makoto Kishimoto
Diffstat (limited to 'cad/spice')
-rw-r--r--cad/spice/Makefile37
-rw-r--r--cad/spice/files/patch-src_lib_cp_lexical.c11
-rw-r--r--cad/spice/files/patch-src_lib_fte_dotcards.c31
-rw-r--r--cad/spice/files/patch-src_lib_misc_string.c19
4 files changed, 80 insertions, 18 deletions
diff --git a/cad/spice/Makefile b/cad/spice/Makefile
index 594721aaa885..98359deb69fd 100644
--- a/cad/spice/Makefile
+++ b/cad/spice/Makefile
@@ -1,44 +1,45 @@
-# New ports collection makefile for: spice
-# Date created: 26 Mar 96
-# Whom: Julian Jenkins <kaveman@magna.com.au>
-#
+# Created by: Julian Jenkins <kaveman@magna.com.au>
# $FreeBSD$
-#
PORTNAME= spice
PORTVERSION= 3f5.2
-PORTREVISION= 7
+PORTREVISION= 8
CATEGORIES= cad
MASTER_SITES= http://embedded.eecs.berkeley.edu/pubs/downloads/spice/:sources
+PKGNAMESUFFIX= ${NOX11SUFX}
DISTFILES= spice3f5${EXTRACT_SUFX}:sources \
cp.ps toc.ps doc.ps
DIST_SUBDIR= spice
EXTRACT_ONLY= spice3f5${EXTRACT_SUFX}
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= hrs@FreeBSD.org
COMMENT= A general-purpose circuit simulation program
LICENSE= BSD
WRKSRC= ${WRKDIR}/${PORTNAME}3f5
+MAKEFILE= ${FILESDIR}/Makefile
+MAKE_ENV+= STRIP_CMD=${STRIP_CMD}
+MAKE_JOBS_UNSAFE= yes
MAN1= sconvert.1 nutmeg.1 spice.1
MAN3= mfb.3
MAN5= mfbcap.5
MLINKS= spice.1 spice3.1
-MAKEFILE= ${FILESDIR}/Makefile
-MAKE_ENV+= STRIP_CMD=${STRIP_CMD}
-MAKE_JOBS_UNSAFE= yes
-.ifdef WITHOUT_X11
-PKGNAMESUFFIX= -without-x11
+OPTIONS_DEFINE= DOCS X11
+OPTIONS_DEFAULT=DOCS X11
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MX11}
+USE_XORG= x11 xaw xext xmu xt
+NOX11SUFX=
+.else
+NOX11SUFX= -nox11
COMMENT= A general-purpose circuit simulation program (non-X11 version)
MAKE_ARGS+= -DWITHOUT_X11
-.else
-USE_XORG= x11 xaw xext xmu xt
.endif
-.include <bsd.port.pre.mk>
-
post-patch:
@${REINPLACE_CMD} -e 's|/usr/ucb|${LOCALBASE}/bin|' ${WRKSRC}/util/build
@@ -50,7 +51,7 @@ do-configure:
${WRKSRC}/conf/FreeBSD ${WRKSRC}/conf/FreeBSD.without_x11
post-install:
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${DOCSDIR}
${CAT} ${DISTDIR}/${DIST_SUBDIR}/*.ps > ${DOCSDIR}/spice3f3.ps
${GZIP_CMD} ${DOCSDIR}/*.ps
@@ -58,4 +59,4 @@ post-install:
${MKDIR} ${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/examples/*.cir ${EXAMPLESDIR}
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/cad/spice/files/patch-src_lib_cp_lexical.c b/cad/spice/files/patch-src_lib_cp_lexical.c
new file mode 100644
index 000000000000..371656745430
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_cp_lexical.c
@@ -0,0 +1,11 @@
+--- src/lib/cp/lexical.c.orig 2013-05-01 05:15:32.000000000 +0900
++++ src/lib/cp/lexical.c 2013-05-01 05:16:36.000000000 +0900
+@@ -145,7 +145,7 @@
+ switch (c) {
+ case ' ':
+ case '\t':
+- if (i > 0) {
++ if (paren < 1 && i > 0) {
+ newword;
+ }
+ break;
diff --git a/cad/spice/files/patch-src_lib_fte_dotcards.c b/cad/spice/files/patch-src_lib_fte_dotcards.c
new file mode 100644
index 000000000000..47103c282e89
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_dotcards.c
@@ -0,0 +1,31 @@
+--- src/lib/fte/dotcards.c.orig 1993-07-30 13:44:28.000000000 +0900
++++ src/lib/fte/dotcards.c 2013-05-01 05:07:55.000000000 +0900
+@@ -405,11 +405,17 @@
+ char *string;
+ {
+ char buf[BSIZE_SP], *s, *t, *ss = string;
++ char *e;
+
++ e = string + strlen(string);
+ if (ciprefix("v(", string) && index(string, ',')) {
+ for (s = string; *s && (*s != ','); s++)
+ ;
+ *s++ = '\0';
++ while (s + 1 < e && isspace(*(s + 1))) {
++ *(s + 1) = '\0';
++ s++;
++ }
+ for (t = s; *t && (*t != ')'); t++)
+ ;
+ *t = '\0';
+@@ -589,6 +595,10 @@
+
+ if (c)
+ *c = 0;
++ while (c + 1 < r && isspace(*(c + 1))) {
++ c++;
++ *c = '\0';
++ }
+
+ wl = alloc(struct wordlist);
+
diff --git a/cad/spice/files/patch-src_lib_misc_string.c b/cad/spice/files/patch-src_lib_misc_string.c
new file mode 100644
index 000000000000..b378159bc3ce
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_misc_string.c
@@ -0,0 +1,19 @@
+--- src/lib/misc/string.c.orig 2013-05-01 03:50:59.000000000 +0900
++++ src/lib/misc/string.c 2013-05-01 03:58:30.000000000 +0900
+@@ -148,13 +148,15 @@
+ (*s)++;
+ if (!**s)
+ return (NULL);
+- while ((c = **s) && !isspace(c)) {
++ while ((c = **s)) {
+ if (c == '('/*)*/)
+ paren += 1;
+ else if (c == /*(*/')')
+ paren -= 1;
+ else if (c == ',' && paren < 1)
+ break;
++ else if (isspace(c) && paren < 1)
++ break;
+ buf[i++] = *(*s)++;
+ }
+ buf[i] = '\0';