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