1{ stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 name = "levmar-2.6";
5
6 src = fetchurl {
7 url = "http://www.ics.forth.gr/~lourakis/levmar/${name}.tgz";
8 sha256 = "1mxsjip9x782z6qa6k5781wjwpvj5aczrn782m9yspa7lhgfzx1v";
9 };
10
11 patchPhase = ''
12 sed -i 's/define HAVE_LAPACK/undef HAVE_LAPACK/' levmar.h
13 sed -i 's/LAPACKLIBS=.*/LAPACKLIBS=/' Makefile
14 '';
15
16 installPhase = ''
17 mkdir -p $out/include $out/lib
18 cp lm.h $out/include
19 cp liblevmar.a $out/lib
20 '';
21
22 meta = {
23 description = "ANSI C implementations of Levenberg-Marquardt, usable also from C++";
24 homepage = http://www.ics.forth.gr/~lourakis/levmar/;
25 license = stdenv.lib.licenses.gpl2Plus;
26 platforms = stdenv.lib.platforms.linux;
27 };
28}