2018-10-25 06:14:42 +01:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, google-gflags, which
|
|
|
|
, lsb-release, glog, protobuf, cbc, zlib }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "or-tools-${version}";
|
2018-12-01 01:09:06 +00:00
|
|
|
version = "v6.10";
|
2018-10-25 06:14:42 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "or-tools";
|
|
|
|
rev = version;
|
2018-12-01 01:09:06 +00:00
|
|
|
sha256 = "11k3671rpv968dsglc6bgarr9yi8ijaaqm2wq3m0rn4wy8fj7za2";
|
2018-10-25 06:14:42 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# The original build system uses cmake which does things like pull
|
|
|
|
# in dependencies through git and Makefile creation time. We
|
|
|
|
# obviously don't want to do this so instead we provide the
|
|
|
|
# dependencies straight from nixpkgs and use the make build method.
|
|
|
|
configurePhase = ''
|
|
|
|
cat <<EOF > Makefile.local
|
|
|
|
UNIX_GFLAGS_DIR=${google-gflags}
|
|
|
|
UNIX_GLOG_DIR=${glog}
|
|
|
|
UNIX_PROTOBUF_DIR=${protobuf}
|
|
|
|
UNIX_CBC_DIR=${cbc}
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
2018-12-01 01:18:32 +00:00
|
|
|
makeFlags = [ "prefix=${placeholder "out"}" ];
|
|
|
|
buildFlags = [ "cc" ];
|
2018-10-25 06:14:42 +01:00
|
|
|
|
2018-12-01 01:18:32 +00:00
|
|
|
installTargets = [ "install_cc" ];
|
2018-10-25 06:14:42 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake lsb-release which zlib
|
|
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
google-gflags glog protobuf cbc
|
|
|
|
];
|
|
|
|
|
2018-12-01 01:20:25 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-10-25 06:14:42 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://github.com/google/or-tools;
|
|
|
|
license = licenses.asl20;
|
|
|
|
description = ''
|
|
|
|
Google's software suite for combinatorial optimization.
|
|
|
|
'';
|
|
|
|
maintainers = with maintainers; [ fuuzetsu ];
|
|
|
|
platforms = with platforms; linux;
|
|
|
|
};
|
|
|
|
}
|