Gentoo Archives: gentoo-commits

From: Amy Liffey <amynka@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-geosciences/grass/
Date: Sun, 09 Sep 2018 15:41:11
Message-Id: 1536507598.3ced847e135e475663778074f797538cb6e3464a.amynka@gentoo
1 commit: 3ced847e135e475663778074f797538cb6e3464a
2 Author: Gioacchino Mazzurco <gio <AT> eigenlab <DOT> org>
3 AuthorDate: Fri Aug 31 22:48:45 2018 +0000
4 Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 9 15:39:58 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ced847e
7
8 sci-geosciences/grass-7.4.1 version bump
9
10 Update to new version and avoid breaking addons installation by not
11 deleting too much things in src_install
12
13 Closes: https://bugs.gentoo.org/664886
14 Closes: https://bugs.gentoo.org/665006
15 Closes: https://github.com/gentoo/gentoo/pull/9748
16
17 sci-geosciences/grass/Manifest | 1 +
18 sci-geosciences/grass/grass-7.4.1.ebuild | 284 +++++++++++++++++++++++++++++++
19 2 files changed, 285 insertions(+)
20
21 diff --git a/sci-geosciences/grass/Manifest b/sci-geosciences/grass/Manifest
22 index 9aaa7fc6c7a..0f4623b3d19 100644
23 --- a/sci-geosciences/grass/Manifest
24 +++ b/sci-geosciences/grass/Manifest
25 @@ -1,2 +1,3 @@
26 DIST grass-7.2.0.tar.gz 48315008 BLAKE2B 927da2119e199cee7cbf55a172141abfe9ce86499e307b355fec2cdf79ec3424acddc4410e3049e7cade5dd3da39e618af7e1003093f87de5735a981984b46c6 SHA512 b1aa17ec554c2f0473df3726993b0891df4589c60ca9362405932a4c479b5883245b0a0ba9e787ce2e9de210b6307f34883e4e63ddfbf04eb5d75e8583bc2c5b
27 DIST grass-7.4.0.tar.gz 56329374 BLAKE2B 924ecd9ad073dd3c59542a871780397a2516e1f0d912b4644978154ea6305ccf50229655aa7f38ab20f2bf85e4a4783cd793fff5101423dd6c212108d638d1df SHA512 b0393ec5d149e2146cc1f30cdcea00e31039bf0a2541486ab0ecd5debe260d267d74e60761b45ce306ad9942264cce9134dbafbf3c75a55df1c610499877d321
28 +DIST grass-7.4.1.tar.gz 57969640 BLAKE2B 1d3d0fd20611971ec349bf0e26ef7d886b7047e1ec48f48584f8ba2e5562f352433c9869420d7e030e66fb5a9e60de20e6a78d1fd5142380fbcab51f700766d8 SHA512 66616e495aa798cd1ad7a0284a386f7e99741918596b816a712788114e7dc491be0b5f19551f102b436518a5cabcdedbc61042acf0a9b06b9d8df12b4de26c90
29
30 diff --git a/sci-geosciences/grass/grass-7.4.1.ebuild b/sci-geosciences/grass/grass-7.4.1.ebuild
31 new file mode 100644
32 index 00000000000..5c45e10e174
33 --- /dev/null
34 +++ b/sci-geosciences/grass/grass-7.4.1.ebuild
35 @@ -0,0 +1,284 @@
36 +# Copyright 1999-2018 Gentoo Foundation
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +
41 +PYTHON_COMPAT=( python2_7 )
42 +PYTHON_REQ_USE="sqlite" # bug 572440
43 +WANT_AUTOCONF="2.1"
44 +WX_GTK_VER=3.0
45 +
46 +inherit autotools gnome2 python-single-r1 versionator wxwidgets xdg-utils
47 +
48 +MY_PM=${PN}$(get_version_component_range 1-2 ${PV})
49 +MY_PM=${MY_PM/.}
50 +MY_P=${P/_rc/RC}
51 +
52 +DESCRIPTION="A free GIS with raster and vector functionality, as well as 3D vizualization"
53 +HOMEPAGE="http://grass.osgeo.org/"
54 +SRC_URI="http://grass.osgeo.org/${MY_PM}/source/${MY_P}.tar.gz"
55 +
56 +LICENSE="GPL-2"
57 +SLOT="0/7.4.0"
58 +KEYWORDS="~amd64 ~ppc ~x86"
59 +IUSE="X blas cxx fftw geos lapack liblas mysql netcdf nls odbc opencl opengl openmp png postgres readline sqlite threads tiff truetype"
60 +
61 +RDEPEND="${PYTHON_DEPS}
62 + >=app-admin/eselect-1.2
63 + dev-python/numpy[${PYTHON_USEDEP}]
64 + media-libs/libprojectm
65 + sci-libs/proj
66 + sci-libs/xdrfile
67 + sci-libs/gdal
68 + sys-libs/gdbm
69 + sys-libs/ncurses:0=
70 + sys-libs/zlib:=
71 + fftw? ( sci-libs/fftw:3.0= )
72 + geos? ( sci-libs/geos )
73 + blas? ( virtual/blas
74 + sci-libs/cblas-reference )
75 + lapack? ( virtual/lapack )
76 + liblas? ( sci-geosciences/liblas )
77 + mysql? ( virtual/mysql )
78 + netcdf? ( sci-libs/netcdf )
79 + odbc? ( dev-db/unixODBC )
80 + opencl? ( virtual/opencl )
81 + opengl? ( virtual/opengl )
82 + png? ( media-libs/libpng:0= )
83 + postgres? ( >=dev-db/postgresql-8.4:= )
84 + readline? ( sys-libs/readline:0= )
85 + sqlite? ( dev-db/sqlite:3 )
86 + tiff? ( media-libs/tiff:0= )
87 + truetype? ( media-libs/freetype:2 )
88 + X? (
89 + dev-python/wxpython:3.0[cairo,opengl?]
90 + x11-libs/cairo[X,opengl?]
91 + x11-libs/libICE
92 + x11-libs/libSM
93 + x11-libs/libX11
94 + x11-libs/libXext
95 + x11-libs/libXt
96 + )"
97 +
98 +DEPEND="${RDEPEND}
99 + virtual/pkgconfig
100 + sys-devel/flex
101 + sys-devel/gettext
102 + sys-devel/bison
103 + X? (
104 + dev-lang/swig
105 + x11-base/xorg-proto
106 + )"
107 +
108 +S="${WORKDIR}/${MY_P}"
109 +
110 +REQUIRED_USE="
111 + ${PYTHON_REQUIRED_USE}
112 + opengl? ( X )"
113 +
114 +PATCHES=(
115 + "${FILESDIR}/${PN}"-7.0.1-declare-inespg.patch
116 +)
117 +
118 +pkg_setup() {
119 + if use lapack; then
120 + local mylapack
121 + mylapack=$(eselect lapack show) || die
122 + if [[ -z "${mylapack/.*reference.*/}" ]] && \
123 + [[ -z "${mylapack/.*atlas.*/}" ]]; then
124 + ewarn "You need to set lapack to atlas or reference. Do:"
125 + ewarn " eselect lapack set <impl>"
126 + ewarn "where <impl> is atlas, threaded-atlas or reference"
127 + die "setup failed"
128 + fi
129 + fi
130 +
131 + if use blas; then
132 + local myblas
133 + myblas=$(eselect blas show) || die
134 + if [[ -z "${myblas/.*reference.*/}" ]] && \
135 + [[ -z "${myblas/.*atlas.*/}" ]]; then
136 + ewarn "You need to set blas to atlas or reference. Do:"
137 + ewarn " eselect blas set <impl>"
138 + ewarn "where <impl> is atlas, threaded-atlas or reference"
139 + die "setup failed"
140 + fi
141 + fi
142 +
143 + python-single-r1_pkg_setup
144 +}
145 +
146 +src_prepare() {
147 + # Fix unversioned python calls
148 + local pyver=${EPYTHON/python/}
149 + sed -e "s:GRASS_PYTHON=.*:&${pyver}:" -i "${S}/lib/init/grass.sh" || die
150 + sed -e "s:= python:&${pyver}:" -i "${S}/include/Make/Platform.make.in" || die
151 +
152 + # fix header being unconditionally included
153 + # see upstream https://trac.osgeo.org/grass/ticket/2779
154 + sed -e 's:\(#include <ogr_api.h>\):#ifdef HAVE_OGR\n\1\n#endif:' \
155 + -i "${S}/vector/v.external/main.c" || die "failed to sed main.c"
156 +
157 + default
158 + eautoconf
159 +
160 + ebegin "Fixing python shebangs"
161 + python_fix_shebang -q "${S}"
162 + eend $?
163 +
164 + # For testsuite, see https://bugs.gentoo.org/show_bug.cgi?id=500580#c3
165 + shopt -s nullglob
166 + mesa_cards=$(echo -n /dev/dri/card* /dev/dri/render* | sed 's/ /:/g')
167 + if test -n "${mesa_cards}"; then
168 + addpredict "${mesa_cards}"
169 + fi
170 + ati_cards=$(echo -n /dev/ati/card* | sed 's/ /:/g')
171 + if test -n "${ati_cards}"; then
172 + addpredict "${ati_cards}"
173 + fi
174 + shopt -u nullglob
175 + addpredict /dev/nvidiactl
176 +
177 +}
178 +
179 +src_configure() {
180 + if use X; then
181 + WX_BUILD=yes
182 + setup-wxwidgets
183 + fi
184 +
185 + addwrite "${EPREFIX}/dev/dri/renderD128"
186 +
187 + econf \
188 + --enable-shared \
189 + --disable-w11 \
190 + $(use_with cxx) \
191 + $(use_with tiff) \
192 + $(use_with png) \
193 + $(use_with postgres) \
194 + $(use_with mysql) \
195 + $(use_with mysql mysql-includes "${EPREFIX}/usr/include/mysql") \
196 + $(use_with mysql mysql-libs "${EPREFIX}/usr/$(get_libdir)/mysql") \
197 + $(use_with sqlite) \
198 + $(use_with opengl) \
199 + $(use_with odbc) \
200 + $(use_with fftw) \
201 + $(use_with blas) \
202 + $(use_with lapack) \
203 + $(use_with X cairo) \
204 + $(use_with truetype freetype) \
205 + $(use_with truetype freetype-includes "${EPREFIX}/usr/include/freetype2") \
206 + $(use_with nls) \
207 + $(use_with readline) \
208 + --without-opendwg \
209 + --with-regex \
210 + $(use_with threads pthread) \
211 + $(use_with openmp) \
212 + $(use_with opencl) \
213 + --with-gdal="${EPREFIX}/usr/bin/gdal-config" \
214 + $(use_with liblas liblas "${EPREFIX}/usr/bin/liblas-config") \
215 + $(use_with X wxwidgets "${WX_CONFIG}") \
216 + $(use_with netcdf netcdf "${EPREFIX}/usr/bin/nc-config") \
217 + $(use_with geos geos "${EPREFIX}/usr/bin/geos-config") \
218 + --with-proj-includes="${EPREFIX}/usr/include/libprojectM" \
219 + --with-proj-libs="${EPREFIX}/usr/$(get_libdir)" \
220 + --with-proj-share="${EPREFIX}/usr/share/proj/" \
221 + $(use_with X x)
222 +}
223 +
224 +src_compile() {
225 + # we don't want to link against embedded mysql lib
226 + emake CC="$(tc-getCC)" MYSQLDLIB=""
227 +}
228 +
229 +src_install() {
230 + emake DESTDIR="${D}" \
231 + INST_DIR="${D}/usr/$(get_libdir)/${MY_PM}" \
232 + prefix="${D}/usr/" BINDIR="${D}/usr/bin" \
233 + PREFIX="${D}/usr/" \
234 + install
235 +
236 + pushd "${D}/usr/$(get_libdir)/${MY_PM}" &> /dev/null || die
237 +
238 + dodoc AUTHORS CHANGES
239 + docinto html
240 + dodoc -r docs/html/*
241 +
242 + # manuals
243 + dodir /usr/share/man/man1
244 + rm -rf man/ || die
245 +
246 + # translations
247 + if use nls; then
248 + dodir /usr/share/locale/
249 + mv locale/* "${D}usr/share/locale/" || die
250 + fi
251 +
252 + popd &> /dev/null || die
253 +
254 + # link libraries in the ~standard~ place
255 + for fLib in $(ls "${D}/usr/$(get_libdir)/${MY_PM}/lib/"); do
256 + dosym "${MY_PM}/lib/${fLib}" "/usr/$(get_libdir)/${fLib}"
257 + done
258 +
259 + # link headers in the ~standard~ place
260 + dodir "/usr/include/"
261 + dosym "../$(get_libdir)/${MY_PM}/include/grass" "/usr/include/grass"
262 +
263 + # fix paths in addons makefile includes
264 + local scriptMakeDir
265 + scriptMakeDir="${D}/usr/$(get_libdir)/${MY_PM}/include/Make/"
266 + for mkFile in $(ls "${scriptMakeDir}"); do
267 + echo sed -i "s|${D}|/|g" "${scriptMakeDir}/${mkFile}" || die
268 + sed -i "s|${D}|/|g" "${scriptMakeDir}/${mkFile}" || die
269 + done
270 +
271 + # get proper folder for grass path in script
272 + local gisbase
273 + gisbase="${ROOT}usr/$(get_libdir)/${MY_PM}"
274 + sed -e "s:gisbase = \".*:gisbase = \"${gisbase}\":" \
275 + -i "${D}usr/bin/${MY_PM}" || die
276 +
277 + # get proper fonts path for fontcap
278 + sed -i \
279 + -e "s|${D}usr/${MY_PM}|${EPREFIX}usr/$(get_libdir)/${MY_PM}|" \
280 + "${D}usr/$(get_libdir)/${MY_PM}/etc/fontcap" || die
281 +
282 + # set proper python interpreter
283 + sed -e "s:= \"python\":= \"${EPYTHON}\":" -i "${D}usr/bin/${MY_PM}" || die
284 +
285 + if use X; then
286 + local GUI="-gui"
287 + [[ ${WX_BUILD} == yes ]] && GUI="-wxpython"
288 + make_desktop_entry "/usr/bin/${MY_PM} ${GUI}" "${PN}" "${PN}-48x48" "Science;Education"
289 + doicon -s 48 gui/icons/${PN}-48x48.png
290 + fi
291 +
292 + # install .pc file so other apps know where to look for grass
293 + insinto /usr/$(get_libdir)/pkgconfig/
294 + doins grass.pc
295 +
296 + # fix weird +x on tcl scripts
297 + find "${D}" -name "*.tcl" -exec chmod +r-x '{}' \;
298 +}
299 +
300 +pkg_postinst() {
301 + if use X; then
302 + xdg_desktop_database_update
303 + gnome2_icon_cache_update
304 + fi
305 +
306 + ewarn "GRASS addons may fail due to Python 3 incompatibility."
307 + ewarn "If that is tha case you can change the shebang a the beginning of"
308 + ewarn "the script to enforce Python 2 usage."
309 + ewarn "#!/usr/bin/env python"
310 + ewarn "Should be changed into"
311 + ewarn "#!/usr/bin/env python2"
312 +}
313 +
314 +pkg_postrm() {
315 + if use X; then
316 + xdg_desktop_database_update
317 + gnome2_icon_cache_update
318 + fi
319 +}