From 738a650ff5247cfbc090df97e64a0b5c70ccd885 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sat, 3 Jan 2026 19:36:32 +0100 Subject: [PATCH] postgresqlPackages.omnigres: fix build with cmake4 --- pkgs/servers/sql/postgresql/ext/omnigres.nix | 33 ++++++++++++++------ 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/pkgs/servers/sql/postgresql/ext/omnigres.nix b/pkgs/servers/sql/postgresql/ext/omnigres.nix index f622001c4d18..5564d58afe0e 100644 --- a/pkgs/servers/sql/postgresql/ext/omnigres.nix +++ b/pkgs/servers/sql/postgresql/ext/omnigres.nix @@ -30,15 +30,30 @@ postgresqlBuildExtension (finalAttrs: { hash = "sha256-RrdtUtrs0Mh1VyMbF89qJhr2fnCVcQy2l1/85/mJ/4Y="; }; - # This matches postInstall of PostgreSQL's generic.nix, which does this for the PGXS Makefile. - # Since omnigres uses a CMake file, which tries to replicate the things that PGXS does, we need - # to apply the same fix for darwin. - # The reason we need to do this is, because PG_BINARY will point at the postgres wrapper of - # postgresql.withPackages, which does not contain the same symbols as the original file, ofc. - postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace "cmake/PostgreSQLExtension.cmake" \ - --replace-fail '-bundle_loader ''${PG_BINARY}' "-bundle_loader ${postgresql}/bin/postgres" - ''; + postPatch = '' + substituteInPlace deps/libfyaml/CMakeLists.txt \ + --replace-fail "cmake_minimum_required(VERSION 3.0)" "cmake_minimum_required(VERSION 3.10)" + substituteInPlace deps/STC/CMakeLists.txt \ + --replace-fail "cmake_minimum_required(VERSION 3.1)" "cmake_minimum_required(VERSION 3.10)" + substituteInPlace deps/wslay/{,lib/}CMakeLists.txt \ + --replace-fail "cmake_minimum_required(VERSION 2.8)" "cmake_minimum_required(VERSION 3.10)" + substituteInPlace deps/h2o/CMakeLists.txt \ + --replace-fail "CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)" "cmake_minimum_required(VERSION 3.10)" + substituteInPlace deps/uriparser/CMakeLists.txt \ + --replace-fail "cmake_minimum_required(VERSION 3.3)" "cmake_minimum_required(VERSION 3.10)" + substituteInPlace deps/metalang99/CMakeLists.txt \ + --replace-fail "cmake_minimum_required(VERSION 3.0.2)" "cmake_minimum_required(VERSION 3.10)" + '' + + + # This matches postInstall of PostgreSQL's generic.nix, which does this for the PGXS Makefile. + # Since omnigres uses a CMake file, which tries to replicate the things that PGXS does, we need + # to apply the same fix for darwin. + # The reason we need to do this is, because PG_BINARY will point at the postgres wrapper of + # postgresql.withPackages, which does not contain the same symbols as the original file, ofc. + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace "cmake/PostgreSQLExtension.cmake" \ + --replace-fail '-bundle_loader ''${PG_BINARY}' "-bundle_loader ${postgresql}/bin/postgres" + ''; strictDeps = true;