commit:     7ca7f0f5f2e4a32ee7b81740b5c6734da468d3ee
Author:     Yixun Lan <dlan <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 24 00:34:42 2024 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Tue Sep 24 00:36:25 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ca7f0f5

app-text/sdcv: add 0.5.5

Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 app-text/sdcv/Manifest                            |  1 +
 app-text/sdcv/files/sdcv-0.5.5-read-history.patch | 23 +++++++
 app-text/sdcv/sdcv-0.5.5.ebuild                   | 74 +++++++++++++++++++++++
 3 files changed, 98 insertions(+)

diff --git a/app-text/sdcv/Manifest b/app-text/sdcv/Manifest
index 0425d328344b..7b40988ae61d 100644
--- a/app-text/sdcv/Manifest
+++ b/app-text/sdcv/Manifest
@@ -1 +1,2 @@
 DIST sdcv-0.5.4.tar.gz 66706 BLAKE2B 
9cb481f497483b502bec18765b9cbc31e8dd278e30ebd29005158a724669e171181a82c837b63016b9e88a84973831587d2b137bbbdb2290a89a73d3f0917f81
 SHA512 
6bae3a2c0f37ed9380f54715626efeea0df75d2525baa583c0915bba4d082d9ece40ee799a1e1bb5d36b7ccebace853653b6fab57d472a432b910f690235ee21
+DIST sdcv-0.5.5.tar.gz 67016 BLAKE2B 
8a563b042e98af487dc4acfd9b158be72bebf3162ccdef48d3c4418fc548ce4ac9ba048e5fe44de2e6eb8b18d723be95c809a8de99d2dd40ff5a82362a608300
 SHA512 
6059e1ddc43a023f7cb0e2a8d99929bcb204c211863fce4dece2dc30b92e7d1ce91bc25d2ed4bc54b713f61671264ac7e906d2b9ce078fa943cc5d81cd5d37dd

diff --git a/app-text/sdcv/files/sdcv-0.5.5-read-history.patch 
b/app-text/sdcv/files/sdcv-0.5.5-read-history.patch
new file mode 100644
index 000000000000..fff601b29874
--- /dev/null
+++ b/app-text/sdcv/files/sdcv-0.5.5-read-history.patch
@@ -0,0 +1,23 @@
+Subject: [PATCH] fix: read_history() multiple times will add repeat histories 
to history lists
+
+backport from upstream
+---
+ src/libwrapper.cpp | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/libwrapper.cpp b/src/libwrapper.cpp
+index 6be59c5..80077ac 100644
+--- a/src/libwrapper.cpp
++++ b/src/libwrapper.cpp
+@@ -415,10 +415,9 @@ search_result Library::process_phrase(const char 
*loc_str, IReadLine &io, bool f
+                        colorize_output_ ? ESC_END : "");
+             }
+             int choise;
+-            std::unique_ptr<IReadLine> 
choice_readline(create_readline_object());
+             for (;;) {
+                 std::string str_choise;
+-                choice_readline->read(_("Your choice[-1 to abort]: "), 
str_choise);
++                io.read(_("Your choice[-1 to abort]: "), str_choise);
+                 sscanf(str_choise.c_str(), "%d", &choise);
+                 if (choise >= 0 && choise < int(res_list.size())) {
+                     sdcv_pager pager;

diff --git a/app-text/sdcv/sdcv-0.5.5.ebuild b/app-text/sdcv/sdcv-0.5.5.ebuild
new file mode 100644
index 000000000000..565d95a6c4f3
--- /dev/null
+++ b/app-text/sdcv/sdcv-0.5.5.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PLOCALES="cs fr ru sk uk zh_CN zh_TW"
+inherit cmake plocale
+
+DESCRIPTION="Console version of Stardict program"
+HOMEPAGE="https://dushistov.github.io/sdcv/";
+SRC_URI="https://github.com/Dushistov/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
+IUSE="darkterm nls readline test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       >=dev-libs/glib-2.36
+       sys-libs/zlib
+       readline? ( sys-libs/readline:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       nls? ( >=sys-devel/gettext-0.14.1 )
+       test? ( app-misc/jq )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-0.5.3-t_list.patch"
+       "${FILESDIR}/${PN}-t_interactive.patch"
+       "${FILESDIR}/${P}-read-history.patch"
+)
+
+src_prepare() {
+       if use darkterm; then
+               sed -i 's/;34m/;36m/' src/libwrapper.cpp || die
+       fi
+
+       rm_loc() {
+               rm "po/${1}.po" || die
+       }
+       plocale_for_each_disabled_locale rm_loc
+
+       # do not install locale-specific man pages unless asked to
+       if ! has uk ${LINGUAS-uk}; then
+               sed -ni '/share\/man\/uk/!p' CMakeLists.txt || die
+       fi
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DENABLE_NLS="$(usex nls)"
+               -DWITH_READLINE="$(usex readline)"
+               -DBUILD_TESTS="$(usex test ON OFF)"
+       )
+       cmake_src_configure
+}
+
+src_compile() {
+       cmake_src_compile
+       use nls && cmake_src_compile lang
+}
+
+src_install() {
+       # with USE=nls, but empty intersection of LINGUAS and list of
+       # supported translations, this directory is required, see bug 583386
+       mkdir -p "${BUILD_DIR}/locale"
+       cmake_src_install
+       dodoc doc/DICTFILE_FORMAT
+}

Reply via email to