media-libs/phonon: Drop 4.10.1
[gentoo.git] / app-office / calligra / calligra-3.1.0-r2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 CHECKREQS_DISK_BUILD="4G"
7 KDE_APPS_MINIMAL="17.12.0"
8 KDE_DOC_DIR="xxx" # contains no language subdirs
9 KDE_HANDBOOK="forceoptional"
10 KDE_PO_DIRS="po plan/po"
11 KDE_TEST="forceoptional"
12 inherit check-reqs kde5 versionator
13
14 DESCRIPTION="KDE Office Suite"
15 HOMEPAGE="https://www.calligra.org/"
16 [[ ${KDE_BUILD_TYPE} == release ]] && \
17         SRC_URI="mirror://kde/stable/${PN}/${PV}/${P}.tar.xz
18                 calligra_features_plan? ( mirror://kde/stable/${PN}/${PV}/${PN}plan-${PV}.tar.xz )"
19
20 LICENSE="GPL-2"
21
22 [[ ${KDE_BUILD_TYPE} == release ]] && \
23 KEYWORDS="amd64 x86"
24
25 CAL_FTS=( karbon plan sheets words )
26
27 IUSE="activities +crypt +fontconfig gemini gsl import-filter +lcms okular openexr +pdf
28         phonon pim spacenav +truetype X $(printf 'calligra_features_%s ' ${CAL_FTS[@]})
29         calligra_experimental_features_stage"
30
31 # TODO: Not packaged: Cauchy (https://bitbucket.org/cyrille/cauchy)
32 # Required for the matlab/octave formula tool
33 # FIXME: Disabled by upstream for good reason
34 # Crashes plan (https://bugs.kde.org/show_bug.cgi?id=311940)
35 # $(add_kdeapps_dep akonadi)
36 # $(add_kdeapps_dep akonadi-contacts)
37 # Currently upstream-disabled in plan
38 # =dev-libs/kproperty-3.0*:5
39 # =dev-libs/kreport-3.0*:5
40 COMMON_DEPEND="
41         $(add_frameworks_dep karchive)
42         $(add_frameworks_dep kcmutils)
43         $(add_frameworks_dep kcodecs)
44         $(add_frameworks_dep kcompletion)
45         $(add_frameworks_dep kconfig)
46         $(add_frameworks_dep kconfigwidgets)
47         $(add_frameworks_dep kcoreaddons)
48         $(add_frameworks_dep kdelibs4support)
49         $(add_frameworks_dep kemoticons)
50         $(add_frameworks_dep kglobalaccel)
51         $(add_frameworks_dep kguiaddons)
52         $(add_frameworks_dep ki18n)
53         $(add_frameworks_dep kiconthemes)
54         $(add_frameworks_dep kio)
55         $(add_frameworks_dep kitemmodels)
56         $(add_frameworks_dep kitemviews)
57         $(add_frameworks_dep kjobwidgets)
58         $(add_frameworks_dep knotifications)
59         $(add_frameworks_dep knotifyconfig)
60         $(add_frameworks_dep kparts)
61         $(add_frameworks_dep kross)
62         $(add_frameworks_dep ktextwidgets)
63         $(add_frameworks_dep kwallet)
64         $(add_frameworks_dep kwidgetsaddons)
65         $(add_frameworks_dep kwindowsystem)
66         $(add_frameworks_dep kxmlgui)
67         $(add_frameworks_dep sonnet)
68         $(add_qt_dep designer)
69         $(add_qt_dep qtdbus)
70         $(add_qt_dep qtdeclarative)
71         $(add_qt_dep qtgui)
72         $(add_qt_dep qtnetwork)
73         $(add_qt_dep qtprintsupport)
74         $(add_qt_dep qtscript)
75         $(add_qt_dep qtsvg)
76         $(add_qt_dep qtwidgets)
77         $(add_qt_dep qtxml)
78         dev-lang/perl
79         sys-libs/zlib
80         virtual/libiconv
81         activities? ( $(add_frameworks_dep kactivities) )
82         crypt? ( app-crypt/qca:2[qt5(+)] )
83         fontconfig? ( media-libs/fontconfig )
84         gemini? ( $(add_qt_dep qtdeclarative 'widgets') )
85         gsl? ( sci-libs/gsl )
86         import-filter? (
87                 $(add_frameworks_dep khtml)
88                 app-text/libetonyek
89                 app-text/libodfgen
90                 app-text/libwpd:*
91                 app-text/libwpg:*
92                 >=app-text/libwps-0.4
93                 dev-libs/librevenge
94                 media-libs/libvisio
95         )
96         lcms? (
97                 media-libs/ilmbase:=
98                 media-libs/lcms:2
99         )
100         openexr? ( media-libs/openexr )
101         pdf? ( app-text/poppler[qt5] )
102         phonon? ( media-libs/phonon[qt5(+)] )
103         spacenav? ( dev-libs/libspnav )
104         truetype? ( media-libs/freetype:2 )
105         X? (
106                 $(add_qt_dep qtx11extras)
107                 x11-libs/libX11
108         )
109         calligra_experimental_features_stage? (
110                 $(add_qt_dep qtwebkit)
111                 okular? ( $(add_kdeapps_dep okular) )
112         )
113         calligra_features_plan? (
114                 $(add_frameworks_dep khtml)
115                 $(add_frameworks_dep kholidays)
116                 dev-libs/kdiagram:5
117                 pim? (
118                         $(add_kdeapps_dep kcalcore)
119                         $(add_kdeapps_dep kcontacts)
120                 )
121         )
122         calligra_features_sheets? ( dev-cpp/eigen:3 )
123         calligra_features_words? (
124                 dev-libs/libxslt
125                 okular? ( $(add_kdeapps_dep okular) )
126         )
127 "
128 DEPEND="${COMMON_DEPEND}
129         dev-libs/boost
130         sys-devel/gettext
131         x11-misc/shared-mime-info
132         test? ( $(add_frameworks_dep threadweaver) )
133 "
134 RDEPEND="${COMMON_DEPEND}
135         calligra_features_karbon? ( media-gfx/pstoedit[plotutils] )
136         !app-office/calligra:4
137         !app-office/calligra-l10n:4
138 "
139 RESTRICT+=" test"
140
141 PATCHES=(
142         "${FILESDIR}"/${P}-no-arch-detection.patch
143         "${FILESDIR}"/${P}-doc.patch
144         "${FILESDIR}"/${P}-qt-5.11.patch
145         "${FILESDIR}"/${P}-stage-qt-5.11.patch
146 )
147
148 pkg_pretend() {
149         check-reqs_pkg_pretend
150 }
151
152 pkg_setup() {
153         kde5_pkg_setup
154         check-reqs_pkg_setup
155 }
156
157 src_prepare() {
158         if use calligra_features_plan && [[ ${KDE_BUILD_TYPE} == release ]]; then
159                 mv ../${PN}plan-${PV} plan || die
160                 sed -e "/add_subdirectory(plan)/s/#//" \
161                         -e "/^calligra_disable_product(APP_PLAN/s/^/#/" \
162                         -i CMakeLists.txt || die
163
164                 eapply "${FILESDIR}"/${P}-plan-qt-5.11.patch
165         fi
166         kde5_src_prepare
167
168         if ! use test; then
169                 sed -e "/add_subdirectory( *benchmarks *)/s/^/#DONT/" \
170                         -i libs/pigment/CMakeLists.txt || die
171         fi
172
173         # Unconditionally disable deprecated deps (required by QtQuick1)
174         punt_bogus_dep Qt5 Declarative
175         punt_bogus_dep Qt5 OpenGL
176
177         if ! use calligra_experimental_features_stage; then
178                 punt_bogus_dep Qt5 WebKitWidgets
179                 punt_bogus_dep Qt5 WebKit
180         fi
181
182         # Hack around the excessive use of CMake macros
183         if use okular && ! use calligra_features_words; then
184                 sed -i -e "/add_subdirectory( *okularodtgenerator *)/ s/^/#DONT/" \
185                         extras/CMakeLists.txt || die "Failed to disable OKULAR_GENERATOR_ODT"
186         fi
187
188         if use okular && ! use calligra_experimental_features_stage; then
189                 sed -i -e "/add_subdirectory( *okularodpgenerator *)/ s/^/#DONT/" \
190                         extras/CMakeLists.txt || die "Failed to disable OKULAR_GENERATOR_ODP"
191         fi
192 }
193
194 src_configure() {
195         local cal_ft myproducts
196
197         # applications
198         for cal_ft in ${CAL_FTS[@]}; do
199                 use calligra_features_${cal_ft} && myproducts+=( "${cal_ft^^}" )
200         done
201
202         use calligra_experimental_features_stage && myproducts+=( STAGE )
203
204         use lcms && myproducts+=( PLUGIN_COLORENGINES )
205         use spacenav && myproducts+=( PLUGIN_SPACENAVIGATOR )
206
207         local mycmakeargs=(
208                 -DPACKAGERS_BUILD=OFF
209                 -DRELEASE_BUILD=ON
210                 -DWITH_Iconv=ON
211                 -DPRODUCTSET="${myproducts[*]}"
212                 $(cmake-utils_use_find_package activities KF5Activities)
213                 -DWITH_Qca-qt5=$(usex crypt)
214                 -DWITH_Fontconfig=$(usex fontconfig)
215                 $(cmake-utils_use_find_package gemini Libgit2)
216                 $(cmake-utils_use_find_package gemini Qt5QuickWidgets)
217                 -DWITH_GSL=$(usex gsl)
218                 -DWITH_LibEtonyek=$(usex import-filter)
219                 -DWITH_LibOdfGen=$(usex import-filter)
220                 -DWITH_LibRevenge=$(usex import-filter)
221                 -DWITH_LibVisio=$(usex import-filter)
222                 -DWITH_LibWpd=$(usex import-filter)
223                 -DWITH_LibWpg=$(usex import-filter)
224                 -DWITH_LibWps=$(usex import-filter)
225                 $(cmake-utils_use_find_package phonon Phonon4Qt5)
226                 $(cmake-utils_use_find_package pim KF5CalendarCore)
227                 $(cmake-utils_use_find_package pim KF5Contacts)
228                 -DWITH_LCMS2=$(usex lcms)
229                 -DWITH_Okular5=$(usex okular)
230                 -DWITH_OpenEXR=$(usex openexr)
231                 -DWITH_Poppler=$(usex pdf)
232                 -DWITH_Eigen3=$(usex calligra_features_sheets)
233                 -DBUILD_UNMAINTAINED=$(usex calligra_experimental_features_stage)
234                 -ENABLE_CSTESTER_TESTING=$(usex test)
235                 -DWITH_Freetype=$(usex truetype)
236         )
237
238         kde5_src_configure
239 }