summaryrefslogtreecommitdiff
path: root/lang/newlisp
diff options
context:
space:
mode:
authorJimmy Olgeni <olgeni@FreeBSD.org>2013-03-09 21:28:49 +0000
committerJimmy Olgeni <olgeni@FreeBSD.org>2013-03-09 21:28:49 +0000
commite45341193944239158557611c72a9b6a609196ed (patch)
treed401251916e624215f8d490234ac641e09a96e12 /lang/newlisp
parentRemove some dead variables (diff)
Add support for the extended FFI, thus enabling the optional use
of the math/gsl interface. Also, cleanup Makefile patches.
Notes
Notes: svn path=/head/; revision=313758
Diffstat (limited to 'lang/newlisp')
-rw-r--r--lang/newlisp/Makefile21
-rw-r--r--lang/newlisp/files/patch-makefile_bsd11
-rw-r--r--lang/newlisp/files/patch-makefile_bsdLP64_utf819
-rw-r--r--lang/newlisp/files/patch-makefile_bsd_lib13
-rw-r--r--lang/newlisp/files/patch-makefile_bsd_utf811
-rw-r--r--lang/newlisp/files/patch-modules_gsl.lsp21
-rw-r--r--lang/newlisp/files/patch-newlisp.h16
-rw-r--r--lang/newlisp/pkg-plist1
8 files changed, 86 insertions, 27 deletions
diff --git a/lang/newlisp/Makefile b/lang/newlisp/Makefile
index 98defaf72bee..2a9f9a218128 100644
--- a/lang/newlisp/Makefile
+++ b/lang/newlisp/Makefile
@@ -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 ExpressionEvaluation.html \
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 \
diff --git a/lang/newlisp/files/patch-makefile_bsd b/lang/newlisp/files/patch-makefile_bsd
index 2c325c9a4221..7f13aa63789b 100644
--- a/lang/newlisp/files/patch-makefile_bsd
+++ b/lang/newlisp/files/patch-makefile_bsd
@@ -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
diff --git a/lang/newlisp/files/patch-makefile_bsdLP64_utf8 b/lang/newlisp/files/patch-makefile_bsdLP64_utf8
index 32d9a9c06edb..ab43c1715c14 100644
--- a/lang/newlisp/files/patch-makefile_bsdLP64_utf8
+++ b/lang/newlisp/files/patch-makefile_bsdLP64_utf8
@@ -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
diff --git a/lang/newlisp/files/patch-makefile_bsd_lib b/lang/newlisp/files/patch-makefile_bsd_lib
deleted file mode 100644
index 5320fde41744..000000000000
--- a/lang/newlisp/files/patch-makefile_bsd_lib
+++ /dev/null
@@ -1,13 +0,0 @@
---- makefile_bsd_lib.orig 2011-09-21 07:21:04.000000000 -0700
-+++ makefile_bsd_lib 2011-11-13 21:18:47.000000000 -0800
-@@ -3,9 +3,7 @@
- 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 pcre.o unix-lib.o
-
--CFLAGS = -m32 -Wall -Wno-uninitialized -fno-strict-aliasing -O2 -c -g -D_BSD
--
--CC = gcc
-+CFLAGS = -m32 -c -D_BSD
-
- default: $(OBJS)
- $(CC) $(OBJS) -m32 -lm -shared -o newlisp.so
diff --git a/lang/newlisp/files/patch-makefile_bsd_utf8 b/lang/newlisp/files/patch-makefile_bsd_utf8
index b8de5757737b..73a27ac4b7b0 100644
--- a/lang/newlisp/files/patch-makefile_bsd_utf8
+++ b/lang/newlisp/files/patch-makefile_bsd_utf8
@@ -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
diff --git a/lang/newlisp/files/patch-modules_gsl.lsp b/lang/newlisp/files/patch-modules_gsl.lsp
new file mode 100644
index 000000000000..817cc35f1e16
--- /dev/null
+++ b/lang/newlisp/files/patch-modules_gsl.lsp
@@ -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*"
diff --git a/lang/newlisp/files/patch-newlisp.h b/lang/newlisp/files/patch-newlisp.h
new file mode 100644
index 000000000000..2d9613814c98
--- /dev/null
+++ b/lang/newlisp/files/patch-newlisp.h
@@ -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 ""
diff --git a/lang/newlisp/pkg-plist b/lang/newlisp/pkg-plist
index bebb83649cf0..b57f04bb12f4 100644
--- a/lang/newlisp/pkg-plist
+++ b/lang/newlisp/pkg-plist
@@ -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