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: Sat, 03 Nov 2018 11:45:58
Message-Id: 1541245506.de9c59d8bcb0c1b319fcd1db7b34ef0272f52d04.grozin@gentoo
1 commit: de9c59d8bcb0c1b319fcd1db7b34ef0272f52d04
2 Author: Andrey Grozin <grozin <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 3 11:45:06 2018 +0000
4 Commit: Andrey Grozin <grozin <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 3 11:45:06 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de9c59d8
7
8 app-text/coolreader: fix install paths
9
10 Closes: https://bugs.gentoo.org/668810
11 Signed-off-by: Andrey Grozin <grozin <AT> gentoo.org>
12 Package-Manager: Portage-2.3.41, Repoman-2.3.9
13
14 app-text/coolreader/coolreader-3.2.2.1-r2.ebuild | 95 ++++++++++++++++++++++++
15 1 file changed, 95 insertions(+)
16
17 diff --git a/app-text/coolreader/coolreader-3.2.2.1-r2.ebuild b/app-text/coolreader/coolreader-3.2.2.1-r2.ebuild
18 new file mode 100644
19 index 00000000000..71c68d68f32
20 --- /dev/null
21 +++ b/app-text/coolreader/coolreader-3.2.2.1-r2.ebuild
22 @@ -0,0 +1,95 @@
23 +# Copyright 1999-2018 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=6
27 +WX_GTK_VER="3.0"
28 +PLOCALES="bg cs de es hu pl ru uk"
29 +inherit cmake-utils wxwidgets l10n xdg-utils gnome2-utils eapi7-ver
30 +
31 +CR_PV=$(ver_rs 3 '-')
32 +
33 +if [ "${PV}" != 9999 ]
34 +then
35 + # git tag cr3.2.2-1
36 + SRC_URI="https://github.com/buggins/${PN}/archive/cr${CR_PV}.tar.gz -> ${P}.tar.gz"
37 + S="${WORKDIR}/${PN}-cr${CR_PV}"
38 +else
39 + inherit git-r3
40 + # github mirror has some new commits to fix page margins settings
41 + # sourceforge mirror saved as backup
42 + #EGIT_REPO_URI="git://git.code.sf.net/p/crengine/crengine"
43 + EGIT_REPO_URI="https://github.com/buggins/${PN}.git"
44 + SRC_URI=""
45 +fi
46 +
47 +DESCRIPTION="CoolReader - reader of eBook files (fb2,epub,htm,rtf,txt)"
48 +HOMEPAGE="https://sourceforge.net/projects/crengine/"
49 +
50 +LICENSE="GPL-2"
51 +SLOT="0"
52 +KEYWORDS="~amd64 ~x86"
53 +IUSE="wxwidgets"
54 +
55 +CDEPEND="sys-libs/zlib
56 + media-libs/libpng:0
57 + virtual/jpeg:0
58 + media-libs/freetype
59 + wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER} )
60 + !wxwidgets? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtwidgets:5 )"
61 +DEPEND="${CDEPEND}
62 + !wxwidgets? ( dev-qt/linguist-tools:5 )"
63 +RDEPEND="${CDEPEND}
64 + wxwidgets? ( || ( media-fonts/liberation-fonts media-fonts/corefonts ) )"
65 +
66 +for lang in ${PLOCALES}; do
67 + IUSE="${IUSE} l10n_${lang}"
68 +done
69 +
70 +src_prepare() {
71 + cmake-utils_src_prepare
72 +
73 + # locales
74 + l10n_find_plocales_changes "${S}"/cr3qt/src/i18n 'cr3_' '.ts'
75 + local lang langs
76 + langs=""
77 + for lang in ${PLOCALES}; do
78 + if use l10n_${lang}; then
79 + langs="${langs} ${lang}"
80 + fi
81 + done
82 + sed -e "s|SET(LANGUAGES .*)|SET(LANGUAGES ${langs})|" \
83 + -i "${S}"/cr3qt/CMakeLists.txt \
84 + || die "sed CMakeLists.txt failed"
85 +}
86 +
87 +src_configure() {
88 + CMAKE_USE_DIR="${S}"
89 + CMAKE_BUILD_TYPE="Release"
90 + if use wxwidgets; then
91 + setup-wxwidgets
92 + local mycmakeargs=(-D GUI=WX)
93 + else
94 + local mycmakeargs=(-D GUI=QT5)
95 + fi
96 + cmake-utils_src_configure
97 +}
98 +
99 +src_install() {
100 + cmake-utils_src_install
101 + mv "${D}"usr/share/doc/cr3/changelog.gz "${D}"usr/share/doc/${PF}/ || die "mv changelog.gz failed"
102 + rmdir "${D}"usr/share/doc/cr3 || die "rmdir doc/cr3 failed"
103 + gunzip "${D}"usr/share/doc/${PF}/changelog.gz || die "gunzip changelog.gz failed"
104 + gunzip "${D}"usr/share/man/man1/cr3.1.gz || die "gunzip cr3.1.gz failed"
105 +}
106 +
107 +pkg_postinst() {
108 + xdg_desktop_database_update
109 + xdg_mimeinfo_database_update
110 + gnome2_icon_cache_update
111 +}
112 +
113 +pkg_postrm() {
114 + xdg_desktop_database_update
115 + xdg_mimeinfo_database_update
116 + gnome2_icon_cache_update
117 +}