1 | # -*- 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 |
---|
2 | # $Id: Portfile 87721 2011-12-02 09:31:29Z stromnov@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name levmar |
---|
7 | version 2.6 |
---|
8 | categories devel |
---|
9 | platforms darwin |
---|
10 | license GPL |
---|
11 | |
---|
12 | maintainers fourpalms.org:lockhart openmaintainer |
---|
13 | |
---|
14 | description Levenberg-Marquardt nonlinear least squares algorithm |
---|
15 | long_description levmar is a native ANSI C implementation of the Levenberg-Marquardt \ |
---|
16 | optimization algorithm. Both unconstrained and constrained (under linear \ |
---|
17 | equations, inequality and box constraints) Levenberg-Marquardt variants are \ |
---|
18 | included. The LM algorithm is an iterative technique that finds a local \ |
---|
19 | minimum of a function that is expressed as the sum of squares of nonlinear \ |
---|
20 | functions. It has become a standard technique for nonlinear least-squares \ |
---|
21 | problems and can be thought of as a combination of steepest descent and the \ |
---|
22 | Gauss-Newton method. When the current solution is far from the correct on, \ |
---|
23 | the algorithm behaves like a steepest descent method: slow, but guaranteed \ |
---|
24 | to converge. When the current solution is close to the correct solution, it \ |
---|
25 | becomes a Gauss-Newton method. |
---|
26 | |
---|
27 | homepage http://www.ics.forth.gr/~lourakis/levmar/ |
---|
28 | master_sites http://www.ics.forth.gr/~lourakis/levmar/ |
---|
29 | |
---|
30 | extract.suffix .tgz |
---|
31 | checksums rmd160 2b29daea12804050c8d3939b8c142d27d36bffc8 \ |
---|
32 | sha256 3bf4ef1ea4475ded5315e8d8fc992a725f2e7940a74ca3b0f9029d9e6e94bad7 |
---|
33 | |
---|
34 | # Patch taken from levmar RPM by Eric Smith <eric@brouhaha.com> |
---|
35 | patch.pre_args -p1 |
---|
36 | patchfiles patch-Makefile.so.diff |
---|
37 | |
---|
38 | use_configure no |
---|
39 | #configure.args --with-omniORB-config="${prefix}/etc/omniORB.cfg" |
---|
40 | |
---|
41 | universal_variant no |
---|
42 | |
---|
43 | lassign [split ${version} "."] ver_major ver_minor |
---|
44 | lassign [split "2.2" "."] abi_major abi_minor |
---|
45 | |
---|
46 | post-patch { |
---|
47 | set fl [open ${worksrcpath}/Makefile.so] |
---|
48 | set lines [read $fl] |
---|
49 | close $fl |
---|
50 | foreach line [split $lines \n] { |
---|
51 | if {[regexp {(MAJ|MIN)[[:space:]]*=[[:space:]]*([[:digit:]]+)} ${line} matched key value] == 1} { |
---|
52 | if {${key} == "MAJ"} { |
---|
53 | ui_debug "Found ABI major field ${value}" |
---|
54 | set abi_major ${value} |
---|
55 | } else { |
---|
56 | ui_debug "Found ABI minor field ${value}" |
---|
57 | set abi_minor ${value} |
---|
58 | } |
---|
59 | } |
---|
60 | } |
---|
61 | |
---|
62 | if {${abi_major} != ${ver_major} || ${abi_minor} > ${ver_minor}} { |
---|
63 | ui_error "levmar version ${ver_major} is inconsistent with ABI version ${abi_major}.${abi_minor}" |
---|
64 | return -code error |
---|
65 | } |
---|
66 | |
---|
67 | reinplace "s|\r||g" ${worksrcpath}/README.txt |
---|
68 | file mkdir ${worksrcpath}/sobj |
---|
69 | } |
---|
70 | |
---|
71 | build.args-append "-f Makefile.so" |
---|
72 | build.args-append "LDFLAGS=-Wl,-rpath,${prefix}/lib" |
---|
73 | |
---|
74 | test.run yes |
---|
75 | test.cmd lmdemo |
---|
76 | test.target {} |
---|
77 | test.env DYLD_LIBRARY_PATH=${worksrcpath}/sobj |
---|
78 | |
---|
79 | destroot { |
---|
80 | # library |
---|
81 | xinstall -m 755 ${worksrcpath}/sobj/liblevmar.dylib.${abi_major}.${abi_minor} ${destroot}${prefix}/lib/liblevmar.dylib.${abi_major}.${abi_minor} |
---|
82 | |
---|
83 | # test program |
---|
84 | xinstall -m 755 ${worksrcpath}/lmdemo ${destroot}${prefix}/bin/lmdemo |
---|
85 | |
---|
86 | # header files |
---|
87 | xinstall -m 755 ${worksrcpath}/levmar.h ${destroot}${prefix}/include |
---|
88 | |
---|
89 | # documentation |
---|
90 | xinstall -m 755 -d ${destroot}${prefix}/share/${name} |
---|
91 | xinstall -m 644 ${worksrcpath}/LICENSE ${destroot}${prefix}/share/${name} |
---|
92 | xinstall -m 644 ${worksrcpath}/README.txt ${destroot}${prefix}/share/${name} |
---|
93 | } |
---|
94 | |
---|
95 | post-destroot { |
---|
96 | system "cd ${destroot}${prefix}/lib/ && ln -s liblevmar.dylib.${abi_major}.${abi_minor} liblevmar.dylib.${abi_major} && ln -s liblevmar.dylib.${abi_major} liblevmar.dylib" |
---|
97 | } |
---|
98 | |
---|
99 | livecheck.type regex |
---|
100 | livecheck.url http://www.ics.forth.gr/~lourakis/levmar/ |
---|
101 | livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)" |
---|