2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl }:
|
2021-01-19 21:20:11 +00:00
|
|
|
|
2010-01-21 14:39:53 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-06-22 13:21:29 +00:00
|
|
|
pname = "levmar";
|
|
|
|
version = "2.6";
|
2010-01-21 14:39:53 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-06-22 13:21:29 +00:00
|
|
|
url = "https://www.ics.forth.gr/~lourakis/levmar/${pname}-${version}.tgz";
|
2015-03-12 20:02:34 +00:00
|
|
|
sha256 = "1mxsjip9x782z6qa6k5781wjwpvj5aczrn782m9yspa7lhgfzx1v";
|
2010-01-21 14:39:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
2021-03-11 18:49:46 +00:00
|
|
|
substituteInPlace levmar.h --replace "define HAVE_LAPACK" "undef HAVE_LAPACK"
|
2010-01-21 14:39:53 +00:00
|
|
|
sed -i 's/LAPACKLIBS=.*/LAPACKLIBS=/' Makefile
|
2021-03-11 18:49:46 +00:00
|
|
|
substituteInPlace Makefile --replace "gcc" "${stdenv.cc.targetPrefix}cc"
|
2010-01-21 14:39:53 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/include $out/lib
|
2010-01-21 14:39:53 +00:00
|
|
|
cp lm.h $out/include
|
|
|
|
cp liblevmar.a $out/lib
|
|
|
|
'';
|
|
|
|
|
2021-01-19 21:20:11 +00:00
|
|
|
meta = {
|
2010-01-21 14:39:53 +00:00
|
|
|
description = "ANSI C implementations of Levenberg-Marquardt, usable also from C++";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.ics.forth.gr/~lourakis/levmar/";
|
2021-01-21 17:00:13 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2021-03-11 18:49:46 +00:00
|
|
|
platforms = lib.platforms.all;
|
2010-01-21 14:39:53 +00:00
|
|
|
};
|
|
|
|
}
|