7
7
eigen ,
8
8
ensureNewerSourcesForZipFilesHook ,
9
9
fetchFromGitHub ,
10
- substituteAll ,
10
+ fetchpatch ,
11
11
glpk ,
12
12
lib ,
13
13
pkg-config ,
20
20
zlib ,
21
21
} :
22
22
23
- let
24
- pybind11_protobuf = fetchFromGitHub {
25
- owner = "pybind" ;
26
- repo = "pybind11_protobuf" ;
27
- rev = "b713501f1da56d9b76c42f89efd00b97c26c9eac" ;
28
- hash = "sha256-f6pzRWextH+7lm1xzyhx98wCIWH3lbhn59gSCcjsBVw=" ;
29
- } ;
30
- in
31
23
stdenv . mkDerivation rec {
32
24
pname = "or-tools" ;
33
- version = "9.7 " ;
25
+ version = "9.9 " ;
34
26
35
27
src = fetchFromGitHub {
36
28
owner = "google" ;
37
29
repo = "or-tools" ;
38
30
rev = "v${ version } " ;
39
- hash = "sha256-eHukf6TbY2dx7iEf8WfwfWsjDEubPtRO02ju0kHtASo =" ;
31
+ hash = "sha256-Ip2mKl+MuzOPaF1a2FTubqT0tA4gzDnD8dR7dLaHHo8 =" ;
40
32
} ;
41
33
42
34
patches = [
43
- ( substituteAll {
44
- src = ./offline.patch ;
45
- pybind11_protobuf = "../../pybind11_protobuf" ;
35
+ ( fetchpatch {
36
+ name = "0001-Allow-to-use-pybind11-system-packages.patch" ;
37
+ url = "https://build.opensuse.org/public/source/science/google-or-tools/0001-Allow-to-use-pybind11-system-packages.patch?rev=18" ;
38
+ hash = "sha256-+hFgZt9G0EMpMMXA/qnHjOdk6+eIlgV6T0qu36s4Z/Y=" ;
39
+ } )
40
+ ( fetchpatch {
41
+ name = "0001-Do-not-try-to-copy-pybind11_abseil-status-extension-.patch" ;
42
+ url = "https://build.opensuse.org/public/source/science/google-or-tools/0001-Do-not-try-to-copy-pybind11_abseil-status-extension-.patch?rev=18" ;
43
+ hash = "sha256-vAjxUW1SjHRG2mpyjHjrAkyoix1BnGCxzvFDMzRp3Bk=" ;
46
44
} )
47
45
] ;
48
46
49
47
# or-tools normally attempts to build Protobuf for the build platform when
50
48
# cross-compiling. Instead, just tell it where to find protoc.
51
49
postPatch = ''
52
50
echo "set(PROTOC_PRG $(type -p protoc))" > cmake/host.cmake
53
-
54
- cp -R ${ pybind11_protobuf } pybind11_protobuf
55
- chmod -R u+w pybind11_protobuf
56
51
'' ;
57
52
58
53
cmakeFlags = [
59
54
"-DBUILD_DEPS=OFF"
60
55
"-DBUILD_PYTHON=ON"
61
56
"-DBUILD_pybind11=OFF"
62
- "-DBUILD_pybind11_protobuf=ON"
63
57
"-DCMAKE_INSTALL_BINDIR=bin"
64
58
"-DCMAKE_INSTALL_INCLUDEDIR=include"
65
59
"-DCMAKE_INSTALL_LIBDIR=lib"
@@ -96,6 +90,8 @@ stdenv.mkDerivation rec {
96
90
glpk
97
91
python . pkgs . absl-py
98
92
python . pkgs . pybind11
93
+ python . pkgs . pybind11-abseil
94
+ python . pkgs . pybind11-protobuf
99
95
python . pkgs . pytest
100
96
python . pkgs . scipy
101
97
python . pkgs . setuptools
@@ -108,20 +104,14 @@ stdenv.mkDerivation rec {
108
104
protobuf
109
105
( python . pkgs . protobuf4 . override { protobuf = protobuf ; } )
110
106
python . pkgs . numpy
107
+ python . pkgs . pandas
108
+ python . pkgs . immutabledict
111
109
] ;
112
110
nativeCheckInputs = [
113
111
python . pkgs . matplotlib
114
- python . pkgs . pandas
115
112
python . pkgs . virtualenv
116
113
] ;
117
114
118
- env . NIX_CFLAGS_COMPILE = toString [
119
- # fatal error: 'python/google/protobuf/proto_api.h' file not found
120
- "-I${ protobuf . src } "
121
- # fatal error: 'pybind11_protobuf/native_proto_caster.h' file not found
122
- "-I${ pybind11_protobuf } "
123
- ] ;
124
-
125
115
# some tests fail on linux and hang on darwin
126
116
doCheck = false ;
127
117
@@ -150,7 +140,7 @@ stdenv.mkDerivation rec {
150
140
description = ''
151
141
Google's software suite for combinatorial optimization.
152
142
'' ;
153
- mainProgram = "fzn-ortools " ;
143
+ mainProgram = "fzn-cp-sat " ;
154
144
maintainers = with maintainers ; [ andersk ] ;
155
145
platforms = with platforms ; linux ++ darwin ;
156
146
} ;
0 commit comments