aboutsummaryrefslogtreecommitdiffstats
path: root/cad/jspice3
diff options
context:
space:
mode:
authormarino <marino@FreeBSD.org>2014-08-18 16:32:20 +0800
committermarino <marino@FreeBSD.org>2014-08-18 16:32:20 +0800
commitd3a890495b9cec31910bf8bac1b59a1c8eb311dc (patch)
tree40299639c928db203ba40b5570b64485b00f9bbe /cad/jspice3
parent78f681728305c3b0c91c4cc3b597ee2ac4a9c89a (diff)
downloadfreebsd-ports-gnome-d3a890495b9cec31910bf8bac1b59a1c8eb311dc.tar.gz
freebsd-ports-gnome-d3a890495b9cec31910bf8bac1b59a1c8eb311dc.tar.zst
freebsd-ports-gnome-d3a890495b9cec31910bf8bac1b59a1c8eb311dc.zip
Stage cad/jspice3 and unbreak on FreeBSD 10+
It would have been easy just to set this to "USE_GCC=any" to fix it, but the code had plenty of undefined returns when a type was expected. Using clang exposed those problems. Hopefully I defined the missing return values correctly.
Diffstat (limited to 'cad/jspice3')
-rw-r--r--cad/jspice3/Makefile40
-rw-r--r--cad/jspice3/files/patch-conf_util_configure15
-rw-r--r--cad/jspice3/files/patch-src_bin_help.c11
-rw-r--r--cad/jspice3/files/patch-src_bin_spiced.c27
-rw-r--r--cad/jspice3/files/patch-src_lib_ckt_cktdelt.c11
-rw-r--r--cad/jspice3/files/patch-src_lib_fte_options.c45
-rw-r--r--cad/jspice3/files/patch-src_lib_inp_ifeval.c11
-rw-r--r--cad/jspice3/files/patch-src_lib_mfb_mfbgnc.c29
-rw-r--r--cad/jspice3/files/patch-src_lib_plot_postsc.c26
-rw-r--r--cad/jspice3/files/patch-src_lib_sced_labeltxt.c20
-rw-r--r--cad/jspice3/files/patch-src_lib_sced_scedintr.c11
11 files changed, 232 insertions, 14 deletions
diff --git a/cad/jspice3/Makefile b/cad/jspice3/Makefile
index 9c88e576564a..65ce624b2212 100644
--- a/cad/jspice3/Makefile
+++ b/cad/jspice3/Makefile
@@ -3,10 +3,9 @@
PORTNAME= jspice3
PORTVERSION= 2.5.011109
-PORTREVISION= 0
+PORTREVISION= 1
CATEGORIES= cad
-MASTER_SITES= http://www.wrcad.com/ftp/pub/ \
- ftp://ftp.srware.com/pub/
+MASTER_SITES= http://www.wrcad.com/ftp/pub/
DISTNAME= ${PORTNAME}-2.5-011109
MAINTAINER= ports@FreeBSD.org
@@ -18,7 +17,6 @@ OPTIONS_DEFINE= X11 EXAMPLES
OPTIONS_DEFAULT= X11
WRKSRC= ${WRKDIR}/${PORTNAME}-2.5
-NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MX11}
@@ -26,27 +24,41 @@ USE_XORG= x11 xaw xt
.endif
pre-configure:
- @${REINPLACE_CMD} -e 's+/usr/local+${PREFIX}+g ; \
- s+-O -g+${CFLAGS}+g;' \
+ @${REINPLACE_CMD} -e 's+/usr/local+${PREFIX}+g;s+-O -g+${CFLAGS}+g;' \
${WRKSRC}/conf/unixconf/mkheader.0
.if ${PORT_OPTIONS:MX11}
- @${REINPLACE_CMD} -e 's+#%%WITH_X%%++g' \
+ @${REINPLACE_CMD} -e 's+#%%WITH_X%%++g' \
${WRKSRC}/conf/unixconf/mkheader.0
.else
@${ECHO} "#undef HAVE_X11" >> ${WRKSRC}/src/include/spice.h
.endif
do-build:
- @(cd ${WRKSRC};${SETENV} ${MAKE_ENV} ${SH} build)
+ (cd ${WRKSRC};${SETENV} ${MAKE_ENV} ${SH} build)
do-install:
- @(cd ${WRKSRC}/src/bin;${SETENV} ${MAKE_ENV} ${MAKE} install)
-
-post-install:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/lib/jspice3/helpdir \
+ ${STAGEDIR}${PREFIX}/lib/jspice3/sced \
+ ${STAGEDIR}${PREFIX}/lib/jspice3/scripts
+ (cd ${WRKSRC}/src/bin && ${INSTALL_PROGRAM} jspice3 nutmeg help \
+ multidec proc2mod spiced xeditor ${STAGEDIR}${PREFIX}/bin)
+ ${INSTALL_DATA} ${WRKSRC}/lib/mfbcap ${WRKSRC}/lib/news \
+ ${STAGEDIR}${PREFIX}/lib/jspice3
+ ${INSTALL_DATA} ${WRKSRC}/lib/helpdir/* \
+ ${STAGEDIR}${PREFIX}/lib/jspice3/helpdir
+ ${INSTALL_DATA} ${WRKSRC}//lib/sced/* \
+ ${STAGEDIR}${PREFIX}/lib/jspice3/sced
+ ${INSTALL_DATA} ${WRKSRC}/lib/scripts/* \
+ ${STAGEDIR}${PREFIX}/lib/jspice3/scripts
.if ${PORT_OPTIONS:MEXAMPLES}
- ${MV} ${PREFIX}/lib/jspice3/examples ${EXAMPLESDIR}
-.else
- ${RM} -R ${PREFIX}/lib/jspice3/examples
+ ${MKDIR} ${STAGEDIR}${PREFIX}/share/examples/jspice3/cryocmos \
+ ${STAGEDIR}${PREFIX}/share/examples/jspice3/josephson
+ ${INSTALL_DATA} ${WRKSRC}/examples/*.* \
+ ${STAGEDIR}${PREFIX}/share/examples/jspice3
+ ${INSTALL_DATA} ${WRKSRC}/examples/cryocmos/* \
+ ${STAGEDIR}${PREFIX}/share/examples/jspice3/cryocmos
+ ${INSTALL_DATA} ${WRKSRC}/examples/josephson/* \
+ ${STAGEDIR}${PREFIX}/share/examples/jspice3/josephson
.endif
.include <bsd.port.mk>
diff --git a/cad/jspice3/files/patch-conf_util_configure b/cad/jspice3/files/patch-conf_util_configure
new file mode 100644
index 000000000000..1b2966585d99
--- /dev/null
+++ b/cad/jspice3/files/patch-conf_util_configure
@@ -0,0 +1,15 @@
+--- conf/util/configure.orig 2002-01-15 19:21:25.000000000 +0000
++++ conf/util/configure
+@@ -805,11 +805,7 @@ else
+ fi
+
+
+-if test "$GCC" = yes; then
+- DEPEND_PROG="gcc -MM"
+-else
+- DEPEND_PROG="cc -M"
+-fi
++DEPEND_PROG="cc -MM"
+
+ if test -x /usr/ucb/install; then
+ INSTALL="/usr/ucb/install"
diff --git a/cad/jspice3/files/patch-src_bin_help.c b/cad/jspice3/files/patch-src_bin_help.c
new file mode 100644
index 000000000000..d9c60623d818
--- /dev/null
+++ b/cad/jspice3/files/patch-src_bin_help.c
@@ -0,0 +1,11 @@
+--- src/bin/help.c.intermediate 2014-08-18 06:30:22.000000000 +0000
++++ src/bin/help.c
+@@ -53,7 +53,7 @@ XErrorEvent *errorev;
+
+ XGetErrorText(display, errorev->error_code, ErrorMessage, 1024);
+ printf(ErrorMessage);
+- return;
++ return (NULL);
+ }
+
+
diff --git a/cad/jspice3/files/patch-src_bin_spiced.c b/cad/jspice3/files/patch-src_bin_spiced.c
new file mode 100644
index 000000000000..4b9eb6a5e261
--- /dev/null
+++ b/cad/jspice3/files/patch-src_bin_spiced.c
@@ -0,0 +1,27 @@
+--- src/bin/spiced.c.orig 2001-05-01 21:56:08.000000000 +0000
++++ src/bin/spiced.c
+@@ -16,12 +16,11 @@ Author: 1985 Wayne A. Christopher, U. C.
+
+ #include "spice.h"
+ #include <stdio.h>
+-#ifdef HAVE_STRINGS_H
+-#include <strings.h>
+-#else
+ #include <string.h>
+-#endif
+ #include <errno.h>
++#include <unistd.h>
++#include <stdlib.h>
++#include <ctype.h>
+ #include <sys/types.h>
+
+ #ifdef HAVE_SOCKET
+@@ -293,7 +292,7 @@ sigchild()
+ (void) fclose(fp);
+ } else
+ nrunning--;
+- return;
++ return 0;
+ }
+
+ #else /* not HAVE_SOCKET */
diff --git a/cad/jspice3/files/patch-src_lib_ckt_cktdelt.c b/cad/jspice3/files/patch-src_lib_ckt_cktdelt.c
new file mode 100644
index 000000000000..85fe9b848126
--- /dev/null
+++ b/cad/jspice3/files/patch-src_lib_ckt_cktdelt.c
@@ -0,0 +1,11 @@
+--- src/lib/ckt/cktdelt.c.orig 1997-03-21 22:04:30.000000000 +0000
++++ src/lib/ckt/cktdelt.c
+@@ -20,7 +20,7 @@ GENERIC *task;
+ {
+ JOB *job, *next;
+
+- if (task == NULL) return;
++ if (task == NULL) return (OK);
+
+ for (job = ((TSKtask*)task)->jobs; job; job = next) {
+ next = job->JOBnextJob;
diff --git a/cad/jspice3/files/patch-src_lib_fte_options.c b/cad/jspice3/files/patch-src_lib_fte_options.c
new file mode 100644
index 000000000000..0c4be5b2f785
--- /dev/null
+++ b/cad/jspice3/files/patch-src_lib_fte_options.c
@@ -0,0 +1,45 @@
+--- src/lib/fte/options.c.orig 2009-01-11 20:27:11.000000000 +0000
++++ src/lib/fte/options.c
+@@ -66,7 +66,7 @@ def_fn(_iv_cpdebug)
+
+ def_fn(_iv_history)
+ {
+- if (!flag) return;
++ if (!flag) return (US_OK);
+ if (v->va_type == VT_NUM)
+ cp_maxhistlength = v->va_num;
+ else if (v->va_type == VT_REAL)
+@@ -930,27 +930,27 @@ struct variable **v1, **v2;
+ v = va_copy(plot_cur->pl_env);
+ else
+ v = NULL;
+- if (tv = cp_enqvar(kw_plots)) {
++ if ((tv = cp_enqvar(kw_plots))) {
+ tv->va_next = v;
+ v = tv;
+ }
+- if (tv = cp_enqvar(kw_curplot)) {
++ if ((tv = cp_enqvar(kw_curplot))) {
+ tv->va_next = v;
+ v = tv;
+ }
+- if (tv = cp_enqvar(kw_curplottitle)) {
++ if ((tv = cp_enqvar(kw_curplottitle))) {
+ tv->va_next = v;
+ v = tv;
+ }
+- if (tv = cp_enqvar(kw_curplotname)) {
++ if ((tv = cp_enqvar(kw_curplotname))) {
+ tv->va_next = v;
+ v = tv;
+ }
+- if (tv = cp_enqvar(kw_curplotdate)) {
++ if ((tv = cp_enqvar(kw_curplotdate))) {
+ tv->va_next = v;
+ v = tv;
+ }
+- if (tv = cp_enqvar(kw_display)) {
++ if ((tv = cp_enqvar(kw_display))) {
+ tv->va_next = v;
+ v = tv;
+ }
diff --git a/cad/jspice3/files/patch-src_lib_inp_ifeval.c b/cad/jspice3/files/patch-src_lib_inp_ifeval.c
new file mode 100644
index 000000000000..49a2625bac72
--- /dev/null
+++ b/cad/jspice3/files/patch-src_lib_inp_ifeval.c
@@ -0,0 +1,11 @@
+--- src/lib/inp/ifeval.c.orig 1997-03-21 22:04:12.000000000 +0000
++++ src/lib/inp/ifeval.c
+@@ -37,7 +37,7 @@ double step, finaltime;
+ int i;
+
+ if (!tree)
+- return;
++ return (OK);
+ for (i = 0; i < tree->numVars; i++)
+ init_node(pt->derivs[i],step,finaltime);
+ init_node(pt->tree,step,finaltime);
diff --git a/cad/jspice3/files/patch-src_lib_mfb_mfbgnc.c b/cad/jspice3/files/patch-src_lib_mfb_mfbgnc.c
new file mode 100644
index 000000000000..0684c7f09ad8
--- /dev/null
+++ b/cad/jspice3/files/patch-src_lib_mfb_mfbgnc.c
@@ -0,0 +1,29 @@
+--- src/lib/mfb/mfbgnc.c.orig 2001-05-01 19:45:26.000000000 +0000
++++ src/lib/mfb/mfbgnc.c
+@@ -120,7 +120,7 @@ char *PM;
+ cp = PM;
+ dp = result;
+ if (cp == NULL) {
+- return;
++ return (NULL);
+ }
+ while (c = *cp++) {
+ if(c == '$') {
+@@ -300,7 +300,7 @@ char *PM;
+ y1 = reg;
+ }
+ else
+- return;
++ return (NULL);
+ hiy = (y1 >> 7) & 037;
+ extra = x1 & 03 | ((y1 & 03) << 2);
+ loy = (y1 >> 2) & 037;
+@@ -427,7 +427,7 @@ char *PM;
+ continue;
+
+ default:
+- return;
++ return (NULL);
+ }
+ }
+ *dp='\0';
diff --git a/cad/jspice3/files/patch-src_lib_plot_postsc.c b/cad/jspice3/files/patch-src_lib_plot_postsc.c
new file mode 100644
index 000000000000..c9d5cad54c66
--- /dev/null
+++ b/cad/jspice3/files/patch-src_lib_plot_postsc.c
@@ -0,0 +1,26 @@
+--- src/lib/plot/postsc.c.orig 1997-03-21 22:03:37.000000000 +0000
++++ src/lib/plot/postsc.c
+@@ -343,12 +343,12 @@ int linestyleid;
+ get it when PS_Text restores a -1 linestyle */
+ if (linestyleid == -1) {
+ currentgraph->linestyle = -1;
+- return;
++ return (0);
+ }
+
+ if (linestyleid < 0) {
+ internalerror("bad linestyleid");
+- return;
++ return (0);
+ }
+
+ if (linestyleid > dispdev->numlinestyles)
+@@ -407,7 +407,7 @@ int x, y, Xform;
+
+ if (Xform == (char)0) {
+ PS_Text(text,x,y);
+- return;
++ return (0);
+ }
+
+ s = tbuf;
diff --git a/cad/jspice3/files/patch-src_lib_sced_labeltxt.c b/cad/jspice3/files/patch-src_lib_sced_labeltxt.c
new file mode 100644
index 000000000000..a16d7289896e
--- /dev/null
+++ b/cad/jspice3/files/patch-src_lib_sced_labeltxt.c
@@ -0,0 +1,20 @@
+--- src/lib/sced/labeltxt.c.orig 1997-03-21 22:04:16.000000000 +0000
++++ src/lib/sced/labeltxt.c
+@@ -175,7 +175,7 @@ int x, y, degrees, scale;
+ if (!strcmp(dispdev->name,"wp")) {
+ /* use plain text for now */
+ DevText(text,x,y);
+- return;
++ return (0);
+ }
+
+ /* Hack! If degrees is >= 90, an angle is assumed.
+@@ -185,7 +185,7 @@ int x, y, degrees, scale;
+
+ if (!strcmp(dispdev->name,"postscript")) {
+ PS_ScaledText(text,x,y,degrees);
+- return;
++ return (0);
+ }
+
+ if (degrees & 1) {
diff --git a/cad/jspice3/files/patch-src_lib_sced_scedintr.c b/cad/jspice3/files/patch-src_lib_sced_scedintr.c
new file mode 100644
index 000000000000..7c7ef1124d9b
--- /dev/null
+++ b/cad/jspice3/files/patch-src_lib_sced_scedintr.c
@@ -0,0 +1,11 @@
+--- src/lib/sced/scedintr.c.orig 2001-05-01 20:54:05.000000000 +0000
++++ src/lib/sced/scedintr.c
+@@ -1009,7 +1009,7 @@ char *string;
+ strcat(TypeOut,string);
+ else
+ strcat(TypeOut,"\n");
+- if (strchr(TypeOut,'\n') == NULL) return;
++ if (strchr(TypeOut,'\n') == NULL) return (False);
+ if (MoreLine(TypeOut))
+ EnableMore(False);
+ *TypeOut = '\0';