Ticket #38247: port-numlua.diff
File port-numlua.diff, 5.3 KB (added by anddam (Andrea D'Amore), 12 years ago) |
---|
-
Portfile
1 1 # $Id$ 2 2 3 3 PortSystem 1.0 4 PortGroup github 1.0 4 5 6 github.setup carvalho numlua 0.3-1 7 github.tarball_from downloads 5 8 name lua-numlua 6 version 0.2.17 revision 18 9 license MIT 9 10 categories devel 10 11 platforms darwin 11 maintainers bfulgham 12 maintainers bfulgham and.damore 12 13 description Numerical package for the Lua programming language. 13 long_description ${description} It includes support for complex \ 14 numbers, multidimensional matrices, random generation \ 15 and special functions. Much of the routines are \ 16 simple wrappers for the stable and well-known \ 17 libraries from Netlib (http://www.netlib.org). 14 long_description ${description} It includes support for complex numbers, multidimensional \ 15 matrices, random generation and special functions. Much of the routines are \ 16 simple wrappers for the stable and well-known libraries from Netlib 18 17 19 homepage http://luaforge.net/projects/numlua20 set luaforge_release 256621 master_sites http://luaforge.net/frs/download.php/${luaforge_release}22 distname numlua-${version}23 worksrcdir numlua24 25 18 use_configure no 26 19 27 checksums md5 c4d0ce508e7f2ec2754242f2816f4cfc\28 sha1 e7c5fb14ebaa92b1ae5bef4cbe303644b9fe5252\29 rmd160 6238e6b79cd446c47a676c4bcb3afa8fd41c42a620 checksums md5 abc29945daadd1499c7596ebbfb0f88a \ 21 sha1 da37d2a1b6290f398ac8cd4e001a91bf0ac77194 \ 22 rmd160 4ba5c04922c30c1091117b11017a166e6f68c9ad 30 23 31 depends_build-append port:lua \ 32 port:gcc43 24 # there used to be a dependency on a gccXX port due to the need for a fortran compiler 25 # this has now been removed due to dependency on port atlas 33 26 34 depends_lib-append lib:fftw:fftw-3 27 depends_lib-append port:lua \ 28 port:atlas \ 29 lib:fftw:fftw-3 \ 30 lib:hdf5:hdf5-18 35 31 36 patchfiles patch-Makefile.diff \ 37 patch-lib-config.diff \ 38 patch-lib-Makefile.diff \ 39 patch-src-Makefile.diff 32 post-extract { 33 xinstall -m 644 ${filespath}/Makefile ${worksrcpath} } 40 34 41 pre-build {42 system "cd ${worksrcpath}/lib && make"43 }44 45 35 post-patch { 46 reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/Makefile 47 reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/lib/config 48 reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/src/Makefile 49 } 36 reinplace -W $worksrcpath "s|%%PREFIX%%|${prefix}|" Makefile } 50 37 38 build.args-append CC=${configure.cc} \ 39 CPP=${configure.cpp} \ 40 PREFIX=$prefix \ 41 CFLAGS="${configure.cflags} [get_canonical_archflags]" \ 42 CPPFLAGS=${configure.cppflags} \ 43 LDFLAGS=${configure.ldflags} \ 44 DEPLOYMENT_TARGET=${macosx_deployment_target} 45 46 destroot.args-append PREFIX=$prefix 47 48 post-destroot { 49 xinstall -d -m 755 ${destroot}${prefix}/share/doc 50 xinstall -d -m 755 ${destroot}${prefix}/share/examples 51 52 file copy ${worksrcpath}/docs ${destroot}${prefix}/share/doc/${name} 53 file copy ${worksrcpath}/examples ${destroot}${prefix}/share/examples/${name} 54 file copy ${worksrcpath}/lhp ${destroot}${prefix}/share/doc/${name}/lhp } -
files/Makefile
1 # Makefile for numlua 2 # $Id$ 3 4 CC ?= /usr/bin/clang 5 CFLAGS ?= -O2 -arch x86_64 6 CPPFLAGS ?= -I%%PREFIX%%/include 7 LDFLAGS ?= -L%%PREFIX%%/lib 8 DEPLOYMENT_TARGET ?= 10.5 9 PREFIX ?= /tmp 10 11 INSTALL_ROOT = $(DESTDIR)$(PREFIX) 12 INSTALL_INC = $(INSTALL_ROOT)/include/lua5.1 13 INSTALL_LUA = $(INSTALL_ROOT)/share/lua/5.1/numlua 14 INSTALL_LIB = $(INSTALL_ROOT)/lib/lua/5.1 15 TO_INC = amos.h blas.h cdflib.h lapack.h numlua.h rng.h 16 TO_LUA = matrix.lua seeall.lua 17 TO_LIB = numlua.so 18 19 OBJECTS = numlua.o complex.o fft.o msort.o lmatrix.o mt.o ranlib.o rng.o dcdflib.o ipmpar.o stat.o amos.o mathx.o 20 21 %.o : %.c 22 export MACOSX_DEPLOYMENT_TARGET=$(DEPLOYMENT_TARGET); $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ 23 24 .PHONY : numlua 25 numlua : numlua.so 26 27 numlua.so : $(OBJECTS) 28 export MACOSX_DEPLOYMENT_TARGET=$(DEPLOYMENT_TARGET); $(CC) -bundle -undefined dynamic_lookup -all_load -o numlua.so $(LDFLAGS) $(OBJECTS) -Wl,-rpath,$(PREFIX)/lib: -lhdf5 -lfftw3 -llapack -lblas 29 30 clean : 31 -rm -f $(OBJECTS) numlua.so 32 33 all : numlua 34 35 install : all 36 mkdir -p "$(INSTALL_ROOT)" 37 mkdir -p $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_LUA) 38 cp $(TO_INC) $(INSTALL_INC) 39 cp $(TO_LIB) $(INSTALL_LIB) 40 cp $(TO_LUA) $(INSTALL_LUA) 41