Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/scribus/
Date: Sat, 25 Feb 2017 19:43:59
Message-Id: 1488051827.f40090d2792eab90cd2b74bf7eac6c6bfb44d136.jlec@gentoo
1 commit: f40090d2792eab90cd2b74bf7eac6c6bfb44d136
2 Author: Chris Mayo <aklhfex <AT> gmail <DOT> com>
3 AuthorDate: Sat Jan 7 16:46:24 2017 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 25 19:43:47 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f40090d2
7
8 app-office/scribus: install a set of icons into hicolor theme
9
10 Package-Manager: portage-2.3.3
11 Closes: https://github.com/gentoo/gentoo/pull/3362
12
13 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
14
15 app-office/scribus/scribus-1.5.2-r3.ebuild | 228 +++++++++++++++++++++++++++++
16 1 file changed, 228 insertions(+)
17
18 diff --git a/app-office/scribus/scribus-1.5.2-r3.ebuild b/app-office/scribus/scribus-1.5.2-r3.ebuild
19 new file mode 100644
20 index 0000000000..77aa050eaa
21 --- /dev/null
22 +++ b/app-office/scribus/scribus-1.5.2-r3.ebuild
23 @@ -0,0 +1,228 @@
24 +# Copyright 1999-2017 Gentoo Foundation
25 +# Distributed under the terms of the GNU General Public License v2
26 +# $Id$
27 +
28 +EAPI=6
29 +
30 +PYTHON_COMPAT=( python2_7 )
31 +PYTHON_REQ_USE="tk?"
32 +CMAKE_MAKEFILE_GENERATOR=ninja
33 +
34 +inherit cmake-utils eutils fdo-mime flag-o-matic gnome2 multilib python-single-r1
35 +
36 +DESCRIPTION="Desktop publishing (DTP) and layout program"
37 +HOMEPAGE="http://www.scribus.net/"
38 +SRC_URI="mirror://sourceforge/project/${PN}/${PN}-devel/${PV}/${P}.tar.xz"
39 +
40 +LICENSE="GPL-2"
41 +SLOT="0"
42 +KEYWORDS="~amd64 ~x86"
43 +IUSE="+boost debug examples graphicsmagick hunspell +minimal osg +pdf scripts templates tk"
44 +
45 +#a=$((ls resources/translations/scribus.*ts | sed -e 's:\.: :g' | awk '{print $2}'; ls resources/loremipsum/*xml | sed -e 's:\.: :g' -e 's:loremipsum\/: :g'| awk '{print $2}'; ls resources/dicts/hyph*dic | sed -e 's:\.: :g' -e 's:hyph_: :g' | awk '{print $2}'; ls resources/dicts/README_*txt | sed -e 's:_hyph::g' -e 's:\.: :g' -e 's:README_: :g' | awk '{print $2}') | sort | uniq); echo $a
46 +IUSE_LINGUAS=" af ar bg br ca ca_ES cs cs_CZ cy cy_GB da da_DK de de@1901 de_CH de_DE el en_AU en_GB en_US eo es es_ES et eu fi fi_FI fr gl he hr hu hu_HU ia id id_ID is is_IS it ja ko ku la lt lt_LT nb_NO nl nn_NO pl pl_PL pt pt_BR pt_PT ro ro_RO ru ru_RU sa sk sk_SK sl sl_SI sq sr sv sv_SE th_TH tr uk uk_UA zh_CN zh_TW"
47 +IUSE+=" ${IUSE_LINGUAS// / linguas_}"
48 +
49 +REQUIRED_USE="
50 + ${PYTHON_REQUIRED_USE}
51 + tk? ( scripts )"
52 +
53 +# osg
54 +# couple of third_party libs bundled
55 +COMMON_DEPEND="
56 + ${PYTHON_DEPS}
57 + app-text/libmspub
58 + app-text/poppler:=
59 + dev-libs/hyphen
60 + dev-libs/librevenge
61 + dev-libs/libxml2
62 + dev-qt/qtcore:5
63 + dev-qt/qtgui:5
64 + dev-qt/qtnetwork:5
65 + dev-qt/qtopengl:5
66 + dev-qt/qtprintsupport:5
67 + dev-qt/qtquickcontrols:5
68 + dev-qt/qtwidgets:5
69 + dev-qt/qtxml:5
70 + media-libs/fontconfig
71 + media-libs/freetype:2
72 + media-libs/lcms:2
73 + media-libs/libcdr
74 + media-libs/libpagemaker
75 + media-libs/libpng:0=
76 + media-libs/libvisio
77 + media-libs/tiff:0
78 + net-print/cups
79 + sys-libs/zlib[minizip]
80 + virtual/jpeg:0=
81 + >=x11-libs/cairo-1.10.0[X,svg]
82 + boost? ( >=dev-libs/boost-1.62:= )
83 + hunspell? ( app-text/hunspell )
84 + graphicsmagick? ( media-gfx/graphicsmagick )
85 + osg? ( dev-games/openscenegraph )
86 + pdf? ( app-text/podofo:0= )
87 + scripts? ( dev-python/pillow[tk?,${PYTHON_USEDEP}] )
88 + tk? ( dev-python/pillow[tk?,${PYTHON_USEDEP}] )
89 +"
90 +RDEPEND="${COMMON_DEPEND}
91 + app-text/ghostscript-gpl"
92 +DEPEND="${COMMON_DEPEND}
93 + dev-qt/linguist-tools:5
94 + virtual/pkgconfig"
95 +
96 +PATCHES=(
97 + "${FILESDIR}"/${PN}-1.5.0-docdir.patch
98 + "${FILESDIR}"/${P}-fpic.patch
99 + "${FILESDIR}"/${P}-cmake-qt57.patch
100 + "${FILESDIR}"/${P}-qt57-build.patch
101 + "${FILESDIR}"/${P}-cxx-build.patch
102 + "${FILESDIR}"/${P}-gcc6-warn.patch
103 +)
104 +
105 +src_prepare() {
106 + rm -r codegen/cheetah || die
107 + cat > cmake/modules/FindZLIB.cmake <<- EOF || die
108 + find_package(PkgConfig)
109 + pkg_check_modules(ZLIB minizip zlib)
110 + SET( ZLIB_LIBRARY \${ZLIB_LIBRARIES} )
111 + SET( ZLIB_INCLUDE_DIR \${ZLIB_INCLUDE_DIRS} )
112 + MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )
113 + EOF
114 +
115 + sed \
116 + -e "/^\s*unzip\.[ch]/d" \
117 + -e "/^\s*ioapi\.[ch]/d" \
118 + -i scribus/CMakeLists.txt Scribus.pro || die
119 + rm scribus/ioapi.[ch] || die
120 +
121 + sed \
122 + -e 's:\(${CMAKE_INSTALL_PREFIX}\):./\1:g' \
123 + -i resources/templates/CMakeLists.txt || die
124 +
125 + edos2unix scribus/ui/propertiespalette_utils.cpp
126 +
127 + cmake-utils_src_prepare
128 +}
129 +
130 +src_configure() {
131 + local _lang lang langs
132 + for lang in ${IUSE_LINGUAS}; do
133 + _lang=$(translate_lang ${lang})
134 + if use linguas_${lang} || [[ ${lang} == "en" ]]; then
135 + # From the CMakeLists.txt
136 + # "#Bit of a hack, preprocess all the filenames to generate our language string, needed for -DWANT_GUI_LANG=en_GB;de_DE , etc"
137 + langs+=";${_lang}"
138 + else
139 + # Don't install localized documentation
140 + sed -e "/${_lang}/d" -i doc/CMakeLists.txt || die
141 + safe_delete \
142 + ./resources/dicts/README_${_lang}.txt \
143 + ./resources/dicts/README_hyph_${_lang}.txt \
144 + ./resources/dicts/hyph_${_lang}.dic \
145 + ./resources/loremipsum/${_lang}.xml
146 + fi
147 + sed -e "/en_EN/d" -i doc/CMakeLists.txt || die
148 + safe_delete \
149 + ./resources/dicts/README_en_EN.txt \
150 + ./resources/dicts/README_hyph_en_EN.txt \
151 + ./resources/dicts/hyph_en_EN.dic \
152 + ./resources/loremipsum/en_EN.xml
153 + done
154 +
155 + local mycmakeargs=(
156 + -DHAVE_PYTHON=ON
157 + -DPYTHON_INCLUDE_PATH="$(python_get_includedir)"
158 + -DPYTHON_LIBRARY="$(python_get_library_path)"
159 + -DWANT_DISTROBUILD=ON
160 + -DDOCDIR="${EPREFIX%/}/usr/share/doc/${PF}/"
161 + -DWANT_GUI_LANG="${langs#;};en"
162 + -DWANT_CPP11=ON
163 + -DWITH_PODOFO="$(usex pdf)"
164 + -DWITH_BOOST="$(usex boost)"
165 + -DWANT_GRAPHICSMAGICK="$(usex graphicsmagick)"
166 + -DWANT_NOOSG="$(usex !osg)"
167 + -DWANT_DEBUG="$(usex debug)"
168 + -DWANT_NOHEADERINSTALL="$(usex minimal)"
169 + -DWANT_HUNSPELL="$(usex hunspell)"
170 + -DWANT_NOEXAMPLES="$(usex !examples)"
171 + -DWANT_NOTEMPLATES="$(usex !templates)"
172 + )
173 + cmake-utils_src_configure
174 +}
175 +
176 +src_install() {
177 + cmake-utils_src_install
178 +
179 + local lang _lang
180 + # en_EN can be deleted always
181 + for lang in ${IUSE_LINGUAS}; do
182 + if ! use linguas_${lang}; then
183 + _lang=$(translate_lang ${lang})
184 + safe_delete "${ED%/}"/usr/share/man/${_lang}
185 + fi
186 + done
187 +
188 + if ! use scripts; then
189 + rm "${ED%/}"/usr/share/scribus/scripts/*.py || die
190 + elif ! use tk; then
191 + rm "${ED%/}"/usr/share/scribus/scripts/{FontSample,CalendarWizard}.py || die
192 + fi
193 +
194 + use scripts && \
195 + python_fix_shebang "${ED%/}"/usr/share/scribus/scripts && \
196 + python_optimize "${ED%/}"/usr/share/scribus/scripts
197 +
198 + mv "${ED%/}"/usr/share/doc/${PF}/{en,html} || die
199 + ln -sf html "${ED%/}"/usr/share/doc/${PF}/en || die
200 + cat >> "${T}"/COPYING <<- EOF || die
201 + ${PN} is licensed under the "${LICENSE}".
202 + Please visit https://www.gnu.org/licenses/gpl-2.0.html for the complete license text.
203 + EOF
204 + dodoc "${T}"/COPYING
205 + docompress -x /usr/share/doc/${PF}/en /usr/share/doc/${PF}/{AUTHORS,TRANSLATION,LINKS,COPYING}
206 + local size
207 + for size in 16 32 128 256; do
208 + newicon -s $size resources/iconsets/artwork/icon_${size}x${size}.png scribus.png
209 + done
210 + newicon -s 64 resources/iconsets/artwork/icon_32x32@××.png scribus.png
211 + doicon resources/iconsets/*/scribus.png
212 + domenu scribus.desktop
213 +}
214 +
215 +pkg_preinst() {
216 + gnome2_icon_savelist
217 +}
218 +
219 +pkg_postinst() {
220 + fdo-mime_desktop_database_update
221 + fdo-mime_mime_database_update
222 + gnome2_icon_cache_update
223 +}
224 +
225 +pkg_postrm() {
226 + fdo-mime_desktop_database_update
227 + fdo-mime_mime_database_update
228 + gnome2_icon_cache_update
229 +}
230 +
231 +safe_delete () {
232 + local x
233 + for x in ${@}; do
234 + if [[ -d "${x}" ]]; then
235 + ebegin "Deleting ${x} recursively"
236 + rm -r "${x}" || die
237 + eend $?
238 + elif [[ -f "${x}" ]]; then
239 + ebegin "Deleting ${x}"
240 + rm "${x}" || die
241 + eend $?
242 + fi
243 + done
244 +}
245 +
246 +translate_lang() {
247 + _lang=${1}
248 + [[ ${1} == "ru_RU" ]] && _lang+=_0
249 + [[ ${1} == "de@1901" ]] && _lang=de_1901
250 + echo ${_lang}
251 +}