Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
41 lines
1.1 KiB
Nix
41 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchurl,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "levmar";
|
|
version = "2.6";
|
|
|
|
src = fetchurl {
|
|
url = "https://www.ics.forth.gr/~lourakis/levmar/levmar-${finalAttrs.version}.tgz";
|
|
hash = "sha256-O/TvHqRHXe1TFejY/Jkqcl8ueUCnTKOw+QKdnm6Uutc=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace levmar.h --replace-fail "define HAVE_LAPACK" "undef HAVE_LAPACK"
|
|
sed -i 's/LAPACKLIBS=.*/LAPACKLIBS=/' Makefile
|
|
substituteInPlace Makefile --replace-fail "gcc" "${stdenv.cc.targetPrefix}cc"
|
|
''
|
|
+ lib.optionalString stdenv.cc.isClang ''
|
|
substituteInPlace compiler.h \
|
|
--replace-fail "#define LM_FINITE finite // ICC, GCC" \
|
|
"#define LM_FINITE isfinite // ICC, GCC"
|
|
'';
|
|
|
|
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;
|
|
maintainers = [ ];
|
|
platforms = lib.platforms.all;
|
|
};
|
|
})
|