Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2018 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
EAPI=6 |
5 |
|
6 |
PYTHON_COMPAT=( python3_{5,6} ) |
7 |
PYTHON_REQ_USE="sqlite" |
8 |
QT_MIN_VER="5.9.4" |
9 |
|
10 |
if [[ ${PV} != *9999 ]]; then |
11 |
SRC_URI="https://qgis.org/downloads/${P}.tar.bz2 |
12 |
examples? ( https://qgis.org/downloads/data/qgis_sample_data.tar.gz -> qgis_sample_data-2.8.14.tar.gz )" |
13 |
KEYWORDS="~amd64 ~x86" |
14 |
else |
15 |
GIT_ECLASS="git-r3" |
16 |
EGIT_REPO_URI="https://github.com/${PN}/${PN^^}.git" |
17 |
fi |
18 |
inherit cmake-utils desktop ${GIT_ECLASS} gnome2-utils python-single-r1 qmake-utils xdg-utils |
19 |
unset GIT_ECLASS |
20 |
|
21 |
DESCRIPTION="User friendly Geographic Information System" |
22 |
HOMEPAGE="https://www.qgis.org/" |
23 |
|
24 |
LICENSE="GPL-2+ GPL-3+" |
25 |
SLOT="0" |
26 |
IUSE="3d examples georeferencer grass mapserver oracle polar postgres python +webkit" |
27 |
|
28 |
REQUIRED_USE="${PYTHON_REQUIRED_USE} mapserver? ( python )" |
29 |
|
30 |
COMMON_DEPEND=" |
31 |
app-crypt/qca:2[qt5(+),ssl] |
32 |
>=dev-db/spatialite-4.2.0 |
33 |
dev-db/sqlite:3 |
34 |
dev-libs/expat |
35 |
dev-libs/libzip:= |
36 |
dev-libs/qtkeychain[qt5(+)] |
37 |
>=dev-qt/designer-${QT_MIN_VER}:5 |
38 |
>=dev-qt/qtconcurrent-${QT_MIN_VER}:5 |
39 |
>=dev-qt/qtcore-${QT_MIN_VER}:5 |
40 |
>=dev-qt/qtgui-${QT_MIN_VER}:5 |
41 |
>=dev-qt/qtnetwork-${QT_MIN_VER}:5[ssl] |
42 |
>=dev-qt/qtpositioning-${QT_MIN_VER}:5 |
43 |
>=dev-qt/qtprintsupport-${QT_MIN_VER}:5 |
44 |
>=dev-qt/qtsvg-${QT_MIN_VER}:5 |
45 |
>=dev-qt/qtsql-${QT_MIN_VER}:5 |
46 |
>=dev-qt/qtwidgets-${QT_MIN_VER}:5 |
47 |
>=dev-qt/qtxml-${QT_MIN_VER}:5 |
48 |
>=sci-libs/gdal-2.2.3:=[geos] |
49 |
sci-libs/geos |
50 |
sci-libs/libspatialindex:= |
51 |
sci-libs/proj |
52 |
>=x11-libs/qscintilla-2.10.1:=[qt5(+)] |
53 |
>=x11-libs/qwt-6.1.2:6=[qt5(+),svg] |
54 |
3d? ( >=dev-qt/qt3d-${QT_MIN_VER}:5 ) |
55 |
georeferencer? ( sci-libs/gsl:= ) |
56 |
grass? ( =sci-geosciences/grass-7*:= ) |
57 |
mapserver? ( dev-libs/fcgi ) |
58 |
oracle? ( |
59 |
dev-db/oracle-instantclient:= |
60 |
sci-libs/gdal:=[oracle] |
61 |
) |
62 |
polar? ( >=x11-libs/qwtpolar-1.1.1-r1[qt5(+)] ) |
63 |
postgres? ( dev-db/postgresql:= ) |
64 |
python? ( |
65 |
${PYTHON_DEPS} |
66 |
dev-python/future[${PYTHON_USEDEP}] |
67 |
dev-python/httplib2[${PYTHON_USEDEP}] |
68 |
dev-python/jinja[${PYTHON_USEDEP}] |
69 |
dev-python/markupsafe[${PYTHON_USEDEP}] |
70 |
dev-python/owslib[${PYTHON_USEDEP}] |
71 |
dev-python/pygments[${PYTHON_USEDEP}] |
72 |
dev-python/PyQt5[designer,network,sql,svg,webkit?,${PYTHON_USEDEP}] |
73 |
dev-python/python-dateutil[${PYTHON_USEDEP}] |
74 |
dev-python/pytz[${PYTHON_USEDEP}] |
75 |
dev-python/pyyaml[${PYTHON_USEDEP}] |
76 |
>=dev-python/qscintilla-python-2.10.1[qt5(+),${PYTHON_USEDEP}] |
77 |
dev-python/requests[${PYTHON_USEDEP}] |
78 |
dev-python/sip:=[${PYTHON_USEDEP}] |
79 |
dev-python/six[${PYTHON_USEDEP}] |
80 |
>=sci-libs/gdal-2.2.3[python,${PYTHON_USEDEP}] |
81 |
postgres? ( dev-python/psycopg:2[${PYTHON_USEDEP}] ) |
82 |
) |
83 |
webkit? ( >=dev-qt/qtwebkit-5.9.1:5 ) |
84 |
" |
85 |
DEPEND="${COMMON_DEPEND} |
86 |
>=dev-qt/linguist-tools-${QT_MIN_VER}:5 |
87 |
>=dev-qt/qttest-${QT_MIN_VER}:5 |
88 |
>=dev-qt/qtxmlpatterns-${QT_MIN_VER}:5 |
89 |
sys-devel/bison |
90 |
sys-devel/flex |
91 |
python? ( ${PYTHON_DEPS} ) |
92 |
" |
93 |
RDEPEND="${COMMON_DEPEND} |
94 |
sci-geosciences/gpsbabel |
95 |
" |
96 |
|
97 |
# Disabling test suite because upstream disallow running from install path |
98 |
RESTRICT="test" |
99 |
|
100 |
PATCHES=( |
101 |
# git master |
102 |
"${FILESDIR}/${PN}-2.18.12-cmake-lib-suffix.patch" |
103 |
"${FILESDIR}/${PN}-3.2.1-qtwebkit-optional.patch" # bug 663394 |
104 |
) |
105 |
|
106 |
pkg_setup() { |
107 |
python-single-r1_pkg_setup |
108 |
} |
109 |
|
110 |
src_prepare() { |
111 |
cmake-utils_src_prepare |
112 |
|
113 |
sed -e "s:\${QT_BINARY_DIR}:$(qt5_get_bindir):" \ |
114 |
-i CMakeLists.txt || die "Failed to fix lrelease path" |
115 |
|
116 |
sed -e "/QT_LRELEASE_EXECUTABLE/d" \ |
117 |
-e "/QT_LUPDATE_EXECUTABLE/s/set/find_program/" \ |
118 |
-e "s:lupdate-qt5:NAMES lupdate PATHS $(qt5_get_bindir) NO_DEFAULT_PATH:" \ |
119 |
-i cmake/modules/ECMQt4To5Porting.cmake || die "Failed to fix ECMQt4To5Porting.cmake" |
120 |
|
121 |
cd src/plugins || die |
122 |
} |
123 |
|
124 |
src_configure() { |
125 |
local mycmakeargs=( |
126 |
-DQGIS_MANUAL_SUBDIR=/share/man/ |
127 |
-DBUILD_SHARED_LIBS=ON |
128 |
-DQGIS_LIB_SUBDIR=$(get_libdir) |
129 |
-DQGIS_PLUGIN_SUBDIR=$(get_libdir)/qgis |
130 |
-DQWT_INCLUDE_DIR=/usr/include/qwt6 |
131 |
-DQWT_LIBRARY=/usr/$(get_libdir)/libqwt6-qt5.so |
132 |
-DPEDANTIC=OFF |
133 |
-DWITH_APIDOC=OFF |
134 |
-DWITH_QSPATIALITE=ON |
135 |
-DENABLE_TESTS=OFF |
136 |
-DWITH_3D=$(usex 3d) |
137 |
-DWITH_GEOREFERENCER=$(usex georeferencer) |
138 |
-DWITH_GRASS7=$(usex grass) |
139 |
-DWITH_SERVER=$(usex mapserver) |
140 |
-DWITH_ORACLE=$(usex oracle) |
141 |
-DWITH_QWTPOLAR=$(usex polar) |
142 |
-DWITH_POSTGRESQL=$(usex postgres) |
143 |
-DWITH_BINDINGS=$(usex python) |
144 |
-DWITH_CUSTOM_WIDGETS=$(usex python) |
145 |
-DWITH_QTWEBKIT=$(usex webkit) |
146 |
) |
147 |
|
148 |
if use oracle; then |
149 |
mycmakeargs+=( |
150 |
-DORACLE_INCLUDEDIR="${ORACLE_HOME}"/sdk/include |
151 |
) |
152 |
fi |
153 |
|
154 |
if use grass; then |
155 |
mycmakeargs+=( |
156 |
-DGRASS_PREFIX7=/usr/$(get_libdir)/grass70 |
157 |
) |
158 |
fi |
159 |
|
160 |
use python && mycmakeargs+=( -DBINDINGS_GLOBAL_INSTALL=ON ) |
161 |
|
162 |
# bugs 612956, 648726 |
163 |
addpredict /dev/dri/renderD128 |
164 |
addpredict /dev/dri/renderD129 |
165 |
|
166 |
cmake-utils_src_configure |
167 |
} |
168 |
|
169 |
src_install() { |
170 |
cmake-utils_src_install |
171 |
|
172 |
domenu debian/qgis.desktop |
173 |
|
174 |
local size type |
175 |
for size in 16 22 24 32 48 64 96 128 256; do |
176 |
newicon -s ${size} debian/icons/${PN}-icon${size}x${size}.png ${PN}.png |
177 |
newicon -c mimetypes -s ${size} debian/icons/${PN}-mime-icon${size}x${size}.png ${PN}-mime.png |
178 |
for type in qgs qml qlr qpt; do |
179 |
newicon -c mimetypes -s ${size} debian/icons/${PN}-${type}${size}x${size}.png ${PN}-${type}.png |
180 |
done |
181 |
done |
182 |
newicon -s scalable images/icons/qgis_icon.svg qgis.svg |
183 |
|
184 |
insinto /usr/share/mime/packages |
185 |
doins debian/qgis.xml |
186 |
|
187 |
if use examples; then |
188 |
docinto examples |
189 |
dodoc -r "${WORKDIR}"/qgis_sample_data/. |
190 |
docompress -x /usr/share/doc/${PF}/examples |
191 |
fi |
192 |
|
193 |
if use python; then |
194 |
python_optimize "${ED%/}"/usr/share/qgis/python |
195 |
fi |
196 |
|
197 |
if use grass; then |
198 |
python_fix_shebang "${ED%/}"/usr/share/qgis/grass/scripts |
199 |
fi |
200 |
} |
201 |
|
202 |
pkg_postinst() { |
203 |
if use postgres; then |
204 |
elog "If you don't intend to use an external PostGIS server" |
205 |
elog "you should install:" |
206 |
elog " dev-db/postgis" |
207 |
elif use python; then |
208 |
elog "Support of PostgreSQL is disabled." |
209 |
elog "But some installed python-plugins import the psycopg2 module." |
210 |
elog "If you do not need these plugins just disable them" |
211 |
elog "in the Plugins menu, else you need to set USE=\"postgres\"" |
212 |
fi |
213 |
if has_version "<sci-geosciences/qgis-3"; then |
214 |
elog "QGIS is now based on PyQt5. Old scripts may not work anymore." |
215 |
fi |
216 |
|
217 |
gnome2_icon_cache_update |
218 |
xdg_mimeinfo_database_update |
219 |
xdg_desktop_database_update |
220 |
} |
221 |
|
222 |
pkg_postrm() { |
223 |
gnome2_icon_cache_update |
224 |
xdg_mimeinfo_database_update |
225 |
xdg_desktop_database_update |
226 |
} |