git.iko.soy/typeable/nixpkgs
on master help sign in
or-tools: new package (v6.9.1)
commit02fb26136c72dbf942fbd30acb3ed943881ef98c authorMateusz Kowalczyk <mateusz.kowalczyk@tweag.io> dateThu 25 Oct 2018, 14:14 (8 years ago) parent9a2fd03
3 files changed+77
pkgs/development/libraries/science/math/or-tools/default.nix+63 pkgs/development/libraries/science/math/or-tools/gflags-include.patch+12 pkgs/top-level/all-packages.nix+2
pkgs/development/libraries/science/math/or-tools/default.nixnew file+63
@@ -0,0 +1,63 @@
1+{ stdenv, fetchFromGitHub, cmake, google-gflags, which
2+, lsb-release, glog, protobuf, cbc, zlib }:
3+
4+stdenv.mkDerivation rec {
5+ name = "or-tools-${version}";
6+ version = "v6.9.1";
7+
8+ src = fetchFromGitHub {
9+ owner = "google";
10+ repo = "or-tools";
11+ rev = version;
12+ sha256 = "099j1mc7vvry0a2fiz9zvk6divivglzphv48wbw0c6nd5w8hb27c";
13+ };
14+
15+ # The original build system uses cmake which does things like pull
16+ # in dependencies through git and Makefile creation time. We
17+ # obviously don't want to do this so instead we provide the
18+ # dependencies straight from nixpkgs and use the make build method.
19+ configurePhase = ''
20+ cat <<EOF > Makefile.local
21+ UNIX_GFLAGS_DIR=${google-gflags}
22+ UNIX_GLOG_DIR=${glog}
23+ UNIX_PROTOBUF_DIR=${protobuf}
24+ UNIX_CBC_DIR=${cbc}
25+ EOF
26+ '';
27+
28+ buildPhase = ''
29+ make cc
30+ '';
31+
32+ installPhase = ''
33+ make install_cc prefix=$out
34+ '';
35+
36+ patches = [
37+ # In "expected" way of compilation, the glog package is compiled
38+ # with gflags support which then makes gflags header transitively
39+ # included through glog. However in nixpkgs we don't compile glog
40+ # with gflags so we have to include it ourselves. Upstream should
41+ # always include gflags to support both ways I think.
42+ #
43+ # Upstream ticket: https://github.com/google/or-tools/issues/902
44+ ./gflags-include.patch
45+ ];
46+
47+ nativeBuildInputs = [
48+ cmake lsb-release which zlib
49+ ];
50+ propagatedBuildInputs = [
51+ google-gflags glog protobuf cbc
52+ ];
53+
54+ meta = with stdenv.lib; {
55+ homepage = https://github.com/google/or-tools;
56+ license = licenses.asl20;
57+ description = ''
58+ Google's software suite for combinatorial optimization.
59+ '';
60+ maintainers = with maintainers; [ fuuzetsu ];
61+ platforms = with platforms; linux;
62+ };
63+}
pkgs/development/libraries/science/math/or-tools/gflags-include.patchnew file+12
@@ -0,0 +1,12 @@
1+diff --git a/ortools/data/jobshop_scheduling_parser.cc b/ortools/data/jobshop_scheduling_parser.cc
2+index cb0a360b..c2f055eb 100644
3+--- a/ortools/data/jobshop_scheduling_parser.cc
4++++ b/ortools/data/jobshop_scheduling_parser.cc
5+@@ -14,6 +14,7 @@
6+ #include "ortools/data/jobshop_scheduling_parser.h"
7+
8+ #include <cmath>
9++#include <gflags/gflags.h>
10+
11+ #include "google/protobuf/wrappers.pb.h"
12+ #include "ortools/base/filelineiter.h"
pkgs/top-level/all-packages.nix+2
@@ -21189,6 +21189,8 @@ with pkgs;
2118921189
2119021190 nauty = callPackage ../applications/science/math/nauty {};
2119121191
21192+ or-tools = callPackage ../development/libraries/science/math/or-tools {};
21193+
2119221194 rubiks = callPackage ../development/libraries/science/math/rubiks { };
2119321195
2119421196 petsc = callPackage ../development/libraries/science/math/petsc { };