From 30f287c28aa53f2ac7e17496959f656677cbab84 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 25 Jan 2026 19:36:58 -0800 Subject: [PATCH 1/2] protobuf-matchers: init at 0.1.1 Signed-off-by: Anders Kaseorg --- pkgs/by-name/pr/protobuf-matchers/package.nix | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 pkgs/by-name/pr/protobuf-matchers/package.nix diff --git a/pkgs/by-name/pr/protobuf-matchers/package.nix b/pkgs/by-name/pr/protobuf-matchers/package.nix new file mode 100644 index 000000000000..c245607cee26 --- /dev/null +++ b/pkgs/by-name/pr/protobuf-matchers/package.nix @@ -0,0 +1,46 @@ +{ + cmake, + fetchFromGitHub, + gtest, + lib, + protobuf, + stdenv, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "protobuf-matchers"; + version = "0.1.1"; + + src = fetchFromGitHub { + owner = "inazarenko"; + repo = "protobuf-matchers"; + tag = "v${finalAttrs.version}"; + hash = "sha256-aIEqmA4JwnGHY80Ehr9tgyxzhAk1nAdiVtPbsI0P0Aw="; + }; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'target_include_directories(protobuf-matchers PUBLIC ''${CMAKE_CURRENT_SOURCE_DIR})' \ + 'target_include_directories(protobuf-matchers PUBLIC $ $)' + echo 'target_sources(protobuf-matchers PUBLIC FILE_SET HEADERS + FILES protobuf-matchers/protocol-buffer-matchers.h)' >> CMakeLists.txt + echo 'install(TARGETS protobuf-matchers + FILE_SET HEADERS DESTINATION include)' >> CMakeLists.txt + ''; + + nativeBuildInputs = [ + cmake + ]; + buildInputs = [ + gtest + protobuf + ]; + + meta = { + description = "Protocol buffer matchers for gMock/gTest"; + homepage = "https://github.com/inazarenko/protobuf-matchers"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ andersk ]; + }; +}) From ab95d7204df93d6f77578336dbc17d28ad06b301 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 26 Jan 2026 17:14:54 -0800 Subject: [PATCH 2/2] =?UTF-8?q?or-tools:=209.14=20=E2=86=92=209.15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders Kaseorg --- pkgs/by-name/or/or-tools/gscip-scip10.patch | 15 ----- pkgs/by-name/or/or-tools/package.nix | 55 ++++++------------- .../by-name/or/or-tools/pybind11-protobuf.nix | 4 +- 3 files changed, 20 insertions(+), 54 deletions(-) delete mode 100644 pkgs/by-name/or/or-tools/gscip-scip10.patch diff --git a/pkgs/by-name/or/or-tools/gscip-scip10.patch b/pkgs/by-name/or/or-tools/gscip-scip10.patch deleted file mode 100644 index 529cb39632bb..000000000000 --- a/pkgs/by-name/or/or-tools/gscip-scip10.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/ortools/gscip/gscip.cc -+++ b/ortools/gscip/gscip.cc -@@ -48,7 +48,13 @@ - #include "scip/cons_indicator.h" - #include "scip/cons_linear.h" - #include "scip/cons_or.h" -+#if SCIP_VERSION_MAJOR >= 10 -+#include "scip/cons_nonlinear.h" -+#define SCIPcreateConsBasicQuadratic SCIPcreateConsBasicQuadraticNonlinear -+#define SCIPcreateConsQuadratic SCIPcreateConsQuadraticNonlinear -+#else - #include "scip/cons_quadratic.h" -+#endif // SCIP_VERSION_MAJOR >= 10 - #include "scip/cons_sos1.h" - #include "scip/cons_sos2.h" diff --git a/pkgs/by-name/or/or-tools/package.nix b/pkgs/by-name/or/or-tools/package.nix index eb334bcd0b4d..abe374ea642f 100644 --- a/pkgs/by-name/or/or-tools/package.nix +++ b/pkgs/by-name/or/or-tools/package.nix @@ -3,7 +3,7 @@ lib, callPackage, - abseil-cpp_202505, + abseil-cpp_202508, bzip2, cbc, cmake, @@ -16,7 +16,8 @@ glpk, highs, pkg-config, - protobuf_31, + protobuf_32, + protobuf-matchers, python3, re2, swig, @@ -32,9 +33,14 @@ let # protobuf. Do not un-pin these, even if you're upgrading them to # what might happen to be the latest version at the current moment; # future upgrades *will* break the build. - abseil-cpp' = abseil-cpp_202505; - protobuf' = protobuf_31.override { abseil-cpp = abseil-cpp'; }; - python-protobuf' = python3.pkgs.protobuf5.override { protobuf = protobuf'; }; + abseil-cpp' = abseil-cpp_202508; + gtest' = gtest.override { + withAbseil = true; + abseil-cpp = abseil-cpp'; + }; + protobuf' = protobuf_32.override { abseil-cpp = abseil-cpp'; }; + protobuf-matchers' = protobuf-matchers.override { protobuf = protobuf'; }; + python-protobuf' = python3.pkgs.protobuf6.override { protobuf = protobuf'; }; pybind11' = callPackage ./pybind11-2.13.6.nix { inherit (python3.pkgs) @@ -76,13 +82,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "or-tools"; - version = "9.14"; + version = "9.15"; src = fetchFromGitHub { owner = "google"; repo = "or-tools"; tag = "v${finalAttrs.version}"; - hash = "sha256-FxKe3uY4L33mavwC2aanji3fY9dPqpkwVqi6PNjovSA="; + hash = "sha256-9+tvgP/+/VY6wu7lzTdP4xfiJIgPSLVR9lEdZjQCZkE="; }; patches = [ @@ -94,40 +100,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-BNB3KlgjpWcZtb9e68Jkc/4xC4K0c+Iisw0eS6ltYXE="; }) ./0001-Fix-up-broken-CMake-rules-for-bundled-pybind-stuff.patch - (fetchpatch { - name = "math_opt-only-run-SCIP-tests-if-enabled.patch"; - url = "https://github.com/google/or-tools/commit/b5a2f8ac40dd4bfa4359c35570733171454ec72b.patch"; - hash = "sha256-h96zJkqTtwfBd+m7Lm9r/ks/n8uvY4iSPgxMZe8vtXI="; - }) - # Fix tests on aarch64-linux - # https://github.com/google/or-tools/issues/4746 - (fetchpatch { - url = "https://github.com/google/or-tools/commit/8442c7b1c219b0c8d58ee96d266d81b7c3a19ad2.patch"; - hash = "sha256-HrV9wU3PFMdb3feGt8i5UJNgHuitMRBF9cNrH5RRENQ="; - }) - # Fix compatibility with highs 1.12.0 - # https://github.com/google/or-tools/issues/4911 - (fetchpatch { - url = "https://github.com/google/or-tools/commit/6c7c1e7cb5bab2701e5b3b00c0f8397273654d2b.patch"; - includes = [ "ortools/math_opt/solvers/highs_solver_test.cc" ]; - hash = "sha256-/dFk/F/3/BwH5IwIwNU4Ua+4sROPXYCjO8R6jpoZpgo="; - }) - # Fix compatibility with SCIP 10.0 - # https://github.com/google/or-tools/issues/4912 - (fetchpatch { - url = "https://github.com/google/or-tools/pull/4932.patch"; - includes = [ "ortools/linear_solver/proto_solver/scip_proto_solver.cc" ]; - hash = "sha256-1jw/r3yAjIpq9o8mqAbNorQgmT1E5nt809N+Gb+D9ZI="; - }) - # Compatibility with SCIP 10.0 also needs the following patch adjusted for or-tools 9.14 - # https://github.com/google/or-tools/pull/4932/files#diff-9559febee3c6051bab4def3c102cb78cbf8a57fc2be4058ace32f89436c784a9 - ./gscip-scip10.patch ]; # or-tools normally attempts to build Protobuf for the build platform when # cross-compiling. Instead, just tell it where to find protoc. postPatch = '' echo "set(PROTOC_PRG $(type -p protoc))" > cmake/host.cmake + substituteInPlace CMakeLists.txt \ + --replace-fail 'set(BUILD_protobuf_matchers ON)' 'set(BUILD_protobuf_matchers OFF)' '' # Patches from OpenSUSE: # https://build.opensuse.org/projects/science/packages/google-or-tools/files/google-or-tools.spec?expand=1 @@ -147,7 +127,6 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") (lib.cmakeBool "FETCH_PYTHON_DEPS" false) # not packaged in nixpkgs - (lib.cmakeBool "USE_fuzztest" false) (lib.cmakeBool "USE_GLPK" true) (lib.cmakeBool "USE_SCIP" withScip) (lib.cmakeFeature "Python3_EXECUTABLE" "${python3.pythonOnBuildForHost.interpreter}") @@ -182,8 +161,9 @@ stdenv.mkDerivation (finalAttrs: { eigen glpk gbenchmark - gtest + gtest' highs + protobuf-matchers' python3.pkgs.absl-py pybind11' pybind11-abseil' @@ -222,6 +202,7 @@ stdenv.mkDerivation (finalAttrs: { doCheck = stdenv.hostPlatform.isLinux; preCheck = '' + patchShebangs examples/python export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib ''; diff --git a/pkgs/by-name/or/or-tools/pybind11-protobuf.nix b/pkgs/by-name/or/or-tools/pybind11-protobuf.nix index a93268e9358d..32947bbc038f 100644 --- a/pkgs/by-name/or/or-tools/pybind11-protobuf.nix +++ b/pkgs/by-name/or/or-tools/pybind11-protobuf.nix @@ -4,7 +4,7 @@ buildPythonPackage, fetchFromGitHub, cmake, - abseil-cpp_202505, + abseil-cpp_202508, protobuf, pybind11, zlib, @@ -36,7 +36,7 @@ buildPythonPackage { nativeBuildInputs = [ cmake ]; buildInputs = [ - abseil-cpp_202505 + abseil-cpp_202508 protobuf pybind11 zlib