7
7
eigen ,
8
8
ensureNewerSourcesForZipFilesHook ,
9
9
fetchFromGitHub ,
10
- replaceVars ,
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
- ( replaceVars ./offline.patch {
44
- 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=" ;
45
44
} )
46
45
] ;
47
46
48
47
# or-tools normally attempts to build Protobuf for the build platform when
49
48
# cross-compiling. Instead, just tell it where to find protoc.
50
49
postPatch = ''
51
50
echo "set(PROTOC_PRG $(type -p protoc))" > cmake/host.cmake
52
-
53
- cp -R ${ pybind11_protobuf } pybind11_protobuf
54
- chmod -R u+w pybind11_protobuf
55
51
'' ;
56
52
57
53
cmakeFlags = [
58
54
"-DBUILD_DEPS=OFF"
59
55
"-DBUILD_PYTHON=ON"
60
56
"-DBUILD_pybind11=OFF"
61
- "-DBUILD_pybind11_protobuf=ON"
62
57
"-DCMAKE_INSTALL_BINDIR=bin"
63
58
"-DCMAKE_INSTALL_INCLUDEDIR=include"
64
59
"-DCMAKE_INSTALL_LIBDIR=lib"
@@ -95,6 +90,8 @@ stdenv.mkDerivation rec {
95
90
glpk
96
91
python . pkgs . absl-py
97
92
python . pkgs . pybind11
93
+ python . pkgs . pybind11-abseil
94
+ python . pkgs . pybind11-protobuf
98
95
python . pkgs . pytest
99
96
python . pkgs . scipy
100
97
python . pkgs . setuptools
@@ -107,20 +104,14 @@ stdenv.mkDerivation rec {
107
104
protobuf
108
105
( python . pkgs . protobuf4 . override { protobuf = protobuf ; } )
109
106
python . pkgs . numpy
107
+ python . pkgs . pandas
108
+ python . pkgs . immutabledict
110
109
] ;
111
110
nativeCheckInputs = [
112
111
python . pkgs . matplotlib
113
- python . pkgs . pandas
114
112
python . pkgs . virtualenv
115
113
] ;
116
114
117
- env . NIX_CFLAGS_COMPILE = toString [
118
- # fatal error: 'python/google/protobuf/proto_api.h' file not found
119
- "-I${ protobuf . src } "
120
- # fatal error: 'pybind11_protobuf/native_proto_caster.h' file not found
121
- "-I${ pybind11_protobuf } "
122
- ] ;
123
-
124
115
# some tests fail on linux and hang on darwin
125
116
doCheck = false ;
126
117
@@ -149,7 +140,7 @@ stdenv.mkDerivation rec {
149
140
description = ''
150
141
Google's software suite for combinatorial optimization.
151
142
'' ;
152
- mainProgram = "fzn-ortools " ;
143
+ mainProgram = "fzn-cp-sat " ;
153
144
maintainers = with maintainers ; [ andersk ] ;
154
145
platforms = with platforms ; linux ++ darwin ;
155
146
} ;
0 commit comments