Ticket #38247: port-numlua.diff

File port-numlua.diff, 5.3 KB (added by anddam (Andrea D'Amore), 12 years ago)
  • Portfile

     
    11# $Id$
    22
    33PortSystem 1.0
     4PortGroup               github  1.0
    45
     6github.setup            carvalho numlua 0.3-1
     7github.tarball_from     downloads
    58name                    lua-numlua
    6 version                 0.2.1
    7 revision                1
    89license                 MIT
    910categories              devel
    1011platforms               darwin
    11 maintainers             bfulgham
     12maintainers             bfulgham and.damore
    1213description             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).
     14long_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
    1817
    19 homepage                http://luaforge.net/projects/numlua
    20 set luaforge_release    2566
    21 master_sites            http://luaforge.net/frs/download.php/${luaforge_release}
    22 distname                numlua-${version}
    23 worksrcdir              numlua
    24 
    2518use_configure           no
    2619
    27 checksums               md5     c4d0ce508e7f2ec2754242f2816f4cfc \
    28                         sha1    e7c5fb14ebaa92b1ae5bef4cbe303644b9fe5252 \
    29                         rmd160  6238e6b79cd446c47a676c4bcb3afa8fd41c42a6
     20checksums               md5     abc29945daadd1499c7596ebbfb0f88a \
     21                        sha1    da37d2a1b6290f398ac8cd4e001a91bf0ac77194 \
     22                        rmd160  4ba5c04922c30c1091117b11017a166e6f68c9ad
    3023
    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
    3326
    34 depends_lib-append      lib:fftw:fftw-3
     27depends_lib-append      port:lua \
     28                        port:atlas \
     29                        lib:fftw:fftw-3 \
     30                        lib:hdf5:hdf5-18
    3531
    36 patchfiles              patch-Makefile.diff \
    37                         patch-lib-config.diff \
    38                         patch-lib-Makefile.diff \
    39                         patch-src-Makefile.diff
     32post-extract {
     33    xinstall -m 644 ${filespath}/Makefile ${worksrcpath} }
    4034
    41 pre-build {
    42         system "cd ${worksrcpath}/lib && make"
    43 }
    44 
    4535post-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 }
    5037
     38build.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
     46destroot.args-append    PREFIX=$prefix
     47
     48post-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
     4CC ?= /usr/bin/clang
     5CFLAGS ?= -O2 -arch x86_64
     6CPPFLAGS ?= -I%%PREFIX%%/include
     7LDFLAGS ?= -L%%PREFIX%%/lib
     8DEPLOYMENT_TARGET ?= 10.5
     9PREFIX ?= /tmp
     10
     11INSTALL_ROOT = $(DESTDIR)$(PREFIX)
     12INSTALL_INC = $(INSTALL_ROOT)/include/lua5.1
     13INSTALL_LUA = $(INSTALL_ROOT)/share/lua/5.1/numlua
     14INSTALL_LIB = $(INSTALL_ROOT)/lib/lua/5.1
     15TO_INC = amos.h blas.h cdflib.h lapack.h numlua.h rng.h
     16TO_LUA = matrix.lua seeall.lua
     17TO_LIB = numlua.so
     18
     19OBJECTS = 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
     25numlua : numlua.so
     26
     27numlua.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
     30clean :
     31        -rm -f $(OBJECTS) numlua.so
     32
     33all : numlua
     34
     35install : 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