acct-group/clair: add clair group
[gentoo.git] / app-text / sigil / sigil-0.9.16-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{6,7} )
7 PYTHON_REQ_USE="tk"
8
9 inherit cmake python-single-r1 readme.gentoo-r1 xdg-utils
10
11 DESCRIPTION="Multi-platform WYSIWYG ebook editor for ePub format"
12 HOMEPAGE="https://sigil-ebook.com/"
13 SRC_URI="https://github.com/Sigil-Ebook/Sigil/archive/${PV}.tar.gz -> ${P}.tar.gz"
14
15 LICENSE="GPL-3+ Apache-2.0"
16 SLOT="0"
17 KEYWORDS="amd64 x86"
18 IUSE="+plugins system-mathjax"
19 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
20
21 RDEPEND="
22         ${PYTHON_DEPS}
23         app-text/hunspell:=
24         dev-libs/boost:=[threads]
25         dev-libs/libpcre:3=[pcre16]
26         dev-libs/xerces-c[icu]
27         $(python_gen_cond_dep \
28                 'dev-python/css-parser[${PYTHON_MULTI_USEDEP}]
29                 dev-python/lxml[${PYTHON_MULTI_USEDEP}]
30                 dev-python/six[${PYTHON_MULTI_USEDEP}]')
31         >=dev-qt/qtconcurrent-5.12:5
32         >=dev-qt/qtcore-5.12:5
33         >=dev-qt/qtgui-5.12:5
34         >=dev-qt/qtprintsupport-5.12:5
35         >=dev-qt/qtwebengine-5.12:5[widgets]
36         >=dev-qt/qtwidgets-5.12:5
37         >=dev-qt/qtxmlpatterns-5.12:5
38         sys-libs/zlib[minizip]
39         plugins? ( $(python_gen_cond_dep \
40                 'dev-python/chardet[${PYTHON_MULTI_USEDEP}]
41                 dev-python/cssselect[${PYTHON_MULTI_USEDEP}]
42                 dev-python/cssutils[${PYTHON_MULTI_USEDEP}]
43                 dev-python/html5lib[${PYTHON_MULTI_USEDEP}]
44                 dev-python/pillow[${PYTHON_MULTI_USEDEP}]
45                 dev-python/regex[${PYTHON_MULTI_USEDEP}]') )
46         system-mathjax? ( dev-libs/mathjax )
47 "
48 DEPEND="${RDEPEND}"
49
50 BDEPEND="
51         dev-qt/linguist-tools:5
52         virtual/pkgconfig
53 "
54
55 S="${WORKDIR}/Sigil-${PV}"
56
57 DOCS=( ChangeLog.txt README.md )
58
59 DOC_CONTENTS="From Sigil's release notes:
60 When you fire up Sigil for the very first time:
61 navigate to the new General Preferences and select the default
62 epub version you plan to work with (epub 2 or epub3) so that new
63 empty ebooks start with the correct code.
64 if you plan to work with epub3 epubs, you should change your
65 PreserveEntities setting to use ONLY NUMERIC entities.
66
67 For example use & # 1 6 0 ; for non-breaking spaces and etc.
68
69 We strongly recommend enabling Mend On Open in your settings
70 for best performance with Sigil."
71
72 src_prepare() {
73         # bundled is a exact copy of the package, and upstream plan to switch soon
74         rm -r src/Resource_Files/plugin_launchers/python/css_parser/ || die
75         cmake_src_prepare
76 }
77
78 src_configure() {
79         python_export PYTHON_LIBPATH PYTHON_INCLUDEDIR
80         local mycmakeargs=(
81                 -DINSTALL_BUNDLED_DICTS=0
82                 -DUSE_SYSTEM_LIBS=1
83                 -DSYSTEM_LIBS_REQUIRED=1
84                 -DPYTHON_EXECUTABLE="${PYTHON}"
85                 -DPYTHON_LIBRARY="${PYTHON_LIBPATH}"
86                 -DPYTHON_INCLUDE_DIR="${PYTHON_INCLUDEDIR}"
87         )
88         use system-mathjax && mycmakeargs+=( -DMATHJAX_DIR="${EPREFIX}"/usr/share/mathjax )
89
90         cmake_src_configure
91 }
92
93 src_install() {
94         cmake_src_install
95         python_fix_shebang "${ED}"/usr/share/sigil/
96         python_optimize "${ED}"/usr/share/sigil/
97         DISABLE_AUTOFORMATTING=true readme.gentoo_create_doc
98 }
99
100 pkg_postinst() {
101         xdg_desktop_database_update
102         readme.gentoo_print_elog
103 }
104
105 pkg_postrm() {
106         xdg_desktop_database_update
107 }