[20674] trunk/dports/devel
source_changes at macosforge.org
source_changes at macosforge.org
Thu Nov 16 23:14:47 PST 2006
Revision: 20674
http://trac.macosforge.org/projects/macports/changeset/20674
Author: bfulgham at macports.org
Date: 2006-11-16 23:14:46 -0800 (Thu, 16 Nov 2006)
Log Message:
-----------
Add numeric support code for Lua. These would be even better if the
BLAS or ATLAS libraries were part of MacPorts... For now, it builds
using the default unoptimized versions of these libraries (included
with the original distfile).
Added Paths:
-----------
trunk/dports/devel/lua-numlua/
trunk/dports/devel/lua-numlua/Portfile
trunk/dports/devel/lua-numlua/files/
trunk/dports/devel/lua-numlua/files/patch-Makefile
trunk/dports/devel/lua-numlua/files/patch-lib-config
trunk/dports/devel/lua-numlua/files/patch-src-Makefile
Added: trunk/dports/devel/lua-numlua/Portfile
===================================================================
--- trunk/dports/devel/lua-numlua/Portfile (rev 0)
+++ trunk/dports/devel/lua-numlua/Portfile 2006-11-17 07:14:46 UTC (rev 20674)
@@ -0,0 +1,81 @@
+# $Id: Portfile 20382 2006-11-02 21:38:50Z blair at macports.org $
+
+PortSystem 1.0
+
+name lua-numlua
+version 0.2
+revision 0
+categories devel
+platforms darwin
+maintainers bfulgham at macports.org
+description Numerical package for the Lua programming language.
+long_description ${description} It includes support for complex \
+ numbers, multidimensional matrices, random generation \
+ and special functions. Much of the routines are \
+ simple wrappers for the stable and well-known \
+ libraries from Netlib (http://www.netlib.org).
+
+homepage http://luaforge.net/projects/numlua
+master_sites http://luaforge.net/frs/download.php/1400
+distname numlua-${version}
+
+use_configure no
+
+checksums md5 a49efb211b94fe3e436f6b00b6b01536 \
+ sha1 8465209f95d12f1803a5f6995a2c9af51fdbb021 \
+ rmd160 0f8461b7af617c5e1d4eb0395baef4ccefb7a9b9
+
+depends_lib-append lib:fftw:fftw-3
+
+patchfiles patch-Makefile \
+ patch-lib-config \
+ patch-src-Makefile
+
+build.type gnu
+build.cmd cd lib && make && cd ../src && make
+build.args
+build.target
+
+variant darwin powerpc {
+ depends_build-append port:gcc41
+
+ post-patch {
+ reinplace "s|/opt/local|${prefix}|g" ${worksrcpath}/Makefile
+ reinplace "s|/opt/local|${prefix}|g" ${worksrcpath}/lib/config
+ reinplace "s|/opt/local|${prefix}|g" ${worksrcpath}/src/Makefile
+ }
+}
+
+variant darwin i386 {
+ depends_build-append port:gcc42
+
+ post-patch {
+ reinplace "s:gfortran-dp-4.1:gfortran-dp-4.2:g" ${worksrcpath}/numpy/distutils/fcompiler/gnu.py
+ reinplace "s|/opt/local|${prefix}|g" ${worksrcpath}/Makefile
+ reinplace "s|/opt/local|${prefix}|g" ${worksrcpath}/lib/config
+ reinplace "s|/opt/local|${prefix}|g" ${worksrcpath}/src/Makefile
+ }
+}
+
+destroot {
+ xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
+ file copy INSTALL LICENSE README TODO ${destroot}${prefix}/share/doc/${name}
+
+ # Binaries
+ xinstall -m 755 -d ${destroot}${prefix}/lib/lua/5.1
+ foreach lib [glob src/*.so] {
+ xinstall -m 0644 ${lib} ${destroot}${prefix}/lib/lua/5.1
+ }
+
+ # Lua libraries
+ xinstall -m 755 -d ${destroot}${prefix}/share/lua/5.1
+ foreach luadat [glob lua/*.lua] {
+ xinstall -m 0644 ${luadat} ${destroot}${prefix}/share/lua/5.1
+ }
+
+ # Lua includes
+ xinstall -m 755 -d ${destroot}${prefix}/include/lua5.1
+ foreach inc [glob src/*.h] {
+ xinstall -m 0644 ${inc} ${destroot}${prefix}/include/lua5.1
+ }
+}
Added: trunk/dports/devel/lua-numlua/files/patch-Makefile
===================================================================
--- trunk/dports/devel/lua-numlua/files/patch-Makefile (rev 0)
+++ trunk/dports/devel/lua-numlua/files/patch-Makefile 2006-11-17 07:14:46 UTC (rev 20674)
@@ -0,0 +1,31 @@
+--- Makefile.orig 2006-02-17 18:11:35.000000000 -0800
++++ Makefile 2006-11-11 19:50:09.000000000 -0800
+@@ -3,8 +3,8 @@
+ # modify src/Makefile to your taste
+ # $Id: Makefile,v 1.2 2006/02/13 01:03:17 carvalho Exp $
+
+-# linux | win32 : edit src/Makefile accordingly
+-TARGET = linux
++# linux | win32 | darwin : edit src/Makefile accordingly
++TARGET = darwin
+
+ # these are based on default settings in luaconf.h
+ ifeq ($(TARGET), linux)
+@@ -13,10 +13,17 @@
+ INSTALL_LIB = $(INSTALL_ROOT)/lib/lua/5.1
+ INSTALL_LUA = $(INSTALL_ROOT)/share/lua/5.1/numlua
+ else
++ ifeq ($(TARGET), win32)
+ INSTALL_ROOT = C:\Program Files\Lua51
+ INSTALL_INC = "$(INSTALL_ROOT)\include"
+ INSTALL_LIB = "$(INSTALL_ROOT)\dll"
+ INSTALL_LUA = "$(INSTALL_ROOT)\lua"
++ else #ifeq ($(TARGET), darwin)
++INSTALL_ROOT = /opt/local
++INSTALL_INC = $(INSTALL_ROOT)/include
++INSTALL_LIB = $(INSTALL_ROOT)/lib
++INSTALL_LUA = $(INSTALL_ROOT)/share/lua/5.1/numlua
++ endif
+ endif
+
+ INSTALL = cp
Added: trunk/dports/devel/lua-numlua/files/patch-lib-config
===================================================================
--- trunk/dports/devel/lua-numlua/files/patch-lib-config (rev 0)
+++ trunk/dports/devel/lua-numlua/files/patch-lib-config 2006-11-17 07:14:46 UTC (rev 20674)
@@ -0,0 +1,15 @@
+--- lib/config.orig 2006-02-17 18:11:35.000000000 -0800
++++ lib/config 2006-11-12 15:27:51.000000000 -0800
+@@ -3,10 +3,10 @@
+
+ # change LUADIR below to where lua is installed, that is, INSTALL_TOP in lua's
+ # main Makefile
+-LUADIR = /usr/local
++LUADIR = /opt/local
+
+ # FORTRAN flags (used by blas, lapack, dcdflib, and fnlib)
+-FC = g77
++FC = gfortran-dp-4.1
+ FFLAGS = -fno-f2c -funroll-all-loops -fomit-frame-pointer -O
+
+ # C flags (used by ranlib)
Added: trunk/dports/devel/lua-numlua/files/patch-src-Makefile
===================================================================
--- trunk/dports/devel/lua-numlua/files/patch-src-Makefile (rev 0)
+++ trunk/dports/devel/lua-numlua/files/patch-src-Makefile 2006-11-17 07:14:46 UTC (rev 20674)
@@ -0,0 +1,91 @@
+--- src/Makefile.orig 2006-02-17 18:11:35.000000000 -0800
++++ src/Makefile 2006-11-12 15:59:33.000000000 -0800
+@@ -1,8 +1,8 @@
+ # Makefile for numlua
+ # $Id: Makefile,v 1.6 2006/02/18 01:54:38 carvalho Exp $
+
+-# linux | win32
+-TARGET = linux
++# linux | win32 | darwin
++TARGET = darwin
+
+ # atlas | atlas_threaded | blas | custom
+ BLAS = blas
+@@ -15,10 +15,10 @@
+
+ # change LUADIR below to where lua is installed, that is, INSTALL_TOP in lua's
+ # main Makefile
+-LUADIR = /usr/local
++LUADIR = /opt/local
+
+-CC = gcc
+-CFLAGS = -W -Wall -pedantic -fshort-enums
++CC = MACOSX_DEPLOYMENT_TARGET="10.3" gcc-dp-4.1
++CFLAGS = -W -Wall -pedantic -fshort-enums
+ OPTFLAGS = -fomit-frame-pointer -O2 # -g
+
+ AR = ar rcu
+@@ -30,19 +30,23 @@
+
+ LIBS = -L../lib -lfnlib -ldcdflib -lranlib
+ ifeq ($(BLAS), atlas)
+-LIBS += -llapack -lcblas -lf77blas -latlas -lg2c
++LIBS += -llapack -lcblas -lf77blas -latlas #-lg2c
+ endif
+ ifeq ($(BLAS), atlas_threaded)
+-LIBS += -llapack -lptcblas -lptf77blas -latlas -lg2c -lpthread
++LIBS += -llapack -lptcblas -lptf77blas -latlas -lpthread #-lg2c
+ endif
+ ifeq ($(BLAS), blas)
+-LIBS += -llapack -lblas -lg2c
++LIBS += -llapack -lblas #-lg2c
+ endif
+ ifeq ($(BLAS), custom)
+ LIBS += $(CUSTOMBLAS)
+ endif
+ ifeq ($(TARGET), win32)
+ LIBS += -L$(LUADIR)/lib -llua
++else
++ ifeq ($(TARGET), darwin)
++LIBS += -L$(LUADIR)/lib -llua
++ endif
+ endif
+
+ OBJ = luaspfun.o luarng.o luacomplex.o
+@@ -53,22 +57,36 @@
+ DLIB = $(LIB:.a=.so)
+ LMDLIB = $(LMLIB:.a=.so)
+ else
++ ifeq ($(TARGET), win32)
+ DLIB = $(LIB:.a=.dll)
+ LMDLIB = $(LMLIB:.a=.dll)
++ else
++DLIB = $(LIB:.a=.so)
++LMDLIB = $(LMLIB:.a=.so)
++ endif
+ endif
+
+ OBJFLAGS = -I$(LUADIR)/include
+ ifeq ($(TARGET), linux)
+ LDFLAGS = -fpic
+ endif
++
++ifeq ($(TARGET), darwin)
++LDFLAGS += -bundle -undefined dynamic_lookup
++else
+ LDFLAGS += -shared
++endif
+
+ all : $(LIB) $(LMLIB) $(DLIB) $(LMDLIB)
+
+ ifeq ($(TARGET), linux)
+ $(DLIB) : %.so : %.o
+ else
++ ifeq ($(TARGET), win32)
+ $(DLIB) : %.dll : %.o
++ else
++$(DLIB) : %.so : %.o
++ endif
+ endif
+ $(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ $(LIBS)
+ # $(STRIP) $@
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20061116/a9fb7c21/attachment.html
More information about the macports-changes
mailing list