From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BE272158030 for ; Tue, 28 Feb 2023 20:47:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DF983E070D; Tue, 28 Feb 2023 20:47:54 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B7673E070D for ; Tue, 28 Feb 2023 20:47:54 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C1D4C340B4D for ; Tue, 28 Feb 2023 20:47:53 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C0FF775 for ; Tue, 28 Feb 2023 20:47:51 +0000 (UTC) From: "Conrad Kostecki" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Conrad Kostecki" Message-ID: <1677617192.f2af202efb0844fb1dd3b5a00d2865d51ffdeff3.conikost@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-im/spectrum2/files/, net-im/spectrum2/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-im/spectrum2/files/spectrum2-2.1.3-log4cxx-1.0.0.patch net-im/spectrum2/spectrum2-2.1.3-r2.ebuild X-VCS-Directories: net-im/spectrum2/ net-im/spectrum2/files/ X-VCS-Committer: conikost X-VCS-Committer-Name: Conrad Kostecki X-VCS-Revision: f2af202efb0844fb1dd3b5a00d2865d51ffdeff3 X-VCS-Branch: master Date: Tue, 28 Feb 2023 20:47:51 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7f3535b5-ac3d-46eb-82ff-9d54993fac9f X-Archives-Hash: 64c30694bcd836dd7ce74683e86e0726 commit: f2af202efb0844fb1dd3b5a00d2865d51ffdeff3 Author: Conrad Kostecki gentoo org> AuthorDate: Tue Feb 28 20:45:43 2023 +0000 Commit: Conrad Kostecki gentoo org> CommitDate: Tue Feb 28 20:46:32 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2af202e net-im/spectrum2: add log4cxx-1.0.0 support Signed-off-by: Conrad Kostecki gentoo.org> .../files/spectrum2-2.1.3-log4cxx-1.0.0.patch | 63 ++++++++++++ net-im/spectrum2/spectrum2-2.1.3-r2.ebuild | 111 +++++++++++++++++++++ 2 files changed, 174 insertions(+) diff --git a/net-im/spectrum2/files/spectrum2-2.1.3-log4cxx-1.0.0.patch b/net-im/spectrum2/files/spectrum2-2.1.3-log4cxx-1.0.0.patch new file mode 100644 index 000000000000..852f4ad78027 --- /dev/null +++ b/net-im/spectrum2/files/spectrum2-2.1.3-log4cxx-1.0.0.patch @@ -0,0 +1,63 @@ +Description: (newer) Debian log4cxx needs C++17 and used smart pointers. + This patch just enables C++17 for the build and using smart pointers + where needed. +Author: Tobias Frost +Forwarded: not yet. log4cxx 0.14 will come with some preprocessor macros that will enable properly gating the new code. +Last-Update: 2022-11-21 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,7 +2,7 @@ + + project(libtransport) + +-set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD 17) + if(WIN32) + set(CMAKE_CXX_STANDARD 17) + endif(WIN32) +--- a/plugin/cpp/Logging.cpp ++++ b/plugin/cpp/Logging.cpp +@@ -26,6 +26,7 @@ + #include + #include + ++#include + + #include + #include +@@ -100,15 +101,17 @@ + #ifdef _MSC_VER + root->addAppender(new ConsoleAppender(new PatternLayout(L"%d %-5p %c: %m%n"))); + #else +- root->addAppender(new ConsoleAppender(new PatternLayout("%d %-5p %c: %m%n"))); ++ auto patternlayout = std::make_shared("%d %-5p %c: %m%n"); ++ auto consoleappender = std::make_shared(patternlayout); ++ root->addAppender(consoleappender); + #endif + } + else { + log4cxx::helpers::Properties p; + +- log4cxx::helpers::FileInputStream *istream = NULL; ++ log4cxx::helpers::InputStreamPtr istream; + try { +- istream = new log4cxx::helpers::FileInputStream(CONFIG_STRING(config, key)); ++ istream.reset(new log4cxx::helpers::FileInputStream(CONFIG_STRING(config, key))); + } + catch(log4cxx::helpers::IOException &ex) { + std::cerr << "Can't create FileInputStream logger instance: " << ex.what() << "\n"; +--- a/tests/libtransport/main.cpp ++++ b/tests/libtransport/main.cpp +@@ -23,7 +23,9 @@ + #ifdef WITH_LOG4CXX + LoggerPtr root = Logger::getRootLogger(); + #ifndef _MSC_VER +- root->addAppender(new FileAppender(new PatternLayout("%d %-5p %c: %m%n"), "libtransport_test.log", false)); ++ auto patternlayout = std::make_shared("%d %-5p %c: %m%n"); ++ auto fileappender = std::make_shared(patternlayout, "libtransport_test.log", false); ++ root->addAppender(fileappender); + #else + root->addAppender(new FileAppender(new PatternLayout(L"%d %-5p %c: %m%n"), L"libtransport_test.log", false)); + #endif diff --git a/net-im/spectrum2/spectrum2-2.1.3-r2.ebuild b/net-im/spectrum2/spectrum2-2.1.3-r2.ebuild new file mode 100644 index 000000000000..6913f31eba94 --- /dev/null +++ b/net-im/spectrum2/spectrum2-2.1.3-r2.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake systemd tmpfiles + +DESCRIPTION="An open source instant messaging transport" +HOMEPAGE="https://www.spectrum.im" +SRC_URI="https://github.com/SpectrumIM/spectrum2/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64" +IUSE="doc frotz irc mysql postgres purple sms +sqlite test twitter whatsapp xmpp" +REQUIRED_USE=" + || ( mysql postgres sqlite ) + test? ( irc ) +" +RESTRICT="!test? ( test )" + +RDEPEND=" + acct-group/spectrum + acct-user/spectrum + dev-libs/boost:=[nls] + dev-libs/expat + dev-libs/libev:= + >=dev-libs/log4cxx-1.0.0:= + dev-libs/jsoncpp:= + dev-libs/openssl:= + dev-libs/popt + dev-libs/protobuf:= + net-dns/libidn:= + >=net-im/swift-4.0.2-r2:= + net-misc/curl + sys-libs/zlib:= + frotz? ( !games-engines/frotz ) + irc? ( net-im/libcommuni ) + mysql? ( + || ( + dev-db/mariadb-connector-c + dev-db/mysql-connector-c + ) + ) + postgres? ( dev-libs/libpqxx:= ) + purple? ( + dev-libs/glib + net-im/pidgin:= + ) + sms? ( app-mobilephone/smstools ) + sqlite? ( dev-db/sqlite:3 ) + twitter? ( net-misc/curl ) + whatsapp? ( net-im/transwhat )" + +DEPEND=" + ${RDEPEND} + doc? ( app-doc/doxygen ) + test? ( dev-util/cppunit ) +" + +PATCHES=( "${FILESDIR}/${PN}-2.1.3-log4cxx-1.0.0.patch" ) + +src_prepare() { + # Respect users LDFLAGS + sed -i -e "s/-Wl,-export-dynamic/& ${LDFLAGS}/" spectrum/src/CMakeLists.txt || die + + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DENABLE_DOCS="$(usex doc)" + -DENABLE_FROTZ="$(usex frotz)" + -DENABLE_IRC="$(usex irc)" + -DENABLE_MYSQL="$(usex mysql)" + -DENABLE_PQXX="$(usex postgres)" + -DENABLE_PURPLE="$(usex purple)" + $(usex irc '-DENABLE_QT4=OFF' '') + -DENABLE_SMSTOOLS3="$(usex sms)" + -DENABLE_SQLITE3="$(usex sqlite)" + -DENABLE_TESTS="$(usex test)" + -DENABLE_TWITTER="$(usex twitter)" + -DENABLE_XMPP="$(usex xmpp)" + -DLIB_INSTALL_DIR="$(get_libdir)" + ) + + cmake_src_configure +} + +src_test() { + cd "${BUILD_DIR}/tests/libtransport" || die + ./libtransport_test || die +} + +src_install() { + cmake_src_install + + diropts -o spectrum -g spectrum + keepdir /var/log/spectrum2 /var/lib/spectrum2 + diropts + + newinitd "${FILESDIR}"/spectrum2.initd spectrum2 + systemd_newunit "${FILESDIR}"/spectrum2.service spectrum2.service + newtmpfiles "${FILESDIR}"/spectrum2.tmpfiles-r1 spectrum2.conf + + einstalldocs +} + +pkg_postinst() { + tmpfiles_process spectrum2.conf +}