1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
9 inherit cmake-utils fdo-mime flag-o-matic multilib python-single-r1
11 DESCRIPTION="Desktop publishing (DTP) and layout program"
12 HOMEPAGE="http://www.scribus.net/"
13 SRC_URI="mirror://sourceforge/project/${PN}/${PN}-devel/${PV}/${P}.tar.xz"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="+boost debug examples graphicsmagick hunspell +minimal osg +pdf scripts templates tk"
20 #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
21 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"
22 IUSE+=" ${IUSE_LINGUAS// / linguas_}"
25 ${PYTHON_REQUIRED_USE}
29 # couple of third_party libs bundled
33 >=app-text/poppler-0.19.0:=
42 dev-qt/qtprintsupport:5
43 dev-qt/qtquickcontrols:5
51 media-libs/libpagemaker
56 sys-libs/zlib[minizip]
58 >=x11-libs/cairo-1.10.0[X,svg]
59 boost? ( dev-libs/boost )
60 hunspell? ( app-text/hunspell )
61 graphicsmagick? ( media-gfx/graphicsmagick )
62 osg? ( dev-games/openscenegraph )
63 pdf? ( app-text/podofo:0= )
64 scripts? ( dev-python/pillow[tk?,${PYTHON_USEDEP}] )
65 tk? ( dev-python/pillow[tk?,${PYTHON_USEDEP}] )
67 RDEPEND="${COMMON_DEPEND}
68 app-text/ghostscript-gpl"
69 DEPEND="${COMMON_DEPEND}
70 dev-qt/linguist-tools:5
74 "${FILESDIR}"/${P}-docdir.patch
75 "${FILESDIR}"/${P}-fpic.patch
76 "${FILESDIR}"/${P}-QObject.patch
80 rm -r codegen/cheetah || die
81 cat > cmake/modules/FindZLIB.cmake <<- EOF
82 find_package(PkgConfig)
83 pkg_check_modules(ZLIB minizip zlib)
84 SET( ZLIB_LIBRARY \${ZLIB_LIBRARIES} )
85 SET( ZLIB_INCLUDE_DIR \${ZLIB_INCLUDE_DIRS} )
86 MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )
90 -e "/^\s*unzip\.[ch]/d" \
91 -e "/^\s*ioapi\.[ch]/d" \
92 -i scribus/CMakeLists.txt Scribus.pro || die
93 rm scribus/ioapi.[ch] || die
96 -e 's:\(${CMAKE_INSTALL_PREFIX}\):./\1:g' \
97 -i resources/templates/CMakeLists.txt || die
99 if has_version ">=dev-qt/qtcore-5.7.0" ; then
100 append-cxxflags "-std=c++11" #bug 591948
103 cmake-utils_src_prepare
107 local _lang lang langs
108 for lang in ${IUSE_LINGUAS}; do
109 _lang=$(translate_lang ${lang})
110 if use linguas_${lang} || [[ ${lang} == "en" ]]; then
111 # From the CMakeLists.txt
112 # "#Bit of a hack, preprocess all the filenames to generate our language string, needed for -DWANT_GUI_LANG=en_GB;de_DE , etc"
115 # Don't install localized documentation
116 sed -e "/${_lang}/d" -i doc/CMakeLists.txt || die
118 ./resources/dicts/README_${_lang}.txt \
119 ./resources/dicts/README_hyph_${_lang}.txt \
120 ./resources/dicts/hyph_${_lang}.dic \
121 ./resources/loremipsum/${_lang}.xml
123 sed -e "/en_EN/d" -i doc/CMakeLists.txt || die
125 ./resources/dicts/README_en_EN.txt \
126 ./resources/dicts/README_hyph_en_EN.txt \
127 ./resources/dicts/hyph_en_EN.dic \
128 ./resources/loremipsum/en_EN.xml
133 -DPYTHON_INCLUDE_PATH="$(python_get_includedir)"
134 -DPYTHON_LIBRARY="$(python_get_library_path)"
135 -DWANT_DISTROBUILD=ON
136 -DDOCDIR="/usr/share/doc/${PF}/"
137 -DWANT_GUI_LANG="${langs#;};en"
138 $(cmake-utils_use_with pdf PODOFO)
139 $(cmake-utils_use_with boost)
140 $(cmake-utils_use_want graphicsmagick)
141 $(cmake-utils_use !osg WANT_NOOSG)
142 $(cmake-utils_use_want debug DEBUG)
143 $(cmake-utils_use_want minimal NOHEADERINSTALL)
144 $(cmake-utils_use_want hunspell HUNSPELL)
145 $(cmake-utils_use_want !examples NOEXAMPLES)
146 $(cmake-utils_use_want !templates NOTEMPLATES)
148 cmake-utils_src_configure
152 cmake-utils_src_install
155 # en_EN can be deleted always
156 for lang in ${IUSE_LINGUAS}; do
157 if ! use linguas_${lang}; then
158 _lang=$(translate_lang)
159 safe_delete "${ED}"/usr/share/man/${_lang}
163 if ! use scripts; then
164 rm "${ED}"/usr/share/scribus/scripts/*.py || die
166 rm "${ED}"/usr/share/scribus/scripts/{FontSample,CalendarWizard}.py || die
170 python_fix_shebang "${ED}"/usr/share/scribus/scripts && \
171 python_optimize "${ED}"/usr/share/scribus/scripts
173 mv "${ED}"/usr/share/doc/${PF}/{en,html} || die
174 ln -sf html "${ED}"/usr/share/doc/${PF}/en || die
175 cat >> "${T}"/COPYING <<- EOF
176 ${PN} is licensed under the "${LICENSE}".
177 Please visit https://www.gnu.org/licenses/gpl-2.0.html for the complete license text.
180 docompress -x /usr/share/doc/${PF}/en /usr/share/doc/${PF}/{AUTHORS,TRANSLATION,LINKS,COPYING}
181 doicon resources/icons/scribus.png
182 domenu scribus.desktop
186 fdo-mime_desktop_database_update
187 fdo-mime_mime_database_update
191 fdo-mime_desktop_database_update
192 fdo-mime_mime_database_update
198 if [[ -d "${x}" ]]; then
199 ebegin "Deleting ${x} recursively"
202 elif [[ -f "${x}" ]]; then
203 ebegin "Deleting ${x}"
207 ewarn "${x} not found"
214 [[ ${1} == "ru_RU" ]] && _lang+=_0
215 [[ ${1} == "de@1901" ]] && _lang=de_1901