[90400] trunk/dports/devel
pixilla at macports.org
pixilla at macports.org
Sun Mar 4 12:23:55 PST 2012
Revision: 90400
http://trac.macports.org/changeset/90400
Author: pixilla at macports.org
Date: 2012-03-04 12:23:51 -0800 (Sun, 04 Mar 2012)
Log Message:
-----------
devel/levmar:
- New port.
Added Paths:
-----------
trunk/dports/devel/levmar/
trunk/dports/devel/levmar/Portfile
trunk/dports/devel/levmar/files/
trunk/dports/devel/levmar/files/patch-Makefile.so.diff
Added: trunk/dports/devel/levmar/Portfile
===================================================================
--- trunk/dports/devel/levmar/Portfile (rev 0)
+++ trunk/dports/devel/levmar/Portfile 2012-03-04 20:23:51 UTC (rev 90400)
@@ -0,0 +1,102 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+
+name levmar
+version 2.6
+categories devel
+platforms darwin
+license GPL
+
+maintainers fourpalms.org:lockhart openmaintainer
+
+description Levenberg-Marquardt nonlinear least squares algorithm
+long_description levmar is a native ANSI C implementation of the Levenberg-Marquardt \
+ optimization algorithm. Both unconstrained and constrained (under linear \
+ equations, inequality and box constraints) Levenberg-Marquardt variants are \
+ included. The LM algorithm is an iterative technique that finds a local \
+ minimum of a function that is expressed as the sum of squares of nonlinear \
+ functions. It has become a standard technique for nonlinear least-squares \
+ problems and can be thought of as a combination of steepest descent and the \
+ Gauss-Newton method. When the current solution is far from the correct on, \
+ the algorithm behaves like a steepest descent method: slow, but guaranteed \
+ to converge. When the current solution is close to the correct solution, it \
+ becomes a Gauss-Newton method.
+
+homepage http://www.ics.forth.gr/~lourakis/levmar/
+master_sites http://www.ics.forth.gr/~lourakis/levmar/
+
+extract.suffix .tgz
+checksums rmd160 2b29daea12804050c8d3939b8c142d27d36bffc8 \
+ sha256 3bf4ef1ea4475ded5315e8d8fc992a725f2e7940a74ca3b0f9029d9e6e94bad7
+
+# Patch taken from levmar RPM by Eric Smith <eric at brouhaha.com>
+patch.pre_args -p1
+patchfiles patch-Makefile.so.diff
+
+use_configure no
+#configure.args --with-omniORB-config="${prefix}/etc/omniORB.cfg"
+
+universal_variant no
+
+lassign [split ${version} "."] ver_major ver_minor
+lassign [split "2.2" "."] abi_major abi_minor
+
+post-patch {
+ set fl [open ${worksrcpath}/Makefile.so]
+ set lines [read $fl]
+ close $fl
+ foreach line [split $lines \n] {
+ if {[regexp {(MAJ|MIN)[[:space:]]*=[[:space:]]*([[:digit:]]+)} ${line} matched key value] == 1} {
+ if {${key} == "MAJ"} {
+ ui_debug "Found ABI major field ${value}"
+ set abi_major ${value}
+ } else {
+ ui_debug "Found ABI minor field ${value}"
+ set abi_minor ${value}
+ }
+ }
+ }
+
+ if {${abi_major} != ${ver_major} || ${abi_minor} > ${ver_minor}} {
+ ui_error "levmar version ${ver_major} is inconsistent with ABI version ${abi_major}.${abi_minor}"
+ return -code error
+ }
+
+ reinplace "s|\r||g" ${worksrcpath}/README.txt
+ file mkdir ${worksrcpath}/sobj
+}
+
+build.args-append "-f Makefile.so"
+build.args-append "LDFLAGS=-Wl,-rpath,${prefix}/lib"
+
+test.run yes
+test.cmd lmdemo
+test.target {}
+test.env DYLD_LIBRARY_PATH=${worksrcpath}/sobj
+
+destroot {
+ # library
+ xinstall -m 755 ${worksrcpath}/sobj/liblevmar.${abi_major}.${abi_minor}.dylib ${destroot}${prefix}/lib/liblevmar.${abi_major}.${abi_minor}.dylib
+
+ # test program
+ xinstall -m 755 ${worksrcpath}/lmdemo ${destroot}${prefix}/bin/lmdemo
+
+ # header files
+ xinstall -m 755 ${worksrcpath}/levmar.h ${destroot}${prefix}/include
+
+ # documentation
+ xinstall -m 755 -d ${destroot}${prefix}/share/${name}
+ xinstall -m 644 ${worksrcpath}/LICENSE ${destroot}${prefix}/share/${name}
+ xinstall -m 644 ${worksrcpath}/README.txt ${destroot}${prefix}/share/${name}
+}
+
+post-destroot {
+ ln -s liblevmar.${abi_major}.${abi_minor}.dylib ${destroot}${prefix}/lib/liblevmar.${ver_major}.dylib
+ ln -s liblevmar.${abi_major}.${abi_minor}.dylib ${destroot}${prefix}/lib/liblevmar.dylib
+}
+
+livecheck.type regex
+livecheck.url http://www.ics.forth.gr/~lourakis/levmar/
+livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)"
Property changes on: trunk/dports/devel/levmar/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/dports/devel/levmar/files/patch-Makefile.so.diff
===================================================================
--- trunk/dports/devel/levmar/files/patch-Makefile.so.diff (rev 0)
+++ trunk/dports/devel/levmar/files/patch-Makefile.so.diff 2012-03-04 20:23:51 UTC (rev 90400)
@@ -0,0 +1,61 @@
+--- levmar-2.6.orig/Makefile.so 2009-12-04 13:26:31.000000000 -0800
++++ levmar-2.6/Makefile.so 2012-03-03 13:41:25.000000000 -0800
+@@ -6,7 +6,8 @@
+ # major & minor shared lib numbers
+ MAJ=2
+ MIN=2
+-ODIR=sobj # where to place object files for shared lib
++# ODIR defines where to place object files for shared lib
++ODIR=sobj
+ CC=gcc
+ CONFIGFLAGS=-ULINSOLVERS_RETAIN_MEMORY
+ #ARCHFLAGS=-march=pentium4 # YOU MIGHT WANT TO UNCOMMENT THIS FOR P4
+@@ -14,14 +15,23 @@
+ LAPACKLIBS_PATH=/usr/local/lib # WHEN USING LAPACK, CHANGE THIS TO WHERE YOUR COMPILED LIBS ARE!
+ LIBOBJS=$(ODIR)/lm.o $(ODIR)/Axb.o $(ODIR)/misc.o $(ODIR)/lmlec.o $(ODIR)/lmbc.o $(ODIR)/lmblec.o $(ODIR)/lmbleic.o
+ LIBSRCS=lm.c Axb.c misc.c lmlec.c lmbc.c lmblec.c lmbleic.c
+-LAPACKLIBS=-llapack -lblas -lf2c # comment this line if you are not using LAPACK.
++DEMOBJS=lmdemo.o
++DEMOSRCS=lmdemo.c
++# -lf2c removed from LAPACKLIBS for Fedora
++# comment the following line if you are not using LAPACK.
++LAPACKLIBS=-llapack -lblas
+ # On systems with a FORTRAN (not f2c'ed) version of LAPACK, -lf2c is
+ # not necessary; on others, -lf2c is equivalent to -lF77 -lI77
+
+ LIBS=$(LAPACKLIBS)
+
+-$(ODIR)/liblevmar.so.$(MAJ).$(MIN): $(LIBOBJS)
+- $(CC) -shared -Wl,-soname,liblevmar.so.$(MAJ) -o $(ODIR)/liblevmar.so.$(MAJ).$(MIN) $(LIBOBJS) #-llapack -lblas -lf2c
++all: $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib lmdemo
++
++$(ODIR)/liblevmar.$(MAJ).$(MIN).dylib: $(LIBOBJS)
++ $(CC) -shared -Wl,-install_name, at rpath/liblevmar.$(MAJ).dylib -o $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib $(LIBOBJS) $(LIBS)
++
++$(ODIR)/liblevmar.dylib: $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib
++ ln -s liblevmar.$(MAJ).$(MIN).dylib $(ODIR)/liblevmar.dylib
+
+ # implicit rule for generating *.o files in ODIR from *.c files
+ $(ODIR)/%.o : %.c
+@@ -36,14 +46,19 @@
+ $(ODIR)/lmblec.o: lmblec.c lmblec_core.c levmar.h misc.h
+ $(ODIR)/lmbleic.o: lmbleic.c lmbleic_core.c levmar.h misc.h
+
++lmdemo.o: levmar.h
++
++lmdemo: $(DEMOBJS) $(ODIR)/liblevmar.dylib
++ $(CC) $(LDFLAGS) $(DEMOBJS) -o lmdemo -L$(ODIR) -llevmar $(LIBS) -lm # -u MAIN__
++
+ clean:
+ @rm -f $(LIBOBJS)
+
+ cleanall: clean
+- @rm -f $(ODIR)/liblevmar.so.$(MAJ).$(MIN)
++ @rm -f $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib
+
+ depend:
+- makedepend -f Makefile $(LIBSRCS)
++ makedepend -f Makefile $(LIBSRCS) $(DEMOSRCS)
+
+ # DO NOT DELETE THIS LINE -- make depend depends on it.
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120304/98c6f06a/attachment-0001.html>
More information about the macports-changes
mailing list