Gentoo Archives: gentoo-commits

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