summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/net-im/spectrum/files/Findjsoncpp.cmake6
-rw-r--r--packages/net-im/spectrum/spectrum.exlib13
2 files changed, 19 insertions, 0 deletions
diff --git a/packages/net-im/spectrum/files/Findjsoncpp.cmake b/packages/net-im/spectrum/files/Findjsoncpp.cmake
new file mode 100644
index 0000000..0df562a
--- /dev/null
+++ b/packages/net-im/spectrum/files/Findjsoncpp.cmake
@@ -0,0 +1,6 @@
+find_package(PkgConfig)
+
+pkg_search_module(JSONCPP REQUIRED jsoncpp)
+
+#hack for non-default variable name
+set(JSONCPP_LIBRARY ${JSONCPP_LIBRARIES})
diff --git a/packages/net-im/spectrum/spectrum.exlib b/packages/net-im/spectrum/spectrum.exlib
index bb3c572..8606612 100644
--- a/packages/net-im/spectrum/spectrum.exlib
+++ b/packages/net-im/spectrum/spectrum.exlib
@@ -65,6 +65,10 @@ if ! ever is_scm; then
DEFAULT_SRC_PREPARE_PATCHES=(
"${FILES}"/6d220b0a083b3adf7fd4ae65ca011b29488493b7.diff
)
+#elif ever at_least 2.0.8; then
+# DEFAULT_SRC_PREPARE_PATCHES=(
+# "${FILES}"/cmake_jsoncpp.patch
+# )
fi
CMAKE_SRC_CONFIGURE_TESTS=( '-DENABLE_TESTS=ON -DENABLE_TESTS=OFF' )
@@ -82,3 +86,12 @@ CMAKE_SRC_CONFIGURE_OPTION_ENABLES=(
CMAKE_SRC_CONFIGURE_PARAMS+=( -DENABLE_XMPP=TRUE )
+if ever at_least 2.0.8; then
+ export_exlib_phases src_prepare
+ spectrum_src_prepare() {
+ # replace complicated broken module by simple pkg-config search
+ # https://github.com/SpectrumIM/spectrum2/issues/300
+ edo rm "${WORKBASE}/${PNV}"/cmake_modules/Findjsoncpp.cmake
+ edo cp "${FILES}"/Findjsoncpp.cmake "${WORKBASE}/${PNV}"/cmake_modules/Findjsoncpp.cmake
+ }
+fi