Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Mar 2013 21:28:49 +0000 (UTC)
From:      Jimmy Olgeni <olgeni@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r313758 - in head/lang/newlisp: . files
Message-ID:  <201303092128.r29LSn8o014754@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: olgeni
Date: Sat Mar  9 21:28:49 2013
New Revision: 313758
URL: http://svnweb.freebsd.org/changeset/ports/313758

Log:
  Add support for the extended FFI, thus enabling the optional use
  of the math/gsl interface.
  
  Also, cleanup Makefile patches.

Added:
  head/lang/newlisp/files/patch-modules_gsl.lsp   (contents, props changed)
  head/lang/newlisp/files/patch-newlisp.h   (contents, props changed)
Deleted:
  head/lang/newlisp/files/patch-makefile_bsd_lib
Modified:
  head/lang/newlisp/Makefile
  head/lang/newlisp/files/patch-makefile_bsd   (contents, props changed)
  head/lang/newlisp/files/patch-makefile_bsdLP64_utf8   (contents, props changed)
  head/lang/newlisp/files/patch-makefile_bsd_utf8   (contents, props changed)
  head/lang/newlisp/pkg-plist

Modified: head/lang/newlisp/Makefile
==============================================================================
--- head/lang/newlisp/Makefile	Sat Mar  9 21:23:54 2013	(r313757)
+++ head/lang/newlisp/Makefile	Sat Mar  9 21:28:49 2013	(r313758)
@@ -10,6 +10,8 @@ EXTRACT_SUFX=	.tgz
 MAINTAINER=	olgeni@FreeBSD.org
 COMMENT=	LISP like scripting language
 
+LIB_DEPENDS=	ffi:${PORTSDIR}/devel/libffi
+
 HAS_CONFIGURE=	yes
 ALL_TARGET=	default
 
@@ -25,23 +27,35 @@ DOCS=		CHANGES CodePatterns.html Express
 		manual_frame.html newLISPdoc.html \
 		newlisp_index.html newlisp_manual.html \
 
-OPTIONS_DEFINE=	GMP MYSQL PGSQL SQLITE GUISERV
+OPTIONS_DEFINE=	GMP GSL MYSQL PGSQL SQLITE GUISERV
+GSL_DESC=	GSL (GNU Scientific Library)
 GUISERV_DESC=	Install GUI server (in Java)
 
 .include <bsd.port.options.mk>
 
+CFLAGS+=	-I${LOCALBASE}/include
+LDFLAGS+=	-L${LOCALBASE}/lib
+
 .if ${ARCH} == "amd64" || ${ARCH} == "sparc64" || ${ARCH} == "ia64"
 CFLAGS+=	-DNEWLISP64
 .endif
 
 .if ${PORT_OPTIONS:MGMP}
-LIB_DEPENDS+=	gmp.10:${PORTSDIR}/math/gmp
+LIB_DEPENDS+=	gmp:${PORTSDIR}/math/gmp
 MODULES+=	gmp
 PLIST_SUB+=	GMP=""
 .else
 PLIST_SUB+=	GMP="@comment "
 .endif
 
+.if ${PORT_OPTIONS:MGSL}
+LIB_DEPENDS+=	gsl:${PORTSDIR}/math/gsl
+MODULES+=	gsl
+PLIST_SUB+=	GSL=""
+.else
+PLIST_SUB+=	GSL="@comment "
+.endif
+
 .if ${PORT_OPTIONS:MMYSQL}
 USE_MYSQL=	yes
 MODULES+=	mysql
@@ -101,6 +115,9 @@ post-patch:
 		"s,/usr/local/lib/libgmp.so,${LOCALBASE}/lib/libgmp.so," \
 		${WRKSRC}/modules/gmp.lsp
 	@${REINPLACE_CMD} -E -e \
+		"s,/usr/local/lib/libgsl.so,${LOCALBASE}/lib/libgsl.so," \
+		${WRKSRC}/modules/gsl.lsp
+	@${REINPLACE_CMD} -E -e \
 		"s,/usr/local/lib/libpq.so.5.1,${LOCALBASE}/lib/libpq.so.5," \
 		${WRKSRC}/modules/postgres.lsp
 	@${REINPLACE_CMD} -E -e \

Modified: head/lang/newlisp/files/patch-makefile_bsd
==============================================================================
--- head/lang/newlisp/files/patch-makefile_bsd	Sat Mar  9 21:23:54 2013	(r313757)
+++ head/lang/newlisp/files/patch-makefile_bsd	Sat Mar  9 21:28:49 2013	(r313758)
@@ -1,11 +1,14 @@
---- makefile_bsd.orig	2009-06-22 04:48:53.000000000 +0400
-+++ makefile_bsd	2009-07-02 14:37:54.000000000 +0400
+
+$FreeBSD$
+
+--- makefile_bsd.orig
++++ makefile_bsd
 @@ -6,14 +6,12 @@
  
  # the option -fno-strict-aliasing may not be available on some BSD versions 
  
 -CFLAGS = -m32 -Wall -Wno-uninitialized -fno-strict-aliasing -O2 -c -g -DREADLINE -D_BSD
-+CFLAGS = -m32 -c -DREADLINE -D_BSD
++CFLAGS += -m32 -c -DREADLINE -D_BSD -DFFI
  # or without readline lib
  #CFLAGS = -m32 -Wall -Wno-uninitialized -Wno-strict-aliasing -O2 -c -g -D_BSD
  
@@ -13,7 +16,7 @@
 -
  default: $(OBJS)
 -	$(CC) $(OBJS) -m32 -g -lm -lreadline -lncurses -o newlisp
-+	$(CC) $(OBJS) -m32 -lm -lreadline -lncurses -o newlisp
++	$(CC) $(LDFLAGS) $(OBJS) -m32 -lm -lreadline -lncurses -lffi -o newlisp
  # or without readline lib
  #	$(CC) $(OBJS) -m32 -g -lm -o newlisp
  	strip newlisp

Modified: head/lang/newlisp/files/patch-makefile_bsdLP64_utf8
==============================================================================
--- head/lang/newlisp/files/patch-makefile_bsdLP64_utf8	Sat Mar  9 21:23:54 2013	(r313757)
+++ head/lang/newlisp/files/patch-makefile_bsdLP64_utf8	Sat Mar  9 21:28:49 2013	(r313758)
@@ -1,11 +1,22 @@
---- makefile_bsdLP64_utf8.orig	2009-08-11 15:44:03.000000000 +0400
-+++ makefile_bsdLP64_utf8	2009-08-11 15:44:26.000000000 +0400
-@@ -6,7 +6,7 @@
+
+$FreeBSD$
+
+--- makefile_bsdLP64_utf8.orig
++++ makefile_bsdLP64_utf8
+@@ -6,14 +6,12 @@
  
  # the option -fno-strict-aliasing may not be available on some BSD versions 
  
 -CFLAGS = -m64 -Wall -Wno-uninitialized -fno-strict-aliasing -O2 -c -g -DREADLINE -DNEWLISP64 -DSUPPORT_UTF8 -D_BSD
-+CFLAGS += -c -DREADLINE -DNEWLISP64 -DSUPPORT_UTF8 -D_BSD
++CFLAGS += -m64 -c -DREADLINE -DNEWLISP64 -DSUPPORT_UTF8 -D_BSD -DFFI
  # or without readline lib
  #CFLAGS = -m64 -Wall -Wno-uninitialized -Wno-strict-aliasing -O2 -c -g -DNEWLISP64 -D_BSD
  
+-CC = gcc
+-
+ default: $(OBJS)
+-	$(CC) $(OBJS) -m64 -g -lm -lreadline -lncurses -o newlisp
++	$(CC) $(LDFLAGS) $(OBJS) -m64 -lm -lreadline -lncurses -lffi -o newlisp
+ # or without readline lib
+ #	$(CC) $(OBJS) -m64 -g -lm -o newlisp
+ 	strip newlisp

Modified: head/lang/newlisp/files/patch-makefile_bsd_utf8
==============================================================================
--- head/lang/newlisp/files/patch-makefile_bsd_utf8	Sat Mar  9 21:23:54 2013	(r313757)
+++ head/lang/newlisp/files/patch-makefile_bsd_utf8	Sat Mar  9 21:28:49 2013	(r313758)
@@ -1,11 +1,14 @@
---- makefile_bsd_utf8.orig	2009-06-22 04:48:53.000000000 +0400
-+++ makefile_bsd_utf8	2009-07-03 14:32:08.000000000 +0400
+
+$FreeBSD$
+
+--- makefile_bsd_utf8.orig
++++ makefile_bsd_utf8
 @@ -4,14 +4,12 @@
  OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o \
  	nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o
  
 -CFLAGS = -m32 -Wall -Wno-uninitialized -fno-strict-aliasing -O2 -c -g -DREADLINE -D_BSD -DSUPPORT_UTF8
-+CFLAGS += -c -DREADLINE -D_BSD -DSUPPORT_UTF8
++CFLAGS += -m32 -c -DREADLINE -D_BSD -DSUPPORT_UTF8 -DFFI
  # or without readline lib
  #CFLAGS = -m32 -Wall -Wno-uninitialized -fno-strict-aliasing -O2 -c -g -D_BSD -DSUPPORT_UTF8
  
@@ -13,7 +16,7 @@
 -
  default: $(OBJS)
 -	$(CC) $(OBJS) -m32 -g -lm -lreadline -lncurses -o newlisp
-+	$(CC) $(OBJS) -lm -lreadline -lncurses -o newlisp
++	$(CC) $(LDFLAGS) $(OBJS) -m32 -lm -lreadline -lncurses -lffi -o newlisp
  # or without readline lib
  #	$(CC) $(OBJS) -m32 -g -lm -o newlisp
  	strip newlisp

Added: head/lang/newlisp/files/patch-modules_gsl.lsp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/newlisp/files/patch-modules_gsl.lsp	Sat Mar  9 21:28:49 2013	(r313758)
@@ -0,0 +1,21 @@
+
+$FreeBSD$
+
+--- modules/gsl.lsp.orig
++++ modules/gsl.lsp
+@@ -169,6 +169,7 @@
+ 		(= ostype "Win32") "libgsl-0.dll" ; 32-bit
+ 		(= ostype "OSX")   "libgsl.dylib" ; 32-bit
+ 		(= ostype "Linux") "/usr/local/lib/libgsl.so" ; 32-bit or 64-bit
++		(= ostype "BSD") "/usr/local/lib/libgsl.so" ; 32-bit or 64-bit
+ 	))
+ 
+ ; load libgslcblas which contans functions referenced by libgsl
+@@ -179,6 +180,7 @@
+ (if 
+     (= ostype "OSX") (import "libgslcblas.dylib" "cblas_sdsdot")
+     (= ostype "Linux") (import "/usr/local/lib/libgslcblas.so" "cblas_sdsdot")
++    (= ostype "BSD") (import "/usr/local/lib/libgslcblas.so" "cblas_sdsdot")
+ )
+     
+ ; structs are defined but only needed for debugging, instead use "void*"

Added: head/lang/newlisp/files/patch-newlisp.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/newlisp/files/patch-newlisp.h	Sat Mar  9 21:28:49 2013	(r313758)
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- newlisp.h.orig
++++ newlisp.h
+@@ -36,6 +36,10 @@
+ #  include <ffi.h>
+ #endif
+ 
++#ifdef __FreeBSD__
++#  include <ffi.h>
++#endif
++
+ #define LIBFFI " libffi"
+ #else /* not FFI */
+ #define LIBFFI ""

Modified: head/lang/newlisp/pkg-plist
==============================================================================
--- head/lang/newlisp/pkg-plist	Sat Mar  9 21:23:54 2013	(r313757)
+++ head/lang/newlisp/pkg-plist	Sat Mar  9 21:28:49 2013	(r313758)
@@ -71,6 +71,7 @@ bin/newlispdoc
 %%DATADIR%%/modules/ftp.lsp
 %%DATADIR%%/modules/getopts.lsp
 %%GMP%%%%DATADIR%%/modules/gmp.lsp
+%%GSL%%%%DATADIR%%/modules/gsl.lsp
 %%DATADIR%%/modules/infix.lsp
 %%DATADIR%%/modules/json.lsp
 %%DATADIR%%/modules/macro.lsp



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