2021-08-14 01:49:15 +01:00
|
|
|
{ lib, stdenv, fetchurl, cctools, fixDarwinDylibNames }:
|
2015-06-20 14:30:03 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "lp_solve";
|
2021-08-14 01:49:15 +01:00
|
|
|
version = "5.5.2.11";
|
2015-06-20 14:30:03 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-05-04 14:17:37 +01:00
|
|
|
url = "mirror://sourceforge/project/lpsolve/lpsolve/${version}/lp_solve_${version}_source.tar.gz";
|
2021-08-14 01:49:15 +01:00
|
|
|
sha256 = "sha256-bUq/9cxqqpM66ObBeiJt8PwLZxxDj2lxXUHQn+gfkC8=";
|
2015-06-20 14:30:03 +01:00
|
|
|
};
|
|
|
|
|
2021-08-14 01:49:15 +01:00
|
|
|
nativeBuildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
cctools
|
|
|
|
fixDarwinDylibNames
|
|
|
|
];
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
buildPhase = let
|
|
|
|
ccc = if stdenv.isDarwin then "ccc.osx" else "ccc";
|
|
|
|
in ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
(cd lpsolve55 && bash -x -e ${ccc})
|
|
|
|
(cd lp_solve && bash -x -e ${ccc})
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -d -m755 $out/bin $out/lib $out/include/lpsolve
|
|
|
|
install -m755 lp_solve/bin/*/lp_solve -t $out/bin
|
|
|
|
install -m644 lpsolve55/bin/*/liblpsolve* -t $out/lib
|
|
|
|
install -m644 lp_*.h -t $out/include/lpsolve
|
|
|
|
|
|
|
|
rm $out/lib/liblpsolve*.a
|
|
|
|
rm $out/include/lpsolve/lp_solveDLL.h # A Windows header
|
|
|
|
|
|
|
|
runHook postInstall
|
2015-06-20 14:30:03 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-05-04 14:03:22 +01:00
|
|
|
description = "A Mixed Integer Linear Programming (MILP) solver";
|
2015-06-20 14:30:03 +01:00
|
|
|
homepage = "http://lpsolve.sourceforge.net";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ smironov ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|