1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE="sqlite"
10 inherit eutils gnome2-utils cmake-utils python-single-r1
12 DESCRIPTION="User friendly Geographic Information System"
13 HOMEPAGE="http://www.qgis.org/"
15 http://qgis.org/downloads/qgis-${PV}.tar.bz2
16 examples? ( http://download.osgeo.org/qgis/data/qgis_sample_data.tar.gz )"
18 LICENSE="GPL-2+ GPL-3+"
20 KEYWORDS="~amd64 ~x86"
21 IUSE="examples georeferencer grass mapserver oracle postgres python"
23 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
24 mapserver? ( python )"
29 sci-geosciences/gpsbabel
30 >=sci-libs/gdal-1.6.1:=[geos,python?,${PYTHON_USEDEP}]
32 sci-libs/libspatialindex:=
44 ( || ( <x11-libs/qwt-6.1.2:6[svg] >=x11-libs/qwt-6.1.2:6[svg,qt4] ) >=x11-libs/qwtpolar-1 )
45 ( x11-libs/qwt:5[svg] <x11-libs/qwtpolar-1 )
47 georeferencer? ( sci-libs/gsl:= )
48 grass? ( || ( >=sci-geosciences/grass-7.0.0:= ) )
49 mapserver? ( dev-libs/fcgi )
50 oracle? ( dev-db/oracle-instantclient:= )
51 postgres? ( dev-db/postgresql:= )
53 dev-python/PyQt4[X,sql,svg,webkit,${PYTHON_USEDEP}]
54 dev-python/sip[${PYTHON_USEDEP}]
55 dev-python/qscintilla-python[${PYTHON_USEDEP}]
56 dev-python/python-dateutil[${PYTHON_USEDEP}]
57 dev-python/httplib2[${PYTHON_USEDEP}]
58 dev-python/jinja[${PYTHON_USEDEP}]
59 dev-python/markupsafe[${PYTHON_USEDEP}]
60 dev-python/pygments[${PYTHON_USEDEP}]
61 dev-python/pytz[${PYTHON_USEDEP}]
62 dev-python/six[${PYTHON_USEDEP}]
63 postgres? ( dev-python/psycopg:2[${PYTHON_USEDEP}] )
68 app-crypt/qca:2[qt4,ssl]
75 DOCS=( BUGS ChangeLog NEWS )
77 # Disabling test suite because upstream disallow running from install path
81 python-single-r1_pkg_setup
88 use georeferencer || cmake_comment_add_subdirectory "georeferencer"
93 -DQGIS_MANUAL_SUBDIR=/share/man/
94 -DBUILD_SHARED_LIBS=ON
95 -DQGIS_LIB_SUBDIR=$(get_libdir)
96 -DQGIS_PLUGIN_SUBDIR=$(get_libdir)/qgis
97 -DWITH_INTERNAL_DATEUTIL=OFF
98 -DWITH_INTERNAL_HTTPLIB2=OFF
99 -DWITH_INTERNAL_JINJA2=OFF
100 -DWITH_INTERNAL_MARKUPSAFE=OFF
101 -DWITH_INTERNAL_PYGMENTS=OFF
102 -DWITH_INTERNAL_PYTZ=OFF
103 -DWITH_INTERNAL_QWTPOLAR=OFF
104 -DWITH_INTERNAL_SIX=OFF
107 -DWITH_QSPATIALITE=ON
109 -DWITH_BINDINGS="$(usex python)"
110 -DWITH_GRASS7="$(usex grass)"
111 $(usex grass "-DGRASS_PREFIX=/usr/" "")
112 -DWITH_ORACLE="$(usex oracle)"
113 -DWITH_POSTGRESQL="$(usex postgres)"
114 -DWITH_PYSPATIALITE="$(usex python)"
115 -DWITH_SERVER="$(usex mapserver)"
118 if has_version '>=x11-libs/qwtpolar-1' && has_version 'x11-libs/qwt:5' ; then
119 elog "Both >=x11-libs/qwtpolar-1 and x11-libs/qwt:5 installed. Force build with qwt6"
120 if has_version '>=x11-libs/qwt-6.1.2' ; then
122 "-DQWT_INCLUDE_DIR=/usr/include/qwt6"
123 "-DQWT_LIBRARY=/usr/$(get_libdir)/libqwt6-qt4.so"
127 "-DQWT_INCLUDE_DIR=/usr/include/qwt6"
128 "-DQWT_LIBRARY=/usr/$(get_libdir)/libqwt6.so"
133 cmake-utils_src_configure
137 cmake-utils_src_install
139 newicon -s 128 images/icons/qgis-icon.png qgis.png
140 make_desktop_entry qgis "QGIS" qgis
142 if use examples; then
143 insinto /usr/share/doc/${PF}/examples
144 doins -r "${WORKDIR}"/qgis_sample_data/*
147 python_optimize "${D}"/usr/share/qgis/python \
148 "${D}"/$(python_get_sitedir)/qgis \
149 "${D}"/$(python_get_sitedir)/pyspatialite
152 python_fix_shebang "${D}"/usr/share/qgis/grass/scripts
153 python_optimize "${D}"/usr/share/qgis/grass/scripts
162 if use postgres; then
163 elog "If you don't intend to use an external PostGIS server"
164 elog "you should install:"
165 elog " dev-db/postgis"
166 elif use python; then
167 elog "Support of PostgreSQL is disabled."
168 elog "But some installed python-plugins import the psycopg2 module."
169 elog "If you do not need these plugins just disable them"
170 elog "in the Plugins menu, else you need to set USE=\"postgres\""
173 gnome2_icon_cache_update
177 gnome2_icon_cache_update