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 grass gsl 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 gsl? ( sci-libs/gsl:= )
33 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 grass? ( || ( >=sci-geosciences/grass-7.0.0:= ) )
48 mapserver? ( dev-libs/fcgi )
49 oracle? ( dev-db/oracle-instantclient:= )
50 postgres? ( dev-db/postgresql:= )
52 dev-python/PyQt4[X,sql,svg,webkit,${PYTHON_USEDEP}]
53 dev-python/sip[${PYTHON_USEDEP}]
54 dev-python/qscintilla-python[${PYTHON_USEDEP}]
55 dev-python/python-dateutil[${PYTHON_USEDEP}]
56 dev-python/httplib2[${PYTHON_USEDEP}]
57 dev-python/jinja[${PYTHON_USEDEP}]
58 dev-python/markupsafe[${PYTHON_USEDEP}]
59 dev-python/pygments[${PYTHON_USEDEP}]
60 dev-python/pytz[${PYTHON_USEDEP}]
61 dev-python/six[${PYTHON_USEDEP}]
62 postgres? ( dev-python/psycopg:2[${PYTHON_USEDEP}] )
67 app-crypt/qca:2[qt4,ssl]
74 DOCS=( BUGS ChangeLog NEWS )
76 # Disabling test suite because upstream disallow running from install path
80 python-single-r1_pkg_setup
85 "-DQGIS_MANUAL_SUBDIR=/share/man/"
86 "-DBUILD_SHARED_LIBS=ON"
87 "-DQGIS_LIB_SUBDIR=$(get_libdir)"
88 "-DQGIS_PLUGIN_SUBDIR=$(get_libdir)/qgis"
89 "-DWITH_INTERNAL_DATEUTIL=OFF"
90 "-DWITH_INTERNAL_HTTPLIB2=OFF"
91 "-DWITH_INTERNAL_JINJA2=OFF"
92 "-DWITH_INTERNAL_MARKUPSAFE=OFF"
93 "-DWITH_INTERNAL_PYGMENTS=OFF"
94 "-DWITH_INTERNAL_PYTZ=OFF"
95 "-DWITH_INTERNAL_QWTPOLAR=OFF"
96 "-DWITH_INTERNAL_SIX=OFF"
99 "-DWITH_SPATIALITE=ON"
100 "-DWITH_INTERNAL_SPATIALITE=OFF"
102 -DWITH_BINDINGS="$(usex python)"
103 -DWITH_BINDINGS_GLOBAL_INSTALL="$(usex python)"
104 -DWITH_GRASS="$(usex grass)"
105 $(usex grass "-DGRASS_PREFIX=/usr/" "")
106 -DWITH_GSL="$(usex gsl)"
107 -DWITH_ORACLE="$(usex oracle)"
108 -DWITH_POSTGRESQL="$(usex postgres)"
109 -DWITH_PYSPATIALITE="$(usex python)"
110 -DWITH_SERVER="$(usex mapserver)"
113 if has_version '>=x11-libs/qwtpolar-1' && has_version 'x11-libs/qwt:5' ; then
114 elog "Both >=x11-libs/qwtpolar-1 and x11-libs/qwt:5 installed. Force build with qwt6"
115 if has_version '>=x11-libs/qwt-6.1.2' ; then
117 "-DQWT_INCLUDE_DIR=/usr/include/qwt6"
118 "-DQWT_LIBRARY=/usr/$(get_libdir)/libqwt6-qt4.so"
122 "-DQWT_INCLUDE_DIR=/usr/include/qwt6"
123 "-DQWT_LIBRARY=/usr/$(get_libdir)/libqwt6.so"
128 cmake-utils_src_configure
132 cmake-utils_src_install
134 newicon -s 128 images/icons/qgis-icon.png qgis.png
135 make_desktop_entry qgis "QGIS " qgis
137 if use examples; then
138 insinto /usr/share/doc/${PF}/examples
139 doins -r "${WORKDIR}"/qgis_sample_data/*
142 python_optimize "${D}"/usr/share/qgis/python \
143 "${D}"/$(python_get_sitedir)/qgis \
144 "${D}"/$(python_get_sitedir)/pyspatialite
147 python_fix_shebang "${D}"/usr/share/qgis/grass/scripts
148 python_optimize "${D}"/usr/share/qgis/grass/scripts
157 if use postgres; then
158 elog "If you don't intend to use an external PostGIS server"
159 elog "you should install:"
160 elog " dev-db/postgis"
163 elog "Support of PostgreSQL is disabled."
164 elog "But some installed python-plugins needs import psycopg2 module."
165 elog "If you do not need this modules just disable them in main menu."
166 elog "Or you need to set USE=postgres"
170 gnome2_icon_cache_update
174 gnome2_icon_cache_update