119ad45230c6b8f7c570d3c095285421e34f1452
[gentoo.git] / app-text / sigil / sigil-0.9.18.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-utils 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/ https://github.com/Sigil-Ebook/Sigil"
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         dev-python/css-parser[${PYTHON_USEDEP}]
28         dev-python/lxml[${PYTHON_USEDEP}]
29         dev-python/six[${PYTHON_USEDEP}]
30         >=dev-qt/qtconcurrent-5.12:5
31         >=dev-qt/qtcore-5.12:5
32         >=dev-qt/qtgui-5.12:5
33         >=dev-qt/qtprintsupport-5.12:5
34         >=dev-qt/qtwebengine-5.12:5[widgets]
35         >=dev-qt/qtwidgets-5.12:5
36         sys-libs/zlib[minizip]
37         plugins? (
38                 dev-python/chardet[${PYTHON_USEDEP}]
39                 dev-python/cssselect[${PYTHON_USEDEP}]
40                 dev-python/cssutils[${PYTHON_USEDEP}]
41                 dev-python/html5lib[${PYTHON_USEDEP}]
42                 dev-python/pillow[${PYTHON_USEDEP}]
43                 dev-python/regex[${PYTHON_USEDEP}]
44         )
45         system-mathjax? ( dev-libs/mathjax )
46 "
47 DEPEND="${RDEPEND}"
48
49 BDEPEND="
50         dev-qt/linguist-tools:5
51         virtual/pkgconfig
52 "
53
54 S="${WORKDIR}/Sigil-${PV}"
55
56 DOCS=( ChangeLog.txt README.md )
57
58 DOC_CONTENTS="From Sigil's release notes:
59 When you fire up Sigil for the very first time:
60 navigate to the new General Preferences and select the default
61 epub version you plan to work with (epub2 or epub3) so that new
62 empty ebooks start with the correct code.
63 if you plan to work with epub3 epubs, you should change your
64 PreserveEntities setting to use ONLY NUMERIC entities.
65
66 For example use & # 1 6 0 ; for non-breaking spaces and etc.
67
68 We strongly recommend enabling Mend On Open in your settings
69 for best performance with Sigil."
70
71 src_configure() {
72         python_export PYTHON_LIBPATH PYTHON_INCLUDEDIR
73         local mycmakeargs=(
74                 -DINSTALL_BUNDLED_DICTS=0
75                 -DUSE_SYSTEM_LIBS=1
76                 -DSYSTEM_LIBS_REQUIRED=1
77                 -DPYTHON_EXECUTABLE="${PYTHON}"
78                 -DPYTHON_LIBRARY="${PYTHON_LIBPATH}"
79                 -DPYTHON_INCLUDE_DIR="${PYTHON_INCLUDEDIR}"
80         )
81         use system-mathjax && mycmakeargs+=( -DMATHJAX_DIR="${EPREFIX}"/usr/share/mathjax )
82
83         cmake-utils_src_configure
84 }
85
86 src_install() {
87         cmake-utils_src_install
88         python_fix_shebang "${ED}"/usr/share/sigil/
89         python_optimize "${ED}"/usr/share/sigil/
90         DISABLE_AUTOFORMATTING=true readme.gentoo_create_doc
91 }
92
93 pkg_postinst() {
94         xdg_desktop_database_update
95         readme.gentoo_print_elog
96 }
97
98 pkg_postrm() {
99         xdg_desktop_database_update
100 }