3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/science/math/lp_solve/default.nix

53 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, cctools, fixDarwinDylibNames }:
2015-06-20 14:30:03 +01:00
stdenv.mkDerivation rec {
pname = "lp_solve";
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";
sha256 = "sha256-bUq/9cxqqpM66ObBeiJt8PwLZxxDj2lxXUHQn+gfkC8=";
2015-06-20 14:30:03 +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
'';
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;
};
}