Skip to content

Commit

Permalink
Fix poco build to actually use the nix provided dependencies, and fix…
Browse files Browse the repository at this point in the history
… the static build that broke as fallout from that
  • Loading branch information
dwt authored and trofi committed Feb 16, 2025
1 parent 4b5c68c commit 81a14b2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
13 changes: 11 additions & 2 deletions pkgs/by-name/po/poco/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
sqlite,
openssl,
unixODBC,
utf8proc,
libmysqlclient,
}:

Expand All @@ -32,6 +33,7 @@ stdenv.mkDerivation rec {

buildInputs = [
unixODBC
utf8proc
libmysqlclient
];
propagatedBuildInputs = [
Expand All @@ -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 = ''
Expand Down

0 comments on commit 81a14b2

Please sign in to comment.