From 81a14b2a0498128722e66d0f5c632de6b0f4abf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ha=CC=88cker?= Date: Sat, 15 Feb 2025 22:30:40 +0100 Subject: [PATCH] Fix poco build to actually use the nix provided dependencies, and fix the static build that broke as fallout from that --- ...nal-pcre-files-for-non-static-builds.patch | 23 +++++++++++++++++++ pkgs/by-name/po/poco/package.nix | 13 +++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 pkgs/by-name/po/poco/disable-internal-pcre-files-for-non-static-builds.patch diff --git a/pkgs/by-name/po/poco/disable-internal-pcre-files-for-non-static-builds.patch b/pkgs/by-name/po/poco/disable-internal-pcre-files-for-non-static-builds.patch new file mode 100644 index 00000000000000..bdc57a6ce8e3f1 --- /dev/null +++ b/pkgs/by-name/po/poco/disable-internal-pcre-files-for-non-static-builds.patch @@ -0,0 +1,23 @@ +diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +index d5f3b267d..dfaf99a10 100644 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -31,11 +31,13 @@ if(POCO_UNBUNDLED) + find_package(ZLIB REQUIRED) + find_package(Utf8Proc REQUIRED) + +- #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library +- POCO_SOURCES(SRCS RegExp +- src/pcre2_ucd.c +- src/pcre2_tables.c +- ) ++ if(NOT POCO_STATIC AND BUILD_SHARED_LIBS) ++ #HACK: Unicode.cpp requires functions from these files. The can't be taken from the library ++ POCO_SOURCES(SRCS RegExp ++ src/pcre2_ucd.c ++ src/pcre2_tables.c ++ ) ++ endif() + + else() + # pcre2 diff --git a/pkgs/by-name/po/poco/package.nix b/pkgs/by-name/po/poco/package.nix index da238688ca0c9e..ba4777666ec898 100644 --- a/pkgs/by-name/po/poco/package.nix +++ b/pkgs/by-name/po/poco/package.nix @@ -10,6 +10,7 @@ sqlite, openssl, unixODBC, + utf8proc, libmysqlclient, }: @@ -32,6 +33,7 @@ stdenv.mkDerivation rec { buildInputs = [ unixODBC + utf8proc libmysqlclient ]; propagatedBuildInputs = [ @@ -50,8 +52,15 @@ stdenv.mkDerivation rec { MYSQL_DIR = libmysqlclient; MYSQL_INCLUDE_DIR = "${MYSQL_DIR}/include/mysql"; - configureFlags = [ - "--unbundled" + cmakeFlags = [ + # use nix provided versions of sqlite, zlib, pcre, expat, ... instead of bundled versions + "-DPOCO_UNBUNDLED=ON" + ]; + + patches = [ + # poco builds its own version of pcre, disable it + # https://github.com/pocoproject/poco/issues/4871 + ./disable-internal-pcre-files-for-non-static-builds.patch ]; postFixup = ''