1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PLOCALES="cs fr ru sk uk zh_CN zh_TW"
7 : ${CMAKE_MAKEFILE_GENERATOR:="ninja"}
9 inherit cmake-utils l10n
11 DESCRIPTION="Console version of Stardict program"
12 HOMEPAGE="https://dushistov.github.io/sdcv/"
13 SRC_URI="https://github.com/Dushistov/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
18 IUSE="darkterm nls readline test"
19 RESTRICT="!test? ( test )"
24 readline? ( sys-libs/readline:= )
27 nls? ( >=sys-devel/gettext-0.14.1 )
32 "${FILESDIR}/${PN}-t_list.patch"
33 "${FILESDIR}/${PN}-t_interactive.patch"
38 sed -i 's/;34m/;36m/' src/libwrapper.cpp || die
42 rm "po/${1}.po" || die
44 l10n_for_each_disabled_locale_do rm_loc
46 # do not install locale-specific man pages unless asked to
47 if ! has uk ${LINGUAS-uk}; then
48 sed -ni '/share\/man\/uk/!p' CMakeLists.txt || die
51 cmake-utils_src_prepare
56 -DENABLE_NLS="$(usex nls)"
57 -DWITH_READLINE="$(usex readline)"
58 -DBUILD_TESTS="$(usex test ON OFF)"
60 cmake-utils_src_configure
64 cmake-utils_src_compile
65 use nls && cmake-utils_src_compile lang
69 # with USE=nls, but empty intersection of LINGUAS and list of
70 # supported translations, this directory is required, see bug 583386
71 mkdir -p "${BUILD_DIR}/locale"
72 cmake-utils_src_install
73 dodoc doc/DICTFILE_FORMAT