diff options
Diffstat (limited to 'net-irc/znc/files')
-rw-r--r-- | net-irc/znc/files/README.gentoo-r1 | 8 | ||||
-rw-r--r-- | net-irc/znc/files/znc-1.8.2-add-libera.patch | 55 | ||||
-rw-r--r-- | net-irc/znc/files/znc-1.8.2-fix-odr-violation.patch | 56 | ||||
-rw-r--r-- | net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch | 31 | ||||
-rw-r--r-- | net-irc/znc/files/znc-1.8.2-fix-swig-2.patch | 123 | ||||
-rw-r--r-- | net-irc/znc/files/znc-1.8.2-fix-swig.patch | 43 | ||||
-rw-r--r-- | net-irc/znc/files/znc-1.8.2-fix-systemd-datadir.patch | 23 | ||||
-rw-r--r-- | net-irc/znc/files/znc-1.9.0-skip-modperl-modpython-tests-cleaner.patch | 248 |
8 files changed, 583 insertions, 4 deletions
diff --git a/net-irc/znc/files/README.gentoo-r1 b/net-irc/znc/files/README.gentoo-r1 index ca41e4dac26b..8fa94e2f0775 100644 --- a/net-irc/znc/files/README.gentoo-r1 +++ b/net-irc/znc/files/README.gentoo-r1 @@ -1,15 +1,15 @@ To run znc as a user, run 'znc --makeconf' to create a configuration file. -To configure the system-wide daemon, you may run 'emerge --config znc'. +To configure the system-wide daemon, you may run 'emerge --config net-irc/znc'. If migrating from a user-based install, you can copy the existing configuration files: - # mkdir /var/lib/znc # mv /home/$USER/.znc/* /var/lib/znc # rm -rf /home/$USER/.znc # chown -R znc:znc /var/lib/znc OpenRC users may also adjust the location of the files and the user running -znc in /etc/conf.d/znc instead. Systemd users may have to overwrite the -existing unit file. +znc in /etc/conf.d/znc instead. +The same thing can be achieved for systemd by overriding the existing +unit file (systemctl edit znc.service). diff --git a/net-irc/znc/files/znc-1.8.2-add-libera.patch b/net-irc/znc/files/znc-1.8.2-add-libera.patch new file mode 100644 index 000000000000..e7015754d8c1 --- /dev/null +++ b/net-irc/znc/files/znc-1.8.2-add-libera.patch @@ -0,0 +1,55 @@ +From 15e2351d40763acee5d246df7c725c3bd259c304 Mon Sep 17 00:00:00 2001 +From: Alexey Sokolov <alexey+znc@asokolov.org> +Date: Wed, 26 May 2021 10:10:20 +0100 +Subject: [PATCH] Switch --makeconf wizard from freenode to libera + +--- + src/znc.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/znc.cpp b/src/znc.cpp +index c5ad17dc69..365367545a 100644 +--- a/src/znc.cpp ++++ b/src/znc.cpp +@@ -778,7 +778,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { + CUtils::PrintMessage(""); + + do { +- CUtils::GetInput("Name", sNetwork, "freenode"); ++ CUtils::GetInput("Name", sNetwork, "libera"); + } while (!CIRCNetwork::IsValidNetwork(sNetwork)); + + vsLines.push_back("\t<Network " + sNetwork + ">"); +@@ -795,8 +795,8 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) { + bool bSSL = false; + unsigned int uServerPort = 0; + +- if (sNetwork.Equals("freenode")) { +- sHost = "chat.freenode.net"; ++ if (sNetwork.Equals("libera")) { ++ sHost = "irc.libera.chat"; + #ifdef HAVE_LIBSSL + bSSL = true; + #endif +From 688645413c258f1fe42a39e42e5b5d1dead03d71 Mon Sep 17 00:00:00 2001 +From: Alexey Sokolov <alexey+znc@asokolov.org> +Date: Fri, 18 Jun 2021 21:20:53 +0100 +Subject: [PATCH] Fix integration test after switch to libera + +--- + test/integration/framework/znctest.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/integration/framework/znctest.cpp b/test/integration/framework/znctest.cpp +index 195b6083a9..40dae85fc2 100644 +--- a/test/integration/framework/znctest.cpp ++++ b/test/integration/framework/znctest.cpp +@@ -39,7 +39,7 @@ void WriteConfig(QString path) { + p.ReadUntil("Real name"); p.Write(); + p.ReadUntil("Bind host"); p.Write(); + p.ReadUntil("Set up a network?"); p.Write(); +- p.ReadUntil("Name [freenode]"); p.Write("test"); ++ p.ReadUntil("Name [libera]"); p.Write("test"); + p.ReadUntil("Server host (host only)"); p.Write("127.0.0.1"); + p.ReadUntil("Server uses SSL?"); p.Write(); + p.ReadUntil("6667"); p.Write(); diff --git a/net-irc/znc/files/znc-1.8.2-fix-odr-violation.patch b/net-irc/znc/files/znc-1.8.2-fix-odr-violation.patch new file mode 100644 index 000000000000..967d6e35c2ea --- /dev/null +++ b/net-irc/znc/files/znc-1.8.2-fix-odr-violation.patch @@ -0,0 +1,56 @@ +From 3e45b2f35f194100ec3293c7f3e36f95f48b0cb8 Mon Sep 17 00:00:00 2001 +From: Uli Schlachter <psychon@znc.in> +Date: Fri, 5 Aug 2022 16:12:40 +0200 +Subject: [PATCH] Fix an ODR violation + +Building with CFLAGS="-flto -Werror=odr -Werror=lto-type-mismatch +-Werror=strict-aliasing" CXXFLAGS="-flto -Werror=odr +-Werror=lto-type-mismatch -Werror=strict-aliasing" LDFLAGS=-flto fails +due to a violation of the one definition rule. There are two different +definitions of TOption that are both linked into the znc binary. + +Fix this by putting them into anonymous namespaces. + +Fixes: https://github.com/znc/znc/issues/1834 +Signed-off-by: Uli Schlachter <psychon@znc.in> +--- + src/IRCNetwork.cpp | 2 ++ + src/User.cpp | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp +index 46a2481a49..99f9242907 100644 +--- a/src/IRCNetwork.cpp ++++ b/src/IRCNetwork.cpp +@@ -363,11 +363,13 @@ CString CIRCNetwork::GetNetworkPath() const { + return sNetworkPath; + } + ++namespace { + template <class T> + struct TOption { + const char* name; + void (CIRCNetwork::*pSetter)(T); + }; ++} + + bool CIRCNetwork::ParseConfig(CConfig* pConfig, CString& sError, + bool bUpgrade) { +diff --git a/src/User.cpp b/src/User.cpp +index 2ab5fac66f..16624adbbe 100644 +--- a/src/User.cpp ++++ b/src/User.cpp +@@ -135,11 +135,13 @@ CUser::~CUser() { + CZNC::Get().AddBytesWritten(m_uBytesWritten); + } + ++namespace { + template <class T> + struct TOption { + const char* name; + void (CUser::*pSetter)(T); + }; ++} + + bool CUser::ParseConfig(CConfig* pConfig, CString& sError) { + TOption<const CString&> StringOptions[] = { diff --git a/net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch b/net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch new file mode 100644 index 000000000000..fe40d190d1ba --- /dev/null +++ b/net-irc/znc/files/znc-1.8.2-fix-python-3.10.patch @@ -0,0 +1,31 @@ +From e8ff16123582eb9d5c321f5c7e652335abfba368 Mon Sep 17 00:00:00 2001 +From: Alexey Sokolov <alexey+znc@asokolov.org> +Date: Sat, 23 May 2020 13:28:13 +0100 +Subject: [PATCH] Fix PY_SSIZE_T_CLEAN python warning + +--- + .travis.yml | 2 +- + modules/modpython.cpp | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/modules/modpython.cpp b/modules/modpython.cpp +index dfe53b5b6b..7bc76fc5c1 100644 +--- a/modules/modpython.cpp ++++ b/modules/modpython.cpp +@@ -14,6 +14,7 @@ + * limitations under the License. + */ + ++#define PY_SSIZE_T_CLEAN + #include <Python.h> + + #include <znc/Chan.h> +@@ -455,7 +456,7 @@ CBSOCK(ConnectionRefused); + void CPySocket::ReadData(const char* data, size_t len) { + PyObject* pyRes = + PyObject_CallMethod(m_pyObj, const_cast<char*>("OnReadData"), +- const_cast<char*>("y#"), data, (int)len); ++ const_cast<char*>("y#"), data, (Py_ssize_t)len); + CHECKCLEARSOCK("OnReadData"); + } + diff --git a/net-irc/znc/files/znc-1.8.2-fix-swig-2.patch b/net-irc/znc/files/znc-1.8.2-fix-swig-2.patch new file mode 100644 index 000000000000..91d7f5657cbe --- /dev/null +++ b/net-irc/znc/files/znc-1.8.2-fix-swig-2.patch @@ -0,0 +1,123 @@ +From 3f4c1cce77cbe1337e5642e9e0e9d048c9e07370 Mon Sep 17 00:00:00 2001 +From: Alexey Sokolov <alexey+znc@asokolov.org> +Date: Fri, 5 Jan 2024 02:19:55 +0000 +Subject: [PATCH] Fix build with SWIG 4.2.0 + +https://bugs.gentoo.org/921230 +--- + modules/modpython/codegen.pl | 88 ++++++++++++++++++++++++++---------- + 1 file changed, 65 insertions(+), 23 deletions(-) + +diff --git a/modules/modpython/codegen.pl b/modules/modpython/codegen.pl +index 1bc09806e0..bbcb148bed 100755 +--- a/modules/modpython/codegen.pl ++++ b/modules/modpython/codegen.pl +@@ -50,29 +50,6 @@ + ***************************************************************************/ + + namespace { +-/* template<class T> +- struct pyobj_to_ptr { +- CString m_sType; +- SvToPtr(const CString& sType) { +- m_sType = sType; +- } +- bool operator()(PyObject* py, T** result) { +- T* x = nullptr; +- int res = SWIG_ConvertPtr(sv, (void**)&x, SWIG_TypeQuery(m_sType.c_str()), 0); +- if (SWIG_IsOK(res)) { +- *result = x; +- return true; +- } +- DEBUG("modpython: "); +- return false; +- } +- }; +- +- CModule::EModRet SvToEModRet(PyObject* py, CModule::EModRet* result) { +- long int x = PyLong_AsLong(); +- return static_cast<CModule::EModRet>(SvUV(sv)); +- }*/ +- + inline swig_type_info* SWIG_pchar_descriptor(void) { + static int init = 0; + static swig_type_info* info = 0; +@@ -83,6 +60,70 @@ + return info; + } + ++// SWIG 4.2.0 replaced SWIG_Python_str_AsChar with SWIG_PyUnicode_AsUTF8AndSize. ++// SWIG doesn't provide any good way to detect SWIG version (other than parsing ++// `swig -version`), but it also introduced SWIG_NULLPTR. ++// So let's abuse that define to do different code for new SWIG. ++#ifdef SWIG_NULLPTR ++ // This is copied from some SWIG 4.2.0 from pystrings.swg ++ inline int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { ++#if PY_VERSION_HEX>=0x03000000 ++#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) ++ if (PyBytes_Check(obj)) ++#else ++ if (PyUnicode_Check(obj)) ++#endif ++#else ++ if (PyString_Check(obj)) ++#endif ++ { ++ char *cstr; Py_ssize_t len; ++ PyObject *bytes = NULL; ++ int ret = SWIG_OK; ++ if (alloc) ++ *alloc = SWIG_OLDOBJ; ++#if PY_VERSION_HEX>=0x03000000 && defined(SWIG_PYTHON_STRICT_BYTE_CHAR) ++ if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1) ++ return SWIG_TypeError; ++#else ++ cstr = (char *)SWIG_PyUnicode_AsUTF8AndSize(obj, &len, &bytes); ++ if (!cstr) ++ return SWIG_TypeError; ++ /* The returned string is only duplicated if the char * returned is not owned and memory managed by obj */ ++ if (bytes && cptr) { ++ if (alloc) { ++ //cstr = %new_copy_array(cstr, len + 1, char); ++ cstr = (char *)memcpy((char *)malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); ++ *alloc = SWIG_NEWOBJ; ++ } else { ++ /* alloc must be set in order to clean up allocated memory */ ++ return SWIG_RuntimeError; ++ } ++ } ++#endif ++ if (cptr) *cptr = cstr; ++ if (psize) *psize = len + 1; ++ Py_XDECREF(bytes); ++ return ret; ++ } else { ++ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); ++ if (pchar_descriptor) { ++ void* vptr = 0; ++ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { ++ if (cptr) *cptr = (char *) vptr; ++ if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; ++ if (alloc) *alloc = SWIG_OLDOBJ; ++ return SWIG_OK; ++ } ++ } ++ } ++ return SWIG_TypeError; ++ } ++ ++#else ++ // TODO: at some point drop support for SWIG<4.2.0 (drop this branch of ifdef) ++ ++ // This is copied from some old SWIG version from pystrings.swg + inline int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { + #if PY_VERSION_HEX>=0x03000000 + if (PyUnicode_Check(obj)) +@@ -155,6 +196,7 @@ + } + return SWIG_TypeError; + } ++#endif + + inline int SWIG_AsPtr_CString (PyObject * obj, CString **val) { + char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ; diff --git a/net-irc/znc/files/znc-1.8.2-fix-swig.patch b/net-irc/znc/files/znc-1.8.2-fix-swig.patch new file mode 100644 index 000000000000..d07d136c5940 --- /dev/null +++ b/net-irc/znc/files/znc-1.8.2-fix-swig.patch @@ -0,0 +1,43 @@ +From fecdd9895894b3afe903021b0843a422eb4d3308 Mon Sep 17 00:00:00 2001 +From: Alexey Sokolov <alexey+znc@asokolov.org> +Date: Sat, 5 Nov 2022 12:54:40 +0000 +Subject: [PATCH] Add support SWIG 4.1.0, drop support for < 4.0.1 + +https://bugs.gentoo.org/878587 +--- + CMakeLists.txt | 2 +- + modules/modperl/CMakeLists.txt | 1 - + modules/modpython/CMakeLists.txt | 1 - + 3 files changed, 1 insertion(+), 3 deletions(-) + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -173,7 +173,7 @@ if(WANT_PYTHON AND NOT EXISTS + endif() + endif() + if(search_swig) +- find_package(SWIG 3.0.0) ++ find_package(SWIG 4.0.1) + if(NOT SWIG_FOUND) + message(FATAL_ERROR + "Can't find SWIG, therefore Perl and Python aren't supported. " +--- a/modules/modperl/CMakeLists.txt ++++ b/modules/modperl/CMakeLists.txt +@@ -53,7 +53,6 @@ if(SWIG_FOUND) + "-I${PROJECT_SOURCE_DIR}/include" + "-I${CMAKE_CURRENT_SOURCE_DIR}/.." + "-I${CMAKE_CURRENT_SOURCE_DIR}/include" +- -DZNC_EXPORT_LIB_EXPORT + -outdir "${CMAKE_CURRENT_BINARY_DIR}" + -o "${CMAKE_CURRENT_BINARY_DIR}/modperl_biglib.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/modperl.i" +--- a/modules/modpython/CMakeLists.txt ++++ b/modules/modpython/CMakeLists.txt +@@ -50,7 +50,6 @@ if(SWIG_FOUND) + "-I${PROJECT_BINARY_DIR}/include" + "-I${PROJECT_SOURCE_DIR}/include" + "-I${CMAKE_CURRENT_SOURCE_DIR}/.." +- -DZNC_EXPORT_LIB_EXPORT + -outdir "${CMAKE_CURRENT_BINARY_DIR}" + -o "${CMAKE_CURRENT_BINARY_DIR}/modpython_biglib.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/modpython.i" diff --git a/net-irc/znc/files/znc-1.8.2-fix-systemd-datadir.patch b/net-irc/znc/files/znc-1.8.2-fix-systemd-datadir.patch new file mode 100644 index 000000000000..06dd6991b4a4 --- /dev/null +++ b/net-irc/znc/files/znc-1.8.2-fix-systemd-datadir.patch @@ -0,0 +1,23 @@ +From d4bfd143b4b12f6e6695878cc1b5168cc31c362c Mon Sep 17 00:00:00 2001 +From: Alexey Sokolov <alexey+znc@asokolov.org> +Date: Tue, 22 Sep 2020 10:20:47 +0100 +Subject: [PATCH] Fix path in systemd service (which shouldn't be here at all) + +https://bugs.gentoo.org/743856 +--- + znc.service.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/znc.service.in b/znc.service.in +index a6c9e68df..7accad906 100644 +--- a/znc.service.in ++++ b/znc.service.in +@@ -3,7 +3,7 @@ Description=ZNC, an advanced IRC bouncer + After=network.target + + [Service] +-ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/znc -f ++ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/znc -f --datadir=/var/lib/znc + User=znc + + [Install] diff --git a/net-irc/znc/files/znc-1.9.0-skip-modperl-modpython-tests-cleaner.patch b/net-irc/znc/files/znc-1.9.0-skip-modperl-modpython-tests-cleaner.patch new file mode 100644 index 000000000000..fae99b5d6583 --- /dev/null +++ b/net-irc/znc/files/znc-1.9.0-skip-modperl-modpython-tests-cleaner.patch @@ -0,0 +1,248 @@ +https://github.com/znc/znc/commit/f8552fc814ebe662a9fc16d6cafa1c0314498971 + +From f8552fc814ebe662a9fc16d6cafa1c0314498971 Mon Sep 17 00:00:00 2001 +From: Alexey Sokolov <alexey+znc@asokolov.org> +Date: Sun, 25 Feb 2024 14:12:53 +0000 +Subject: [PATCH] Skip modperl/modpython tests cleaner + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -411,6 +411,8 @@ else() + endif() + + configure_file("include/znc/zncconfig.h.cmake.in" "include/znc/zncconfig.h") ++configure_file("test/integration/znctestconfig.h.cmake.in" ++ "test/integration/znctestconfig.h") + add_subdirectory(include) + add_subdirectory(src) + add_subdirectory(modules) +--- a/test/integration/CMakeLists.txt ++++ b/test/integration/CMakeLists.txt +@@ -45,6 +45,7 @@ add_executable(inttest + target_link_libraries(inttest Qt5::Network Threads::Threads) + target_include_directories(inttest PUBLIC + "${PROJECT_SOURCE_DIR}/framework" ++ "${PROJECT_BINARY_DIR}" + "${GTEST_ROOT}" "${GTEST_ROOT}/include" + "${GMOCK_ROOT}" "${GMOCK_ROOT}/include") + target_compile_definitions(inttest PRIVATE +--- a/test/integration/tests/core.cpp ++++ b/test/integration/tests/core.cpp +@@ -14,9 +14,11 @@ + * limitations under the License. + */ + ++#include <gtest/gtest.h> + #include <gmock/gmock.h> + + #include "znctest.h" ++#include "znctestconfig.h" + + using testing::HasSubstr; + using testing::ContainsRegex; +@@ -584,10 +586,9 @@ TEST_P(AllLanguages, ServerDependentCapInModule) { + )"); + break; + case 2: +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } ++#ifndef WANT_PYTHON ++ GTEST_SKIP() << "Modpython is disabled"; ++#endif + znc->CanLeak(); + InstallModule("testmod.py", R"( + import znc +@@ -603,10 +604,9 @@ TEST_P(AllLanguages, ServerDependentCapInModule) { + client.Write("znc loadmod modpython"); + break; + case 3: +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } ++#ifndef WANT_PERL ++ GTEST_SKIP() << "Modperl is disabled"; ++#endif + znc->CanLeak(); + InstallModule("testmod.pm", R"( + package testmod; +--- a/test/integration/tests/scripting.cpp ++++ b/test/integration/tests/scripting.cpp +@@ -15,15 +15,15 @@ + */ + + #include "znctest.h" ++#include "znctestconfig.h" + + namespace znc_inttest { + namespace { + + TEST_F(ZNCTest, Modperl) { +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } ++#ifndef WANT_PERL ++ GTEST_SKIP() << "Modperl is disabled"; ++#endif + auto znc = Run(); + znc->CanLeak(); + auto ircd = ConnectIRCd(); +@@ -37,10 +37,9 @@ TEST_F(ZNCTest, Modperl) { + } + + TEST_F(ZNCTest, Modpython) { +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } ++#ifndef WANT_PYTHON ++ GTEST_SKIP() << "Modpython is disabled"; ++#endif + auto znc = Run(); + znc->CanLeak(); + auto ircd = ConnectIRCd(); +@@ -65,10 +64,9 @@ TEST_F(ZNCTest, Modpython) { + } + + TEST_F(ZNCTest, ModpythonSocket) { +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } ++#ifndef WANT_PYTHON ++ GTEST_SKIP() << "Modpython is disabled"; ++#endif + auto znc = Run(); + znc->CanLeak(); + +@@ -107,10 +105,9 @@ TEST_F(ZNCTest, ModpythonSocket) { + } + + TEST_F(ZNCTest, ModperlSocket) { +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } ++#ifndef WANT_PERL ++ GTEST_SKIP() << "Modperl is disabled"; ++#endif + auto znc = Run(); + znc->CanLeak(); + +@@ -160,10 +157,9 @@ TEST_F(ZNCTest, ModperlSocket) { + } + + TEST_F(ZNCTest, ModpythonVCString) { +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } ++#ifndef WANT_PYTHON ++ GTEST_SKIP() << "Modpython is disabled"; ++#endif + auto znc = Run(); + znc->CanLeak(); + +@@ -185,10 +181,9 @@ TEST_F(ZNCTest, ModpythonVCString) { + } + + TEST_F(ZNCTest, ModperlVCString) { +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } ++#ifndef WANT_PERL ++ GTEST_SKIP() << "Modperl is disabled"; ++#endif + auto znc = Run(); + znc->CanLeak(); + +@@ -214,10 +209,9 @@ TEST_F(ZNCTest, ModperlVCString) { + } + + TEST_F(ZNCTest, ModperlNV) { +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } ++#ifndef WANT_PERL ++ GTEST_SKIP() << "Modperl is disabled"; ++#endif + auto znc = Run(); + znc->CanLeak(); + +@@ -244,10 +238,9 @@ TEST_F(ZNCTest, ModperlNV) { + } + + TEST_F(ZNCTest, ModpythonPackage) { +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } ++#ifndef WANT_PYTHON ++ GTEST_SKIP() << "Modpython is disabled"; ++#endif + auto znc = Run(); + znc->CanLeak(); + +@@ -285,10 +278,12 @@ TEST_F(ZNCTest, ModpythonPackage) { + } + + TEST_F(ZNCTest, ModpythonModperl) { +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } ++#ifndef WANT_PYTHON ++ GTEST_SKIP() << "Modpython is disabled"; ++#endif ++#ifndef WANT_PERL ++ GTEST_SKIP() << "Modperl is disabled"; ++#endif + auto znc = Run(); + znc->CanLeak(); + +@@ -302,11 +297,9 @@ TEST_F(ZNCTest, ModpythonModperl) { + } + + TEST_F(ZNCTest, ModpythonCommand) { +- if (QProcessEnvironment::systemEnvironment().value( +- "DISABLED_ZNC_PERL_PYTHON_TEST") == "1") { +- return; +- } +- ++#ifndef WANT_PYTHON ++ GTEST_SKIP() << "Modpython is disabled"; ++#endif + auto znc = Run(); + znc->CanLeak(); + +--- /dev/null ++++ b/test/integration/znctestconfig.h.cmake.in +@@ -0,0 +1,23 @@ ++/* ++ * Copyright (C) 2004-2024 ZNC, see the NOTICE file for details. ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#ifndef ZNCTESTCONFIG_H ++#define ZNCTESTCONFIG_H ++ ++#cmakedefine WANT_PYTHON 1 ++#cmakedefine WANT_PERL 1 ++ ++#endif /* ZNCTESTCONFIG_H */ |