Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-geosciences/grass/
Date: Sun, 04 Oct 2020 15:24:17
Message-Id: 1601825031.b91a9b0c0e3e42ad10ed685981d1468046dceaeb.soap@gentoo
1 commit: b91a9b0c0e3e42ad10ed685981d1468046dceaeb
2 Author: Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
3 AuthorDate: Sun Oct 4 15:23:51 2020 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 4 15:23:51 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b91a9b0c
7
8 sci-geosciences/grass: readd package
9
10 * Readd package for the GRASS Geographic Information System. GRASS was
11 removed from the tree due to dropping Python 2 Support. This commit
12 readds a recent version of GRASS which doesn't depends on Python 2.
13
14 Bug: https://bugs.gentoo.org/682188
15 Bug: https://bugs.gentoo.org/735458
16 Closes: https://bugs.gentoo.org/744724
17 Closes: https://github.com/gentoo/gentoo/pull/15399
18 Closes: https://github.com/gentoo/gentoo/pull/17361
19 Closes: https://github.com/gentoo/gentoo/pull/17666
20 Package-Manager: Portage-3.0.4, Repoman-3.0.1
21 Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
22 Signed-off-by: David Seifert <soap <AT> gentoo.org>
23
24 sci-geosciences/grass/Manifest | 1 +
25 sci-geosciences/grass/grass-7.8.3.ebuild | 268 +++++++++++++++++++++++++++++++
26 sci-geosciences/grass/metadata.xml | 26 +++
27 3 files changed, 295 insertions(+)
28
29 diff --git a/sci-geosciences/grass/Manifest b/sci-geosciences/grass/Manifest
30 new file mode 100644
31 index 00000000000..300f80c8a3e
32 --- /dev/null
33 +++ b/sci-geosciences/grass/Manifest
34 @@ -0,0 +1 @@
35 +DIST grass-7.8.3.tar.gz 60292787 BLAKE2B e62fdeb5fa8cc64e59eff1a5cb33dbede7a62a30ed6ef08ced5d11e452e7b0109889105ae88ea28fb667b54fceca69729771eca6acf3e8d281487b1e53b1a3aa SHA512 4fa31b869771737b6d11090acfc54dd155c9ac6a259611774a75a74b8ebb59c640dc3417ff8027d91bf3444427525f9c35f32e317677b05809ab3d7aeb03dc84
36
37 diff --git a/sci-geosciences/grass/grass-7.8.3.ebuild b/sci-geosciences/grass/grass-7.8.3.ebuild
38 new file mode 100644
39 index 00000000000..ab8ab4cf98a
40 --- /dev/null
41 +++ b/sci-geosciences/grass/grass-7.8.3.ebuild
42 @@ -0,0 +1,268 @@
43 +# Copyright 1999-2020 Gentoo Authors
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +EAPI=7
47 +
48 +PYTHON_COMPAT=( python3_{6..9} )
49 +PYTHON_REQ_USE="sqlite" # bug 572440
50 +WANT_AUTOCONF="2.1"
51 +WX_GTK_VER=3.0
52 +
53 +inherit autotools desktop flag-o-matic python-single-r1 toolchain-funcs wxwidgets xdg
54 +
55 +MY_PM=${PN}$(ver_cut 1-2 ${PV})
56 +MY_PM=${MY_PM/.}
57 +MY_P=${P/_rc/RC}
58 +
59 +DESCRIPTION="A free GIS with raster and vector functionality, as well as 3D vizualization"
60 +HOMEPAGE="https://grass.osgeo.org/"
61 +SRC_URI="https://grass.osgeo.org/${MY_PM}/source/${MY_P}.tar.gz"
62 +
63 +LICENSE="GPL-2"
64 +SLOT="0/7.8.0"
65 +KEYWORDS="~amd64 ~ppc ~x86"
66 +IUSE="blas cxx fftw geos lapack liblas mysql netcdf nls odbc opencl opengl openmp png postgres readline sqlite threads tiff truetype X zstd"
67 +REQUIRED_USE="
68 + ${PYTHON_REQUIRED_USE}
69 + opengl? ( X )"
70 +
71 +RDEPEND="
72 + ${PYTHON_DEPS}
73 + >=app-admin/eselect-1.2
74 + $(python_gen_cond_dep '
75 + dev-python/numpy[${PYTHON_USEDEP}]
76 + dev-python/six[${PYTHON_USEDEP}]
77 + ')
78 + sci-libs/gdal
79 + sys-libs/gdbm
80 + sys-libs/ncurses:0=
81 + sci-libs/proj
82 + sci-libs/xdrfile
83 + sys-libs/zlib
84 + blas? (
85 + virtual/cblas[eselect-ldso(+)]
86 + virtual/blas[eselect-ldso(+)]
87 + )
88 + fftw? ( sci-libs/fftw:3.0= )
89 + geos? ( sci-libs/geos )
90 + lapack? ( virtual/lapack[eselect-ldso(+)] )
91 + liblas? ( sci-geosciences/liblas )
92 + mysql? ( dev-db/mysql-connector-c:= )
93 + netcdf? ( sci-libs/netcdf )
94 + odbc? ( dev-db/unixODBC )
95 + opencl? ( virtual/opencl )
96 + opengl? ( virtual/opengl )
97 + png? ( media-libs/libpng:0= )
98 + postgres? ( >=dev-db/postgresql-8.4:= )
99 + readline? ( sys-libs/readline:0= )
100 + sqlite? ( dev-db/sqlite:3 )
101 + tiff? ( media-libs/tiff:0= )
102 + truetype? ( media-libs/freetype:2 )
103 + X? (
104 + dev-python/wxpython:4.0
105 + x11-libs/cairo[X,opengl?]
106 + x11-libs/libICE
107 + x11-libs/libSM
108 + x11-libs/libX11
109 + x11-libs/libXext
110 + x11-libs/libXt
111 + )
112 + zstd? ( app-arch/zstd )"
113 +DEPEND="${RDEPEND}
114 + X? ( x11-base/xorg-proto )"
115 +BDEPEND="
116 + sys-devel/bison
117 + sys-devel/flex
118 + sys-devel/gettext
119 + virtual/pkgconfig
120 + X? ( dev-lang/swig )"
121 +
122 +S="${WORKDIR}/${MY_P}"
123 +
124 +pkg_setup() {
125 + if use lapack; then
126 + local mylapack=$(eselect lapack show)
127 + if [[ -z "${mylapack/.*reference.*/}" ]] && \
128 + [[ -z "${mylapack/.*atlas.*/}" ]]; then
129 + ewarn "You need to set lapack to atlas or reference. Do:"
130 + ewarn " eselect lapack set <impl>"
131 + ewarn "where <impl> is atlas, threaded-atlas or reference"
132 + die "setup failed"
133 + fi
134 + fi
135 +
136 + if use blas; then
137 + local myblas=$(eselect blas show)
138 + if [[ -z "${myblas/.*reference.*/}" ]] && \
139 + [[ -z "${myblas/.*atlas.*/}" ]]; then
140 + ewarn "You need to set blas to atlas or reference. Do:"
141 + ewarn " eselect blas set <impl>"
142 + ewarn "where <impl> is atlas, threaded-atlas or reference"
143 + die "setup failed"
144 + fi
145 + fi
146 +
147 + python-single-r1_pkg_setup
148 +}
149 +
150 +src_prepare() {
151 + # Fix unversioned python calls
152 + sed -e "s:=python3:=${EPYTHON}:" -i "${S}/lib/init/grass.sh" || die
153 + sed -e "s:= python3:= ${EPYTHON}:" -i "${S}/include/Make/Platform.make.in" || die
154 +
155 + default
156 + eautoreconf
157 +
158 + ebegin "Fixing python shebangs"
159 + python_fix_shebang -q "${S}"
160 + eend $?
161 +
162 + # For testsuite, see https://bugs.gentoo.org/show_bug.cgi?id=500580#c3
163 + shopt -s nullglob
164 + local mesa_cards=$(echo -n /dev/dri/card* /dev/dri/render* | sed 's/ /:/g')
165 + if test -n "${mesa_cards}"; then
166 + addpredict "${mesa_cards}"
167 + fi
168 + local ati_cards=$(echo -n /dev/ati/card* | sed 's/ /:/g')
169 + if test -n "${ati_cards}"; then
170 + addpredict "${ati_cards}"
171 + fi
172 + shopt -u nullglob
173 + addpredict /dev/nvidiactl
174 +
175 + eapply_user
176 +}
177 +
178 +src_configure() {
179 + if use X; then
180 + local WX_BUILD=yes
181 + setup-wxwidgets
182 + fi
183 +
184 + addwrite /dev/dri/renderD128
185 +
186 + local myeconfargs=(
187 + --enable-shared
188 + --disable-w11
189 + --without-opendwg
190 + --with-regex
191 + --with-gdal="${EPREFIX}"/usr/bin/gdal-config
192 + --with-proj-includes="${EPREFIX}"/usr/include/proj
193 + --with-proj-libs="${EPREFIX}"/usr/$(get_libdir)
194 + --with-proj-share="${EPREFIX}"/usr/share/proj/
195 + $(use_with cxx)
196 + $(use_with tiff)
197 + $(use_with png)
198 + $(use_with postgres)
199 + $(use_with mysql)
200 + $(use_with mysql mysql-includes "${EPREFIX}"/usr/include/mysql)
201 + $(use_with sqlite)
202 + $(use_with opengl)
203 + $(use_with odbc)
204 + $(use_with fftw)
205 + $(use_with blas)
206 + $(use_with lapack)
207 + $(use_with X cairo)
208 + $(use_with truetype freetype)
209 + $(use_with truetype freetype-includes "${EPREFIX}"/usr/include/freetype2)
210 + $(use_with nls)
211 + $(use_with readline)
212 + $(use_with threads pthread)
213 + $(use_with openmp)
214 + $(use_with opencl)
215 + $(use_with liblas liblas "${EPREFIX}"/usr/bin/liblas-config)
216 + $(use_with X wxwidgets "${WX_CONFIG}")
217 + $(use_with netcdf netcdf "${EPREFIX}"/usr/bin/nc-config)
218 + $(use_with geos geos "${EPREFIX}"/usr/bin/geos-config)
219 + $(use_with X x)
220 + $(use_with zstd)
221 + )
222 + econf "${myeconfargs[@]}"
223 +}
224 +
225 +src_compile() {
226 + # we don't want to link against embedded mysql lib
227 + emake CC="$(tc-getCC)" MYSQLDLIB=""
228 +}
229 +
230 +src_install() {
231 + emake DESTDIR="${ED}" \
232 + INST_DIR="${ED}"/usr/$(get_libdir)/${MY_PM} \
233 + prefix="${ED}"/usr/ BINDIR="${ED}"/usr/bin \
234 + PREFIX="${ED}"/usr/ \
235 + install
236 +
237 + pushd "${ED}"/usr/$(get_libdir)/${MY_PM} >/dev/null || die
238 +
239 + local HTML_DOCS=( docs/html/. )
240 + einstalldocs
241 +
242 + # manuals
243 + dodir /usr/share/man/man1
244 + rm -rf man/ || die
245 +
246 + # translations
247 + if use nls; then
248 + insinto /usr/share/locale
249 + doins -r locale/.
250 + fi
251 +
252 + popd >/dev/null || die
253 +
254 + # link libraries in the ~standard~ place
255 + local f file
256 + for f in "${ED}"/usr/$(get_libdir)/${MY_PM}/lib/*; do
257 + file="${f##*/}"
258 + dosym ${MY_PM}/lib/${file} /usr/$(get_libdir)/${file}
259 + done
260 +
261 + # link headers in the ~standard~ place
262 + dodir /usr/include/
263 + dosym ../$(get_libdir)/${MY_PM}/include/grass /usr/include/grass
264 +
265 + # fix paths in addons makefile includes
266 + local scriptMakeDir="${ED}"/usr/$(get_libdir)/${MY_PM}/include/Make/
267 + for f in "${scriptMakeDir}"/*; do
268 + file="${f##*/}"
269 + echo sed -i "s|${ED}|/|g" "${scriptMakeDir}/${file}" || die
270 + sed -i "s|${ED}|/|g" "${scriptMakeDir}/${file}" || die
271 + done
272 +
273 + # get proper folder for grass path in script
274 + local gisbase=/usr/$(get_libdir)/${MY_PM}
275 + sed -e "s:GISBASE = os.path.normpath(\"${D}/usr/$(get_libdir)/${MY_PM}\"):\
276 +GISBASE = os.path.normpath(\"${gisbase}\"):" \
277 + -i "${ED}"/usr/bin/${MY_PM} || die
278 +
279 + # get proper fonts path for fontcap
280 + sed -i \
281 + -e "s|${ED}/usr/${MY_PM}|${EPREFIX}/usr/$(get_libdir)/${MY_PM}|" \
282 + "${ED}"/usr/$(get_libdir)/${MY_PM}/etc/fontcap || die
283 +
284 + # set proper python interpreter
285 + sed -e "s:os.environ\['GRASS_PYTHON'\] = \"python3\":\
286 +os.environ\['GRASS_PYTHON'\] = \"${EPYTHON}\":" \
287 + -i "${ED}"/usr/bin/${MY_PM} || die
288 +
289 + if use X; then
290 + local GUI="-gui"
291 + [[ ${WX_BUILD} == yes ]] && GUI="-wxpython"
292 + make_desktop_entry "/usr/bin/${MY_PM} ${GUI}" "${PN}" "${PN}-48x48" "Science;Education"
293 + doicon -s 48 gui/icons/${PN}-48x48.png
294 + fi
295 +
296 + # install .pc file so other apps know where to look for grass
297 + insinto /usr/$(get_libdir)/pkgconfig/
298 + doins grass.pc
299 +
300 + # fix weird +x on tcl scripts
301 + find "${ED}" -name "*.tcl" -exec chmod +r-x '{}' \; || die
302 +}
303 +
304 +pkg_postinst() {
305 + use X && xdg_pkg_postinst
306 +}
307 +
308 +pkg_postrm() {
309 + use X && xdg_pkg_postrm
310 +}
311
312 diff --git a/sci-geosciences/grass/metadata.xml b/sci-geosciences/grass/metadata.xml
313 new file mode 100644
314 index 00000000000..0f889711e12
315 --- /dev/null
316 +++ b/sci-geosciences/grass/metadata.xml
317 @@ -0,0 +1,26 @@
318 +<?xml version="1.0" encoding="UTF-8"?>
319 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
320 +<pkgmetadata>
321 + <maintainer type="person">
322 + <email>mario.haustein@×××××××××××××××.de</email>
323 + <name>Mario Haustein</name>
324 + </maintainer>
325 + <maintainer type="project">
326 + <email>proxy-maint@g.o</email>
327 + <name>Proxy Maintainers</name>
328 + </maintainer>
329 + <maintainer type="project">
330 + <email>sci-geosciences@g.o</email>
331 + <name>Gentoo Geosciences Project</name>
332 + </maintainer>
333 + <longdescription>
334 + The original GIS, yes the first one, developed by the US
335 + Army Corp of Engineers, now an active open source GIS. See the GRASS Documentation
336 + Project for more info http://grass.itc.it/gdp/index.php
337 + </longdescription>
338 + <use>
339 + <flag name="geos">Use <pkg>sci-libs/geos</pkg> for v.buffer and adds extended options to the v.select module</flag>
340 + <flag name="liblas">Include support for LAS and LAZ encoded LiDAR files through <pkg>sci-geosciences/liblas</pkg></flag>
341 + <flag name="opencl">Enable OpenCL support</flag>
342 + </use>
343 +</pkgmetadata>