dev-python/cherrypy: keyworded 18.5.0 for ia64, bug #717946
[gentoo.git] / app-office / scribus / scribus-9999.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,8} )
7 PYTHON_REQ_USE="tk?"
8 inherit cmake desktop flag-o-matic python-single-r1 subversion xdg
9
10 DESCRIPTION="Desktop publishing (DTP) and layout program"
11 HOMEPAGE="https://www.scribus.net/"
12 SRC_URI=""
13 ESVN_REPO_URI="svn://scribus.net/trunk/Scribus"
14 ESVN_PROJECT=Scribus-1.5
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS=""
19 IUSE="+boost debug examples graphicsmagick hunspell +minimal osg +pdf scripts +templates tk"
20
21 REQUIRED_USE="${PYTHON_REQUIRED_USE}
22         tk? ( scripts )"
23
24 # osg
25 # couple of third_party libs bundled
26 BDEPEND="
27         dev-qt/linguist-tools:5
28         virtual/pkgconfig
29 "
30 DEPEND="${PYTHON_DEPS}
31         app-text/libmspub
32         app-text/libqxp
33         app-text/poppler:=
34         dev-libs/hyphen
35         >=dev-libs/icu-58.2:0=
36         dev-libs/librevenge
37         dev-libs/libxml2
38         dev-qt/qtcore:5
39         dev-qt/qtgui:5[-gles2-only]
40         dev-qt/qtnetwork:5
41         dev-qt/qtopengl:5
42         dev-qt/qtprintsupport:5
43         dev-qt/qtwidgets:5
44         dev-qt/qtxml:5
45         media-libs/fontconfig
46         media-libs/freetype:2
47         >=media-libs/harfbuzz-0.9.42:0=[icu]
48         media-libs/lcms:2
49         media-libs/libcdr
50         media-libs/libfreehand
51         media-libs/libpagemaker
52         media-libs/libpng:0=
53         media-libs/libvisio
54         media-libs/libzmf
55         media-libs/tiff:0
56         net-print/cups
57         sys-libs/zlib[minizip]
58         virtual/jpeg:0=
59         >=x11-libs/cairo-1.10.0[X,svg]
60         boost? ( >=dev-libs/boost-1.67:= )
61         hunspell? ( app-text/hunspell:= )
62         graphicsmagick? ( media-gfx/graphicsmagick:= )
63         osg? ( dev-games/openscenegraph:= )
64         pdf? ( app-text/podofo:0= )
65         scripts? (
66                 $(python_gen_cond_dep '
67                         dev-python/pillow[tk?,${PYTHON_MULTI_USEDEP}]
68                 ')
69         )
70 "
71 RDEPEND="${DEPEND}
72         app-text/ghostscript-gpl
73 "
74
75 PATCHES=(
76         # non(?)-upstreamable
77         "${FILESDIR}"/${PN}-1.5.3-fpic.patch
78         "${FILESDIR}"/${PN}-1.5.6-docdir.patch
79         "${FILESDIR}"/${PN}-1.5.5-findhyphen-1.patch
80         "${FILESDIR}"/${PN}-1.5.6-findhyphen.patch
81 )
82
83 CMAKE_BUILD_TYPE="Release"
84
85 src_prepare() {
86         cmake_src_prepare
87
88         rm -r codegen/cheetah scribus/third_party/hyphen || die
89
90         sed \
91                 -e "/^\s*unzip\.[ch]/d" \
92                 -e "/^\s*ioapi\.[ch]/d" \
93                 -i scribus/CMakeLists.txt Scribus.pro || die
94         rm scribus/ioapi.[ch] || die
95
96         sed \
97                 -e 's:\(${CMAKE_INSTALL_PREFIX}\):./\1:g' \
98                 -i resources/templates/CMakeLists.txt || die
99
100         sed \
101                 -e "/^add_subdirectory(ui\/qml)/s/^/#DONT/" \
102                 -i scribus/CMakeLists.txt || die # nothing but a bogus Hello World test
103 }
104
105 src_configure() {
106         # bug #550818
107         append-cppflags -DHAVE_MEMRCHR
108
109         local mycmakeargs=(
110                 -DHAVE_PYTHON=ON
111                 -DWANT_DISTROBUILD=ON
112                 -DDOCDIR="${EPREFIX}"/usr/share/doc/${PF}/
113                 -DPython3_EXECUTABLE="${PYTHON}"
114                 -DWITH_BOOST=$(usex boost)
115                 -DWANT_DEBUG=$(usex debug)
116                 -DWANT_NOEXAMPLES=$(usex !examples)
117                 -DWANT_GRAPHICSMAGICK=$(usex graphicsmagick)
118                 -DWANT_HUNSPELL=$(usex hunspell)
119                 -DWANT_HEADERINSTALL=$(usex !minimal)
120                 -DWANT_NOOSG=$(usex !osg)
121                 -DWITH_PODOFO=$(usex pdf)
122                 -DWANT_NOTEMPLATES=$(usex !templates)
123         )
124         cmake_src_configure
125 }
126
127 src_install() {
128         cmake_src_install
129
130         if ! use tk; then
131                 rm "${ED}"/usr/share/scribus/scripts/{FontSample,CalendarWizard}.py || die
132         fi
133         if use scripts; then
134                 python_fix_shebang "${ED}"/usr/share/scribus/scripts
135                 python_optimize "${ED}"/usr/share/scribus/scripts
136         else
137                 rm "${ED}"/usr/share/scribus/scripts/*.py || die
138         fi
139
140         mv "${ED}"/usr/share/doc/${PF}/{en,html} || die
141         ln -sf html "${ED}"/usr/share/doc/${PF}/en || die
142
143         # These files are parsed to populate the help/about window.
144         cat >> "${T}"/COPYING <<- EOF || die
145         ${PN} is licensed under the "${LICENSE}".
146         Please visit https://www.gnu.org/licenses/gpl-2.0.html for the complete license text.
147         EOF
148         dodoc "${T}"/COPYING
149         docompress -x /usr/share/doc/${PF}/en /usr/share/doc/${PF}/{AUTHORS,TRANSLATION,LINKS,COPYING}
150
151         local size
152         for size in 16 32 128 256 512; do
153                 newicon -s $size resources/iconsets/artwork/icon_${size}x${size}.png scribus.png
154         done
155         newicon -s 64 resources/iconsets/artwork/icon_32x32@2x.png scribus.png
156         doicon resources/iconsets/*/scribus.png
157         domenu scribus.desktop
158 }