1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7,8} )
8 inherit cmake desktop flag-o-matic python-single-r1 subversion xdg
10 DESCRIPTION="Desktop publishing (DTP) and layout program"
11 HOMEPAGE="https://www.scribus.net/"
13 ESVN_REPO_URI="svn://scribus.net/trunk/Scribus"
14 ESVN_PROJECT=Scribus-1.5
19 IUSE="+boost debug examples graphicsmagick hunspell +minimal osg +pdf scripts +templates tk"
21 REQUIRED_USE="${PYTHON_REQUIRED_USE}
25 # couple of third_party libs bundled
27 dev-qt/linguist-tools:5
30 DEPEND="${PYTHON_DEPS}
35 >=dev-libs/icu-58.2:0=
39 dev-qt/qtgui:5[-gles2-only]
42 dev-qt/qtprintsupport:5
47 >=media-libs/harfbuzz-0.9.42:0=[icu]
50 media-libs/libfreehand
51 media-libs/libpagemaker
57 sys-libs/zlib[minizip]
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= )
66 $(python_gen_cond_dep '
67 dev-python/pillow[tk?,${PYTHON_MULTI_USEDEP}]
72 app-text/ghostscript-gpl
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
83 CMAKE_BUILD_TYPE="Release"
88 rm -r codegen/cheetah scribus/third_party/hyphen || die
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
97 -e 's:\(${CMAKE_INSTALL_PREFIX}\):./\1:g' \
98 -i resources/templates/CMakeLists.txt || die
101 -e "/^add_subdirectory(ui\/qml)/s/^/#DONT/" \
102 -i scribus/CMakeLists.txt || die # nothing but a bogus Hello World test
107 append-cppflags -DHAVE_MEMRCHR
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)
131 rm "${ED}"/usr/share/scribus/scripts/{FontSample,CalendarWizard}.py || die
134 python_fix_shebang "${ED}"/usr/share/scribus/scripts
135 python_optimize "${ED}"/usr/share/scribus/scripts
137 rm "${ED}"/usr/share/scribus/scripts/*.py || die
140 mv "${ED}"/usr/share/doc/${PF}/{en,html} || die
141 ln -sf html "${ED}"/usr/share/doc/${PF}/en || die
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.
149 docompress -x /usr/share/doc/${PF}/en /usr/share/doc/${PF}/{AUTHORS,TRANSLATION,LINKS,COPYING}
152 for size in 16 32 128 256 512; do
153 newicon -s $size resources/iconsets/artwork/icon_${size}x${size}.png scribus.png
155 newicon -s 64 resources/iconsets/artwork/icon_32x32@2x.png scribus.png
156 doicon resources/iconsets/*/scribus.png
157 domenu scribus.desktop