Gentoo Archives: gentoo-commits

From: Andrey Grozin <grozin@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/coolreader/
Date: Tue, 03 Jan 2023 10:51:39
Message-Id: 1672743075.4e3f6fbe057830f64095775236c95eb2eb061512.grozin@gentoo
1 commit: 4e3f6fbe057830f64095775236c95eb2eb061512
2 Author: Andrey Grozin <grozin <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 3 10:51:15 2023 +0000
4 Commit: Andrey Grozin <grozin <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 3 10:51:15 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e3f6fbe
7
8 app-text/coolreader: depend on wxGTK[X]
9
10 Closes: https://bugs.gentoo.org/888851
11 Signed-off-by: Andrey Grozin <grozin <AT> gentoo.org>
12
13 app-text/coolreader/coolreader-3.2.59-r4.ebuild | 71 +++++++++++++++++++++++++
14 1 file changed, 71 insertions(+)
15
16 diff --git a/app-text/coolreader/coolreader-3.2.59-r4.ebuild b/app-text/coolreader/coolreader-3.2.59-r4.ebuild
17 new file mode 100644
18 index 000000000000..9f5dcc61edec
19 --- /dev/null
20 +++ b/app-text/coolreader/coolreader-3.2.59-r4.ebuild
21 @@ -0,0 +1,71 @@
22 +# Copyright 1999-2023 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +WX_GTK_VER="3.0-gtk3"
27 +PLOCALES="bg cs de es hu pl ru uk"
28 +inherit cmake plocale wxwidgets xdg
29 +
30 +CR_PV=$(ver_rs 3 '-')
31 +SRC_URI="https://github.com/buggins/${PN}/archive/cr${CR_PV}.tar.gz -> ${P}.tar.gz"
32 +S="${WORKDIR}/${PN}-cr${CR_PV}"
33 +
34 +DESCRIPTION="CoolReader - reader of eBook files (fb2,epub,htm,rtf,txt)"
35 +HOMEPAGE="https://github.com/buggins/coolreader/"
36 +
37 +LICENSE="GPL-2"
38 +SLOT="0"
39 +KEYWORDS="amd64 x86"
40 +IUSE="wxwidgets"
41 +
42 +CDEPEND="sys-libs/zlib
43 + app-arch/zstd:=
44 + media-libs/libpng:0
45 + media-libs/libjpeg-turbo
46 + media-libs/freetype
47 + dev-libs/fribidi
48 + media-libs/fontconfig
49 + media-libs/harfbuzz:=
50 + dev-libs/libunibreak:=
51 + dev-libs/libutf8proc:=
52 + wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X] )
53 + !wxwidgets? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtwidgets:5 )"
54 +BDEPEND="${CDEPEND}
55 + !wxwidgets? ( dev-qt/linguist-tools:5 )"
56 +RDEPEND="${CDEPEND}
57 + wxwidgets? ( || ( media-fonts/liberation-fonts media-fonts/corefonts ) )"
58 +
59 +PATCHES=( "${FILESDIR}"/${PN}-wxwidgets.patch )
60 +
61 +src_prepare() {
62 + cmake_src_prepare
63 + xdg_environment_reset
64 +
65 + # locales
66 + plocale_find_changes "${S}"/cr3qt/src/i18n 'cr3_' '.ts'
67 + sed -e "s|SET(LANGUAGES .*)|SET(LANGUAGES $(plocale_get_locales))|" \
68 + -i "${S}"/cr3qt/CMakeLists.txt \
69 + || die "sed CMakeLists.txt failed"
70 +}
71 +
72 +src_configure() {
73 + CMAKE_USE_DIR="${S}"
74 + CMAKE_BUILD_TYPE="Release"
75 + if use wxwidgets; then
76 + setup-wxwidgets
77 + local mycmakeargs=(-DGUI=WX)
78 + else
79 + local mycmakeargs=(-DGUI=QT5)
80 + fi
81 + cmake_src_configure
82 +}
83 +
84 +src_install() {
85 + cmake_src_install
86 + if ! use wxwidgets; then
87 + mv "${D}"/usr/share/doc/cr3/changelog.gz "${D}"/usr/share/doc/${PF}/ || die "mv changelog.gz failed"
88 + rmdir "${D}"/usr/share/doc/cr3 || die "rmdir doc/cr3 failed"
89 + gunzip "${D}"/usr/share/doc/${PF}/changelog.gz || die "gunzip changelog.gz failed"
90 + gunzip "${D}"/usr/share/man/man1/cr3.1.gz || die "gunzip cr3.1.gz failed"
91 + fi
92 +}