nixpkgs/pkgs/development/libraries/levmar/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
857 B
Nix
Raw Normal View History

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