Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-geosciences/qgis/, sci-geosciences/qgis/files/
Date: Sun, 04 Jun 2017 10:25:50
Message-Id: 1496571933.7879a7c8176a4ca10e5597adc85cbdb21d776e63.asturm@gentoo
1 commit: 7879a7c8176a4ca10e5597adc85cbdb21d776e63
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 4 09:13:55 2017 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 4 10:25:33 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7879a7c8
7
8 sci-geosciences/qgis: 2.18.9 version bump
9
10 Package-Manager: Portage-2.3.5, Repoman-2.3.1
11
12 sci-geosciences/qgis/Manifest | 1 +
13 .../qgis-2.18.9-broken-psycopg2-encoding.patch | 32 +++
14 .../qgis-2.18.9-dbmanager-plugin-exceptions.patch | 89 ++++++++
15 .../qgis-2.18.9-fix-plugin-config-settings.patch | 23 +++
16 .../files/qgis-2.18.9-uncaught-exception.patch | 40 ++++
17 sci-geosciences/qgis/qgis-2.18.9.ebuild | 226 +++++++++++++++++++++
18 6 files changed, 411 insertions(+)
19
20 diff --git a/sci-geosciences/qgis/Manifest b/sci-geosciences/qgis/Manifest
21 index 30daa171447..11391f1e144 100644
22 --- a/sci-geosciences/qgis/Manifest
23 +++ b/sci-geosciences/qgis/Manifest
24 @@ -1,3 +1,4 @@
25 DIST qgis-2.18.3.tar.bz2 83508061 SHA256 743f4f22f8a17b1fd0ae575ed4da1d20ab1fe06561564d097b75c21fddf9b394 SHA512 6d2256cf85ebc1f1ddd3636f8a48284de95c42e3adb26e780b4847208c5ead80dd6a44c1a11d263bcc15bfbd7337d62d10b738ad8a7076382dbe4c4a011ff6fc WHIRLPOOL d342b3d0dd211c63f49e9b3292a585e6fd64d5837cd9bf4fe7bb53a9bd437220d7f5274b012d2732196bd5425388fa9a985fc5d342be5aee9e7fd0d008ca9c48
26 DIST qgis-2.18.7.tar.bz2 84928689 SHA256 ab05060e6b91909f61a21205ee12ddf79ebd85a7d7b81ab3b7dabfd032aa2e5b SHA512 e7908ebe8049d0ca2e99980ba8ac6e9b6941811c96d6139db87072315404987da0ec7272f77abacaddf5fb4bd540a0be7f64e44662fa32d2d4eb11b85421744d WHIRLPOOL 25320b1bacaeaf1486aa6a95b8df32e0a1b4713aedb5237f46e7aa538ef682b9cbd9eff70914727e426193fb0821df437e4732b118e71a4e12d90308cbbb066f
27 +DIST qgis-2.18.9.tar.bz2 84453524 SHA256 a922af0e4b3bcf8e790d7fc50752bc96771abfc2d093365cb3260b45c27225a1 SHA512 2495d9bc4f22f22882beb322d01465dd456a6db8a59a7e8e8056555b6ab4c895e9fc70d423f36a856d3a3b890bb3fbab607f7fd34736a8d2bc69f29bf1d91ca4 WHIRLPOOL cfc6006eed3e948407eea79c57eb543be700d99ff0eb38e07263ec8659dee4ceafac8879dc95ac7b275efe44708d4a949d71dfd9800e8a9cb013527aabcea8e3
28 DIST qgis_sample_data.tar.gz 13601736 SHA256 a31c54056776e8476e1f959870830f850423645cfb80d88811f3b365c29f2b4a SHA512 5847d7b32e5f75e771adf6b959847024f55b2360c307bd80e5628595fc53f5aaca18adf6cb00fa027a7e7b326c7f72bab58df16674daf20b77c676e163d93f78 WHIRLPOOL fe7746f8a72807742427c6fb70f1453e195be75322d5784adc484ac14b0eae55569dbded7468ea2ba0c34781fe14918e07a5a187dca82bff551c6117f941d7f5
29
30 diff --git a/sci-geosciences/qgis/files/qgis-2.18.9-broken-psycopg2-encoding.patch b/sci-geosciences/qgis/files/qgis-2.18.9-broken-psycopg2-encoding.patch
31 new file mode 100644
32 index 00000000000..b6eb1d17159
33 --- /dev/null
34 +++ b/sci-geosciences/qgis/files/qgis-2.18.9-broken-psycopg2-encoding.patch
35 @@ -0,0 +1,32 @@
36 +From 2c8e03de391ac8a878d56e0a491c6a70b7a4c589 Mon Sep 17 00:00:00 2001
37 +From: Borys Jurgiel <info@××××××××××××.pl>
38 +Date: Sat, 3 Jun 2017 16:54:54 +0200
39 +Subject: [PATCH] [PROCESSING] [regression] One more fix for broken encoding of
40 + psycopg2 error messages
41 +
42 +---
43 + python/plugins/processing/tools/postgis.py | 4 ++--
44 + 1 file changed, 2 insertions(+), 2 deletions(-)
45 +
46 +diff --git a/python/plugins/processing/tools/postgis.py b/python/plugins/processing/tools/postgis.py
47 +index 69fab99b7f4..96c88f95f63 100644
48 +--- a/python/plugins/processing/tools/postgis.py
49 ++++ b/python/plugins/processing/tools/postgis.py
50 +@@ -205,7 +205,7 @@ def __init__(self, host=None, port=None, dbname=None, user=None,
51 + break
52 + except psycopg2.OperationalError as e:
53 + if i == 3:
54 +- raise DbError(unicode(e))
55 ++ raise DbError(unicode(e.pgerror, e.cursor.connection.encoding, 'replace'))
56 +
57 + err = unicode(e)
58 + user = self.uri.username()
59 +@@ -821,7 +821,7 @@ def _exec_sql(self, cursor, sql):
60 + try:
61 + cursor.execute(sql)
62 + except psycopg2.Error as e:
63 +- raise DbError(unicode(e), e.cursor.query)
64 ++ raise DbError(unicode(e.pgerror, e.cursor.connection.encoding, 'replace'), e.cursor.query)
65 +
66 + def _exec_sql_and_commit(self, sql):
67 + """Tries to execute and commit some action, on error it rolls
68
69 diff --git a/sci-geosciences/qgis/files/qgis-2.18.9-dbmanager-plugin-exceptions.patch b/sci-geosciences/qgis/files/qgis-2.18.9-dbmanager-plugin-exceptions.patch
70 new file mode 100644
71 index 00000000000..0b780c22ca6
72 --- /dev/null
73 +++ b/sci-geosciences/qgis/files/qgis-2.18.9-dbmanager-plugin-exceptions.patch
74 @@ -0,0 +1,89 @@
75 +From dae921c51f85f2dde2bab9b18a0d7c7c31bc700b Mon Sep 17 00:00:00 2001
76 +From: Luigi Pirelli <luipir@×××××.com>
77 +Date: Thu, 11 May 2017 17:40:32 +0200
78 +Subject: [PATCH] [DB Manager] previewing layers in Virtual layers section
79 + remove them from the Layers panel: fixies #16476 plus more vlayer db_manager
80 + plugin fixes to reduce (but can't avoid) exceptions due to C++/SIP object
81 + removes
82 +
83 +---
84 + python/plugins/db_manager/db_plugins/vlayers/connector.py | 10 ++++++++++
85 + python/plugins/db_manager/layer_preview.py | 11 +++++++----
86 + 2 files changed, 17 insertions(+), 4 deletions(-)
87 +
88 +diff --git a/python/plugins/db_manager/db_plugins/vlayers/connector.py b/python/plugins/db_manager/db_plugins/vlayers/connector.py
89 +index e64f2ec57b6..4c8cb4dca1b 100644
90 +--- a/python/plugins/db_manager/db_plugins/vlayers/connector.py
91 ++++ b/python/plugins/db_manager/db_plugins/vlayers/connector.py
92 +@@ -96,6 +96,10 @@ def getLayer(self, l):
93 + lid = self.layers.get(l)
94 + if lid is None:
95 + return lid
96 ++ # the instance can refer to a layer in map previe and not in qgis general canvas
97 ++ if lid not in QgsMapLayerRegistry.instance().mapLayers().keys():
98 ++ self.layers.pop(l)
99 ++ return None
100 + return QgsMapLayerRegistry.instance().mapLayer(lid)
101 +
102 +
103 +@@ -246,12 +250,16 @@ def getRasterTables(self, schema=None):
104 + def getTableRowCount(self, table):
105 + t = table[1]
106 + l = VLayerRegistry.instance().getLayer(t)
107 ++ if not l or not l.isValid():
108 ++ return None
109 + return l.featureCount()
110 +
111 + def getTableFields(self, table):
112 + """ return list of columns in table """
113 + t = table[1]
114 + l = VLayerRegistry.instance().getLayer(t)
115 ++ if not l or not l.isValid():
116 ++ return []
117 + # id, name, type, nonnull, default, pk
118 + n = l.dataProvider().fields().size()
119 + f = [(i, f.name(), f.typeName(), False, None, False)
120 +@@ -277,6 +285,8 @@ def getTableExtent(self, table, geom):
121 + l = QgsMapLayerRegistry.instance().mapLayer(t)
122 + else:
123 + l = VLayerRegistry.instance().getLayer(t)
124 ++ if not l or not l.isValid():
125 ++ return None
126 + e = l.extent()
127 + r = (e.xMinimum(), e.yMinimum(), e.xMaximum(), e.yMaximum())
128 + return r
129 +diff --git a/python/plugins/db_manager/layer_preview.py b/python/plugins/db_manager/layer_preview.py
130 +index 1f7cec65526..27bba0a8f13 100644
131 +--- a/python/plugins/db_manager/layer_preview.py
132 ++++ b/python/plugins/db_manager/layer_preview.py
133 +@@ -25,7 +25,7 @@
134 + from qgis.PyQt.QtWidgets import QApplication
135 +
136 + from qgis.gui import QgsMapCanvas, QgsMapCanvasLayer, QgsMessageBar
137 +-from qgis.core import QgsVectorLayer, QgsMapLayerRegistry
138 ++from qgis.core import QgsVectorLayer, QgsMapLayerRegistry, QgsProject
139 +
140 + from .db_plugins.plugin import Table
141 +
142 +@@ -113,15 +113,18 @@ def _loadTablePreview(self, table, limit=False):
143 + else:
144 + vl = table.toMapLayer()
145 +
146 +- if not vl.isValid():
147 ++ if vl and not vl.isValid():
148 + vl.deleteLater()
149 + vl = None
150 +
151 + # remove old layer (if any) and set new
152 + if self.currentLayer:
153 +- QgsMapLayerRegistry.instance().removeMapLayers([self.currentLayer.id()])
154 ++ # but not remove it if in layer list panel
155 ++ # fix https://issues.qgis.org/issues/16476
156 ++ if not QgsProject.instance().layerTreeRoot().findLayer(self.currentLayer.id()):
157 ++ QgsMapLayerRegistry.instance().removeMapLayers([self.currentLayer.id()])
158 +
159 +- if vl:
160 ++ if vl and vl.isValid():
161 + self.setLayerSet([QgsMapCanvasLayer(vl)])
162 + QgsMapLayerRegistry.instance().addMapLayers([vl], False)
163 + self.zoomToFullExtent()
164
165 diff --git a/sci-geosciences/qgis/files/qgis-2.18.9-fix-plugin-config-settings.patch b/sci-geosciences/qgis/files/qgis-2.18.9-fix-plugin-config-settings.patch
166 new file mode 100644
167 index 00000000000..cbf03f146ca
168 --- /dev/null
169 +++ b/sci-geosciences/qgis/files/qgis-2.18.9-fix-plugin-config-settings.patch
170 @@ -0,0 +1,23 @@
171 +From 008f38574e78f0557aae890f508cf5e148545d15 Mon Sep 17 00:00:00 2001
172 +From: "Juergen E. Fischer" <jef@××××××.de>
173 +Date: Wed, 31 May 2017 13:50:03 +0200
174 +Subject: [PATCH] processing: only reset existing menu 'settings' (followup
175 + e78fc620)
176 +
177 +---
178 + python/plugins/processing/gui/ConfigDialog.py | 2 ++
179 + 1 file changed, 2 insertions(+)
180 +
181 +diff --git a/python/plugins/processing/gui/ConfigDialog.py b/python/plugins/processing/gui/ConfigDialog.py
182 +index 85d8641fb48..d2776b7dca0 100644
183 +--- a/python/plugins/processing/gui/ConfigDialog.py
184 ++++ b/python/plugins/processing/gui/ConfigDialog.py
185 +@@ -256,6 +256,8 @@ def resetMenusToDefaults(self):
186 + for provider in providers:
187 + for alg in provider.algs:
188 + d = defaultMenuEntries.get(alg.commandLineName(), "")
189 ++ if "MENU_" + alg.commandLineName() not in ProcessingConfig.settings:
190 ++ continue
191 + setting = ProcessingConfig.settings["MENU_" + alg.commandLineName()]
192 + item = self.items[setting]
193 + item.setData(d, Qt.EditRole)
194
195 diff --git a/sci-geosciences/qgis/files/qgis-2.18.9-uncaught-exception.patch b/sci-geosciences/qgis/files/qgis-2.18.9-uncaught-exception.patch
196 new file mode 100644
197 index 00000000000..4785385458b
198 --- /dev/null
199 +++ b/sci-geosciences/qgis/files/qgis-2.18.9-uncaught-exception.patch
200 @@ -0,0 +1,40 @@
201 +From ed03e99ee582cb4abd1ae08cf333da8c0975a4c8 Mon Sep 17 00:00:00 2001
202 +From: Luigi Pirelli <luipir@×××××.com>
203 +Date: Tue, 9 May 2017 13:39:23 +0200
204 +Subject: [PATCH] catch uncatched exception when item has lost reference.
205 + fixies #15868
206 +
207 +---
208 + python/plugins/db_manager/layer_preview.py | 10 ++++++----
209 + 1 file changed, 6 insertions(+), 4 deletions(-)
210 +
211 +diff --git a/python/plugins/db_manager/layer_preview.py b/python/plugins/db_manager/layer_preview.py
212 +index 27bba0a8f13..9947b1ef4d8 100644
213 +--- a/python/plugins/db_manager/layer_preview.py
214 ++++ b/python/plugins/db_manager/layer_preview.py
215 +@@ -25,7 +25,7 @@
216 + from qgis.PyQt.QtWidgets import QApplication
217 +
218 + from qgis.gui import QgsMapCanvas, QgsMapCanvasLayer, QgsMessageBar
219 +-from qgis.core import QgsVectorLayer, QgsMapLayerRegistry, QgsProject
220 ++from qgis.core import QgsVectorLayer, QgsMapLayerRegistry, QgsProject, QgsMessageLog
221 +
222 + from .db_plugins.plugin import Table
223 +
224 +@@ -78,11 +78,13 @@ def setDirty(self, val=True):
225 + def _clear(self):
226 + """ remove any layers from preview canvas """
227 + if self.item is not None:
228 +- ## skip exception on RuntimeError fixes #6892
229 + try:
230 + self.item.aboutToChange.disconnect(self.setDirty)
231 +- except RuntimeError:
232 +- pass
233 ++ ## skip exception on RuntimeError fixes #6892
234 ++ ## skip TypeError and generic Exceptions fixes #15868
235 ++ ## generally due the remove of self.item object or C++ referenced object
236 ++ except Exception as ex:
237 ++ QgsMessageLog.logMessage(unicode(ex))
238 +
239 + self.item = None
240 + self.dirty = False
241
242 diff --git a/sci-geosciences/qgis/qgis-2.18.9.ebuild b/sci-geosciences/qgis/qgis-2.18.9.ebuild
243 new file mode 100644
244 index 00000000000..5464545389b
245 --- /dev/null
246 +++ b/sci-geosciences/qgis/qgis-2.18.9.ebuild
247 @@ -0,0 +1,226 @@
248 +# Copyright 1999-2017 Gentoo Foundation
249 +# Distributed under the terms of the GNU General Public License v2
250 +
251 +EAPI=6
252 +
253 +PYTHON_COMPAT=( python2_7 )
254 +PYTHON_REQ_USE="sqlite"
255 +
256 +if [[ ${PV} != *9999 ]]; then
257 + SRC_URI="http://qgis.org/downloads/${P}.tar.bz2
258 + examples? ( http://download.osgeo.org/qgis/data/qgis_sample_data.tar.gz )"
259 + KEYWORDS="~amd64 ~x86"
260 +else
261 + GIT_ECLASS="git-r3"
262 + EGIT_REPO_URI="https://github.com/${PN}/${PN^^}.git"
263 +fi
264 +inherit cmake-utils eutils fdo-mime ${GIT_ECLASS} gnome2-utils python-single-r1
265 +unset GIT_ECLASS
266 +
267 +DESCRIPTION="User friendly Geographic Information System"
268 +HOMEPAGE="http://www.qgis.org/"
269 +
270 +LICENSE="GPL-2+ GPL-3+"
271 +SLOT="0"
272 +IUSE="designer examples georeferencer grass mapserver oracle postgres python touch"
273 +
274 +REQUIRED_USE="
275 + mapserver? ( python )
276 + python? ( ${PYTHON_REQUIRED_USE} )"
277 +
278 +COMMON_DEPEND="
279 + app-crypt/qca:2[qt5,ssl]
280 + >=dev-db/spatialite-4.1.0
281 + dev-db/sqlite:3
282 + dev-libs/expat
283 + dev-qt/qtconcurrent:5
284 + dev-qt/qtcore:5
285 + dev-qt/qtgui:5
286 + dev-qt/qtnetwork:5
287 + dev-qt/qtpositioning:5
288 + dev-qt/qtprintsupport:5
289 + dev-qt/qtscript:5
290 + dev-qt/qtsvg:5
291 + dev-qt/qtsql:5
292 + dev-qt/qtwebkit:5
293 + dev-qt/qtwidgets:5
294 + dev-qt/qtxml:5
295 + sci-libs/gdal:=[geos,python?,${PYTHON_USEDEP}]
296 + sci-libs/geos
297 + sci-libs/libspatialindex:=
298 + sci-libs/proj
299 + x11-libs/qscintilla:=[qt5]
300 + >=x11-libs/qwt-6.1.2:6=[qt5,svg]
301 + >=x11-libs/qwtpolar-1.1.1-r1[qt5]
302 + designer? ( dev-qt/designer:5 )
303 + georeferencer? ( sci-libs/gsl:= )
304 + grass? ( >=sci-geosciences/grass-7.0.0:= )
305 + mapserver? ( dev-libs/fcgi )
306 + oracle? (
307 + dev-db/oracle-instantclient:=
308 + sci-libs/gdal:=[oracle]
309 + )
310 + postgres? ( dev-db/postgresql:= )
311 + python? ( ${PYTHON_DEPS}
312 + dev-python/future[${PYTHON_USEDEP}]
313 + dev-python/httplib2[${PYTHON_USEDEP}]
314 + dev-python/jinja[${PYTHON_USEDEP}]
315 + dev-python/markupsafe[${PYTHON_USEDEP}]
316 + dev-python/pygments[${PYTHON_USEDEP}]
317 + dev-python/PyQt5[sql,svg,webkit,${PYTHON_USEDEP}]
318 + dev-python/python-dateutil[${PYTHON_USEDEP}]
319 + dev-python/pytz[${PYTHON_USEDEP}]
320 + dev-python/pyyaml[${PYTHON_USEDEP}]
321 + dev-python/qscintilla-python[qt5,${PYTHON_USEDEP}]
322 + dev-python/requests[${PYTHON_USEDEP}]
323 + dev-python/sip:=[${PYTHON_USEDEP}]
324 + dev-python/six[${PYTHON_USEDEP}]
325 + postgres? ( dev-python/psycopg:2[${PYTHON_USEDEP}] )
326 + )
327 +"
328 +DEPEND="${COMMON_DEPEND}
329 + dev-qt/qttest:5
330 + dev-qt/qtxmlpatterns:5
331 + sys-devel/bison
332 + sys-devel/flex
333 +"
334 +RDEPEND="${COMMON_DEPEND}
335 + sci-geosciences/gpsbabel
336 +"
337 +
338 +# Disabling test suite because upstream disallow running from install path
339 +RESTRICT="test"
340 +
341 +PATCHES=(
342 + "${FILESDIR}/${P}-broken-psycopg2-encoding.patch"
343 + "${FILESDIR}/${P}-fix-plugin-config-settings.patch"
344 + "${FILESDIR}/${P}-dbmanager-plugin-exceptions.patch"
345 + "${FILESDIR}/${P}-uncaught-exception.patch"
346 + # TODO upstream
347 + "${FILESDIR}/${PN}-2.18.6-featuresummary.patch"
348 + "${FILESDIR}/${PN}-2.18.6-python.patch"
349 +)
350 +
351 +pkg_setup() {
352 + python-single-r1_pkg_setup
353 +}
354 +
355 +src_prepare() {
356 + cmake-utils_src_prepare
357 +
358 + cd src/plugins || die
359 + use georeferencer || cmake_comment_add_subdirectory georeferencer
360 +}
361 +
362 +src_configure() {
363 + local mycmakeargs=(
364 + -DQGIS_MANUAL_SUBDIR=/share/man/
365 + -DBUILD_SHARED_LIBS=ON
366 + -DQGIS_LIB_SUBDIR=$(get_libdir)
367 + -DQGIS_PLUGIN_SUBDIR=$(get_libdir)/qgis
368 + -DQWT_INCLUDE_DIR=/usr/include/qwt6
369 + -DQWT_LIBRARY=/usr/$(get_libdir)/libqwt6-qt5.so
370 + -DWITH_INTERNAL_QWTPOLAR=OFF
371 + -DPEDANTIC=OFF
372 + -DWITH_APIDOC=OFF
373 + -DWITH_QSPATIALITE=ON
374 + -DENABLE_TESTS=OFF
375 + -DENABLE_QT5=ON
376 + -DENABLE_PYTHON3=$(python_is_python3)
377 + -DWITH_CUSTOM_WIDGETS=$(usex designer)
378 + -DWITH_GRASS=$(usex grass)
379 + -DWITH_SERVER=$(usex mapserver)
380 + -DWITH_ORACLE=$(usex oracle)
381 + -DWITH_POSTGRESQL=$(usex postgres)
382 + -DWITH_BINDINGS=$(usex python)
383 + -DWITH_TOUCH="$(usex touch)"
384 + )
385 +# # FIXME: Re-add when segfaults were figured out upstream, bug #612070
386 +# -DWITH_QTWEBKIT=$(usex webkit)
387 +
388 + if has_version '<x11-libs/qscintilla-2.10'; then
389 + mycmakeargs+=(
390 + -DQSCINTILLA_LIBRARY=/usr/$(get_libdir)/libqscintilla2.so
391 + )
392 + fi
393 +
394 + if use grass; then
395 + mycmakeargs+=(
396 + -DWITH_GRASS7=ON
397 + -DGRASS_PREFIX7=/usr/$(get_libdir)/grass70
398 + )
399 + fi
400 +
401 + if use python; then
402 + mycmakeargs+=(
403 + -DBINDINGS_GLOBAL_INSTALL=ON
404 + -DWITH_PYSPATIALITE=ON
405 + -DWITH_INTERNAL_DATEUTIL=OFF
406 + -DWITH_INTERNAL_FUTURE=OFF
407 + -DWITH_INTERNAL_MARKUPSAFE=OFF
408 + -DWITH_INTERNAL_PYTZ=OFF
409 + -DWITH_INTERNAL_SIX=OFF
410 + -DWITH_INTERNAL_YAML=OFF
411 + )
412 + fi
413 +
414 + cmake-utils_src_configure
415 +}
416 +
417 +src_install() {
418 + cmake-utils_src_install
419 +
420 + domenu debian/qgis.desktop
421 +
422 + local size type
423 + for size in 16 22 24 32 48 64 96 128 256; do
424 + newicon -s ${size} debian/${PN}-icon${size}x${size}.png ${PN}.png
425 + newicon -c mimetypes -s ${size} debian/${PN}-mime-icon${size}x${size}.png ${PN}-mime.png
426 + for type in qgs qml qlr qpt; do
427 + newicon -c mimetypes -s ${size} debian/${PN}-${type}${size}x${size}.png ${PN}-${type}.png
428 + done
429 + done
430 + newicon -s scalable images/icons/qgis_icon.svg qgis.svg
431 +
432 + insinto /usr/share/mime/packages
433 + doins debian/qgis.xml
434 +
435 + if use examples; then
436 + docinto examples
437 + dodoc -r "${WORKDIR}"/qgis_sample_data/.
438 + docompress -x /usr/share/doc/${PF}/examples
439 + fi
440 +
441 + python_optimize "${ED%/}"/usr/share/qgis/python
442 +
443 + if use grass; then
444 + python_fix_shebang "${ED%/}"/usr/share/qgis/grass/scripts
445 + fi
446 +}
447 +
448 +pkg_preinst() {
449 + gnome2_icon_savelist
450 +}
451 +
452 +pkg_postinst() {
453 + if use postgres; then
454 + elog "If you don't intend to use an external PostGIS server"
455 + elog "you should install:"
456 + elog " dev-db/postgis"
457 + elif use python; then
458 + elog "Support of PostgreSQL is disabled."
459 + elog "But some installed python-plugins import the psycopg2 module."
460 + elog "If you do not need these plugins just disable them"
461 + elog "in the Plugins menu, else you need to set USE=\"postgres\""
462 + fi
463 +
464 + gnome2_icon_cache_update
465 + fdo-mime_mime_database_update
466 + fdo-mime_desktop_database_update
467 +}
468 +
469 +pkg_postrm() {
470 + gnome2_icon_cache_update
471 + fdo-mime_mime_database_update
472 + fdo-mime_desktop_database_update
473 +}