Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Mar 2012 05:51:33 GMT
From:      Rob Farmer <rfarmer@predatorlabs.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/166235: [maintainer] [patch] math/scilab: Fix build
Message-ID:  <201203190551.q2J5pXlv039029@red.freebsd.org>
Resent-Message-ID: <201203190600.q2J60Wt6013919@freefall.freebsd.org>

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

>Number:         166235
>Category:       ports
>Synopsis:       [maintainer] [patch] math/scilab: Fix build
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 19 06:00:31 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Rob Farmer
>Release:        9.0-STABLE
>Organization:
>Environment:
FreeBSD xeon.predatorlabs.net 9.0-STABLE FreeBSD 9.0-STABLE #0 r232480: Sat Mar  3 23:33:06 PST 2012     rfarmer@xeon.predatorlabs.net:/usr/obj/usr/src/sys/XEON  amd64

>Description:
-Fix segfaults during build w/ OpenJDK
-Fix allowed versions of HDF

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/math/scilab/Makefile,v
retrieving revision 1.87
diff -u -r1.87 Makefile
--- Makefile	18 Feb 2012 21:14:26 -0000	1.87
+++ Makefile	19 Mar 2012 03:23:08 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	scilab
 PORTVERSION=	5.3.3
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	math cad parallel java
 MASTER_SITES=	http://www.scilab.org/download/${PORTVERSION}/:scilab \
 		http://www.predatorlabs.net/dl/:jgraphx \
@@ -50,10 +50,6 @@
 
 .include <bsd.port.options.mk>
 
-.if ${OSVERSION} < 900000 && ${ARCH} == "amd64"
-BROKEN=		segfaults during build
-.endif
-
 .if defined(WITH_ATLAS)
 LIB_DEPENDS+=	atlas.2:${PORTSDIR}/math/atlas
 BLAS_LIBS=	-lf77blas
@@ -140,7 +136,8 @@
 
 CONFIGURE_ARGS+=	--with-jdk=${JAVA_HOME} \
 			--with-docbook=${LOCALBASE}/share/xsl/docbook \
-			--enable-build-help
+			--enable-build-help \
+			--enable-build-swig
 PLIST_SUB+=		WITHOUT_GUI="@comment "
 .endif
 
@@ -201,6 +198,7 @@
 	@${REINPLACE_CMD} -e 's|TCLTK_LIBS=" -ldl"|TCLTK_LIBS=" "|' ${WRKSRC}/configure
 	@${REINPLACE_CMD} -e 's|"x=" ==|"x" =|g' ${WRKSRC}/configure
 	@${REINPLACE_CMD} -e 's|"x" ==|"x" =|g' ${WRKSRC}/configure
+	@${REINPLACE_CMD} -e 's|sparc64-\*-netbsd\*|amd64-\*-freebsd\*|' ${WRKSRC}/configure
 	@# Build fixes
 	@${REINPLACE_CMD} -e 's|$$(CFLAGS:-O%=)|-I${LOCALBASE}/include -L${LOCALBASE}/lib|' ${WRKSRC}/modules/elementary_functions/Makefile.in
 	@${REINPLACE_CMD} -e 's|freebsd|__FreeBSD__|g' ${WRKSRC}/modules/sparse/includes/spConfig.h
@@ -234,6 +232,10 @@
 	@${REINPLACE_CMD} -e 's|/usr/share/scilab|${DATADIR}|' ${WRKSRC}/desktop/scilab.desktop
 	@${REINPLACE_CMD} -e 's|/usr/share/scilab-cli|${DATADIR}|' \
 		${WRKSRC}/desktop/scilab-adv-cli.desktop ${WRKSRC}/desktop/scilab-cli.desktop
+.if ${OSVERSION} < 900000 && ${ARCH} == "amd64"
+	@# Avoids segfault when building help
+	@${REINPLACE_CMD} 's|JIT|NONE|' ${WRKSRC}/etc/jvm_options.xml
+.endif
 .else
 	@${REINPLACE_CMD} -e '/^check-local:/,/^$$/s/scilab-adv-cli/scilab-cli/g' \
 		${WRKSRC}/Makefile.in
Index: files/patch-modules__core__src__c__stack2.c
===================================================================
RCS file: files/patch-modules__core__src__c__stack2.c
diff -N files/patch-modules__core__src__c__stack2.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-modules__core__src__c__stack2.c	6 Mar 2012 09:37:04 -0000
@@ -0,0 +1,105 @@
+--- ./modules/core/src/c/stack2.c.orig	2011-07-20 01:15:44.000000000 -0700
++++ ./modules/core/src/c/stack2.c	2012-03-06 01:18:59.000000000 -0800
+@@ -667,7 +667,6 @@
+     if (*lar != -1)  C2F(cvstr1)(&MN, istk(*lr), cstk(*lar), &cx0,  MN + 1);
+     *lar = *lr;
+     *lr = cadr(*lr);
+-    M=MN; N= 1;
+     break;
+   case 'd' :
+     if (! C2F(cremat)(fname, &lw1, &it, m, n, lr, &lcs, nlgh))  return FALSE;
+@@ -1259,6 +1258,12 @@
+ 		*n = 1;
+ 		if (! C2F(getsmat)(fname,&topk,&lw,&m1,&n1,&cx1,&cx1,lr,m, nlgh))
+ 			return FALSE;
++		if ((m1 != 1) || (n1 != 1))
++		{
++			/* bug 8768 check dimensions */
++			Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, *number);
++			return FALSE;
++		}
+ 		ix2 = *m * *n;
+ 		/* in case where ix2 is 0 in2str adds the \0 char after the end of
+ 		the storage of the variable, so it writes over the next variable
+@@ -1348,7 +1353,6 @@
+ 		nn= (*m)*(*n);
+ 		ScilabMStr2CM(istk(il1),&nn,istk(ild1),&items,&ierr);
+ 		if ( ierr == 1) return FALSE;
+-		Type = '$';
+ 		/*
+ 		* Warning : lr must have the proper size when calling getrhsvar
+ 		* char **Str1; .... GetRhsVar(...., &lr)
+@@ -1621,7 +1625,6 @@
+     Sp->icol = istk(icol);
+     Sp->R = stk(lr1);
+     Sp->I = stk(lc);
+-    Type = '$';
+     break;
+   case 'I' :
+     /* int matrices */
+@@ -1630,7 +1633,6 @@
+       return FALSE;
+     Im->m = *m ; Im->n = *n ; Im->it = it; Im->l = lr1;
+     Im->D = istk(lr1);
+-    Type = '$';
+     break;
+   case 'p' :
+     if (! C2F(getlistpointer)(fname, &topk, &lw, number, lr,  nlgh))
+@@ -2086,7 +2088,7 @@
+ 	int ret = FALSE;
+ 	int ifin = 0, ifun = 0, tops = 0, moutputs = 0;
+ 	int id[nsiz];
+-	int lf = 0, op = 0, ile = 0, ils = 0, nnn = thestring_len, ninputs = 0;
++	int lf = 0, op = 0, ile = 0, ils = 0, nnn = thestring_len;
+ 
+ 	if (nnn <= 2) 
+ 	{
+@@ -2114,11 +2116,6 @@
+ 			ils = iadr(lf) + 1;
+ 			moutputs = *istk(ils);
+ 			ile = ils + moutputs * nsiz + 1;
+-			ninputs = *istk(ile);
+-			/*
+-			*   ninputs=actual number of inputs, moutputs=actual number of outputs
+-			*   of thestring: checking mlhs=ninputs and mrhs=moutputs not done.
+-			*/
+ 			ret = C2F(scifunction)(ifirst, &lf, mlhs, mrhs);
+ 		} 
+ 		else 
+@@ -2170,9 +2167,9 @@
+ 
+ int C2F(scibuiltin)(int *number,int *ifun,int *ifin,int *mlhs,int *mrhs)
+ {
+-  int srhs, slhs;
+-  int ix, k, intop, lw, pt0;
+-  int imode,ireftop;
++  int srhs = 0, slhs = 0;
++  int ix = 0, k = 0, intop = 0, lw = 0;
++  int imode = 0, ireftop = 0;
+   intop = Top;
+ 
+   if ( intersci_push() == 0 )
+@@ -2187,7 +2184,6 @@
+   Lhs = *mlhs;
+   Rhs = *mrhs;
+   C2F(recu).krec = -1;
+-  pt0 = C2F(recu).pt;
+   ++C2F(recu).niv;
+   goto L90;
+   /* ***************************** copied from callinter.h  */
+@@ -2564,12 +2560,15 @@
+ 
+   for (k = 1; k <= Lhs; k++)
+     {
++     if (LhsVar(k))
++     {
+       plhsk=*Lstk(LhsVar(k)+Top-Rhs);
+       if (*istk( iadr(plhsk) ) < 0) {
+ 	if (*Lstk(Bot) > *Lstk(*istk(iadr (plhsk) +2)) )
+ 	LhsVar(k)=*istk(iadr(plhsk)+2);
+ 	/* lcres = 0 */
+       }
++     }
+     }
+ 
+   if (Err > 0||C2F(errgst).err1> 0)  return TRUE ;
Index: files/patch-modules__xcos__src__java__org__scilab__modules__xcos__Xcos.java
===================================================================
RCS file: files/patch-modules__xcos__src__java__org__scilab__modules__xcos__Xcos.java
diff -N files/patch-modules__xcos__src__java__org__scilab__modules__xcos__Xcos.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-modules__xcos__src__java__org__scilab__modules__xcos__Xcos.java	5 Mar 2012 06:12:07 -0000
@@ -0,0 +1,11 @@
+--- ./modules/xcos/src/java/org/scilab/modules/xcos/Xcos.java.orig	2011-07-20 01:16:12.000000000 -0700
++++ ./modules/xcos/src/java/org/scilab/modules/xcos/Xcos.java	2012-02-13 01:10:14.000000000 -0800
+@@ -61,7 +61,7 @@
+ 	 * Dependencies version
+ 	 */
+ 	private static final List<String> MXGRAPH_VERSIONS = Arrays.asList("1.4.1.0");
+-	private static final List<String> HDF5_VERSIONS = Arrays.asList("[1, 8, 4]", "[1, 8, 5]");
++	private static final List<String> HDF5_VERSIONS = Arrays.asList("[1, 8, 4]", "[1, 8, 5]", "[1, 8, 6]", "[1, 8, 7]", "[1, 8, 8]", "[1, 8, 9]");
+ 	private static final List<String> BATIK_VERSIONS = Arrays.asList("1.7");
+ 	
+ 	private static final String UNABLE_TO_LOAD_JGRAPHX = 


>Release-Note:
>Audit-Trail:
>Unformatted:



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