source: trunk/dports/gis/grass/Portfile

Last change on this file was 134504, checked in by mojca@…, 2 years ago

grass: whitespace only

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 17.4 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=2:ts=2:sts=2
2# $Id: Portfile 134504 2015-03-27 19:54:27Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           wxWidgets 1.0
6PortGroup           active_variants 1.1
7
8name                grass
9version             6.4.3
10revision            5
11epoch               1
12maintainers         nomaintainer
13categories          gis
14license             GPL-2+
15platforms           darwin
16
17description         GRASS
18long_description    GRASS is a Geographic Information System (GIS) used for \
19                    geospatial data management and analysis.
20
21homepage            http://grass.osgeo.org/
22master_sites        ${homepage}grass[join [lrange [split ${version} .] 0 1] {}]/source/
23
24checksums           rmd160  bdbd671972730701aa8213c2041abe31a68eea4c \
25                    sha256  5d29d322a262330894aa046845e6790258cd6e3f95b28c350ed7839810672ed6
26
27depends_build       port:pkgconfig
28depends_lib         port:fftw-3 \
29                    port:freetype \
30                    port:gdal \
31                    port:geos \
32                    port:jpeg \
33                    port:libpng \
34                    port:mesa \
35                    lib:libXm:openmotif \
36                    port:proj47 \
37                    port:tk \
38                    path:lib/pkgconfig/cairo.pc:cairo \
39                    port:readline
40
41# https://trac.macports.org/ticket/32790
42# this should probably only apply to some Xcode versions
43# compiler.blacklist  *clang*
44
45patchfiles          patch-configure.diff \
46                    patch-gui-wxpython-core-globalvar.py.diff \
47                    patch-gui-wxpython-gui_core-ghelp.py.diff \
48                    patch-is_void.diff \
49                    patch-lib-init-grass.src.diff \
50                    patch-macosx_Makefile.diff \
51                    patch-Makefile.diff \
52                    patch-ffmpeg.diff
53
54post-patch {
55    reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" ${worksrcpath}/configure
56    # http://trac.osgeo.org/grass/ticket/2169
57    reinplace "s|CC=gcc|CC=${configure.cc}|" ${worksrcpath}/gem/Makefile
58}
59
60# List of all python scripts. Used later to ensure usage of python26/python27
61# (insteaf of the currently active python)
62# Work around bug http://trac.osgeo.org/grass/ticket/1758
63set python_scripts [ list \
64    doc/python/m.distance.py \
65    doc/python/raster_example_ctypes.py \
66    doc/python/vector_example_ctypes.py \
67    general/g.parser/test.py \
68    gui/scripts/d.rast3d.py \
69    gui/scripts/g.change.gui.py \
70    gui/scripts/g.extension.py \
71    gui/scripts/g.extension.rebuild.all.py \
72    gui/scripts/v.type_wrapper.py \
73    gui/wxpython/compat/__init__.py \
74    gui/wxpython/compat/subprocess.py \
75    gui/wxpython/core/debug.py \
76    gui/wxpython/core/gcmd.py \
77    gui/wxpython/core/globalvar.py \
78    gui/wxpython/core/menudata.py \
79    gui/wxpython/core/render.py \
80    gui/wxpython/core/settings.py \
81    gui/wxpython/core/units.py \
82    gui/wxpython/core/utils.py \
83    gui/wxpython/core/workspace.py \
84    gui/wxpython/create__init__.py \
85    gui/wxpython/dbmgr/dialogs.py \
86    gui/wxpython/dbmgr/manager.py \
87    gui/wxpython/dbmgr/sqlbuilder.py \
88    gui/wxpython/dbmgr/vinfo.py \
89    gui/wxpython/gcp/manager.py \
90    gui/wxpython/gcp/mapdisplay.py \
91    gui/wxpython/gcp/toolbars.py \
92    gui/wxpython/gis_set.py \
93    gui/wxpython/gmodeler/dialogs.py \
94    gui/wxpython/gmodeler/frame.py \
95    gui/wxpython/gmodeler/menudata.py \
96    gui/wxpython/gmodeler/model.py \
97    gui/wxpython/gmodeler/preferences.py \
98    gui/wxpython/gmodeler/toolbars.py \
99    gui/wxpython/gui_core/dialogs.py \
100    gui/wxpython/gui_core/forms.py \
101    gui/wxpython/gui_core/ghelp.py \
102    gui/wxpython/gui_core/goutput.py \
103    gui/wxpython/gui_core/gselect.py \
104    gui/wxpython/gui_core/mapdisp.py \
105    gui/wxpython/gui_core/mapwindow.py \
106    gui/wxpython/gui_core/menu.py \
107    gui/wxpython/gui_core/preferences.py \
108    gui/wxpython/gui_core/prompt.py \
109    gui/wxpython/gui_core/toolbars.py \
110    gui/wxpython/gui_core/widgets.py \
111    gui/wxpython/icons/__init__.py \
112    gui/wxpython/icons/grass2_icons.py \
113    gui/wxpython/icons/grass_icons.py \
114    gui/wxpython/icons/icon.py \
115    gui/wxpython/icons/silk_icons.py \
116    gui/wxpython/lmgr/frame.py \
117    gui/wxpython/lmgr/layertree.py \
118    gui/wxpython/lmgr/menudata.py \
119    gui/wxpython/lmgr/pyshell.py \
120    gui/wxpython/lmgr/toolbars.py \
121    gui/wxpython/location_wizard/base.py \
122    gui/wxpython/location_wizard/dialogs.py \
123    gui/wxpython/location_wizard/wizard.py \
124    gui/wxpython/mapdisp/frame.py \
125    gui/wxpython/mapdisp/gprint.py \
126    gui/wxpython/mapdisp/main.py \
127    gui/wxpython/mapdisp/mapwindow.py \
128    gui/wxpython/mapdisp/overlays.py \
129    gui/wxpython/mapdisp/statusbar.py \
130    gui/wxpython/mapdisp/toolbars.py \
131    gui/wxpython/modules/colorrules.py \
132    gui/wxpython/modules/extensions.py \
133    gui/wxpython/modules/histogram.py \
134    gui/wxpython/modules/mcalc_builder.py \
135    gui/wxpython/modules/ogc_services.py \
136    gui/wxpython/modules/vclean.py \
137    gui/wxpython/nviz/animation.py \
138    gui/wxpython/nviz/main.py \
139    gui/wxpython/nviz/mapwindow.py \
140    gui/wxpython/nviz/preferences.py \
141    gui/wxpython/nviz/tools.py \
142    gui/wxpython/nviz/workspace.py \
143    gui/wxpython/nviz/wxnviz.py \
144    gui/wxpython/psmap/dialogs.py \
145    gui/wxpython/psmap/frame.py \
146    gui/wxpython/psmap/instructions.py \
147    gui/wxpython/psmap/menudata.py \
148    gui/wxpython/psmap/toolbars.py \
149    gui/wxpython/psmap/utils.py \
150    gui/wxpython/scripts/p.cmd.py \
151    gui/wxpython/scripts/p.db.py \
152    gui/wxpython/scripts/p.mon.py \
153    gui/wxpython/scripts/p.rast.py \
154    gui/wxpython/scripts/p.vect.py \
155    gui/wxpython/scripts/vkrige.py \
156    gui/wxpython/tools/update_menudata.py \
157    gui/wxpython/vdigit/dialogs.py \
158    gui/wxpython/vdigit/main.py \
159    gui/wxpython/vdigit/mapwindow.py \
160    gui/wxpython/vdigit/preferences.py \
161    gui/wxpython/vdigit/toolbars.py \
162    gui/wxpython/vdigit/wxdigit.py \
163    gui/wxpython/vdigit/wxdisplay.py \
164    gui/wxpython/wxgui.py \
165    gui/wxpython/wxplot/base.py \
166    gui/wxpython/wxplot/dialogs.py \
167    gui/wxpython/wxplot/profile.py \
168    imagery/i.atcorr/create_iwave.py \
169    lib/python/__init__.py \
170    lib/python/array.py \
171    lib/python/core.py \
172    lib/python/ctypes/__init__.py \
173    lib/python/ctypes/ctypesgen.py \
174    lib/python/ctypes/ctypesgencore/__init__.py \
175    lib/python/ctypes/ctypesgencore/ctypedescs.py \
176    lib/python/ctypes/ctypesgencore/descriptions.py \
177    lib/python/ctypes/ctypesgencore/expressions.py \
178    lib/python/ctypes/ctypesgencore/libraryloader.py \
179    lib/python/ctypes/ctypesgencore/messages.py \
180    lib/python/ctypes/ctypesgencore/options.py \
181    lib/python/ctypes/ctypesgencore/parser/__init__.py \
182    lib/python/ctypes/ctypesgencore/parser/cdeclarations.py \
183    lib/python/ctypes/ctypesgencore/parser/cgrammar.py \
184    lib/python/ctypes/ctypesgencore/parser/cparser.py \
185    lib/python/ctypes/ctypesgencore/parser/ctypesparser.py \
186    lib/python/ctypes/ctypesgencore/parser/datacollectingparser.py \
187    lib/python/ctypes/ctypesgencore/parser/lex.py \
188    lib/python/ctypes/ctypesgencore/parser/lextab.py \
189    lib/python/ctypes/ctypesgencore/parser/parsetab.py \
190    lib/python/ctypes/ctypesgencore/parser/pplexer.py \
191    lib/python/ctypes/ctypesgencore/parser/preprocessor.py \
192    lib/python/ctypes/ctypesgencore/parser/yacc.py \
193    lib/python/ctypes/ctypesgencore/printer/__init__.py \
194    lib/python/ctypes/ctypesgencore/printer/defaultheader.py \
195    lib/python/ctypes/ctypesgencore/printer/preamble.py \
196    lib/python/ctypes/ctypesgencore/printer/printer.py \
197    lib/python/ctypes/ctypesgencore/printer/test.py \
198    lib/python/ctypes/ctypesgencore/processor/__init__.py \
199    lib/python/ctypes/ctypesgencore/processor/dependencies.py \
200    lib/python/ctypes/ctypesgencore/processor/operations.py \
201    lib/python/ctypes/ctypesgencore/processor/pipeline.py \
202    lib/python/ctypes/loader.py \
203    lib/python/ctypes/preamble.py \
204    lib/python/db.py \
205    lib/python/grass__init__.py \
206    lib/python/raster.py \
207    lib/python/task.py \
208    lib/python/vector.py ]
209
210configure.ldflags-append -framework OpenGL -framework Accelerate
211configure.args \
212    --with-fftw-includes=${prefix}/include \
213    --with-fftw-libs=${prefix}/lib \
214    --with-freetype \
215    --with-freetype-includes=${prefix}/include/freetype2 \
216    --with-freetype-libs=${prefix}/lib \
217    --with-gdal=${prefix}/bin/gdal-config \
218    --with-jpeg-includes=${prefix}/include \
219    --with-jpeg-libs=${prefix}/lib \
220    --with-motif \
221    --with-motif-includes=${prefix}/include \
222    --with-motif-libs=${prefix}/lib \
223    --with-png-includes=${prefix}/include \
224    --with-png-libs=${prefix}/lib \
225    --with-proj-includes=${prefix}/lib/proj47/include \
226    --with-proj-libs=${prefix}/lib/proj47/lib \
227    --with-proj-share=${prefix}/lib/proj47/share/proj \
228    --with-tcltk-includes=${prefix}/include \
229    --with-tcltk-libs=${prefix}/lib \
230    --with-cxx \
231    --with-x \
232    --without-postgres \
233    --enable-largefile \
234    --with-cairo \
235    --with-cairo-includes=${prefix}/include/cairo \
236    --with-cairo-libs=${prefix}/lib \
237    --with-blas \
238    --with-lapack \
239    --with-readline \
240    --with-readline-includes=${prefix}/include/readline \
241    --with-readline-libs=${prefix}/lib \
242    --with-regex-includes=/usr/include \
243    --with-regex-lib=/usr/lib
244
245build.target        default
246
247variant mysql5 description {Add MySQL 5 support} {
248    depends_lib-append      path:bin/mysql_config5:mysql5
249    configure.args-append   --with-mysql
250    configure.args-append   --with-mysql-includes=${prefix}/include/mysql5/mysql
251    configure.args-append   --with-mysql-libs=${prefix}/lib/mysql5/mysql
252    configure.env-append    MYSQLD_CONFIG=${prefix}/lib/mysql5/bin/mysql_config
253}
254
255variant postgresql83 conflicts postgresql84 postgresql90 postgresql91 postgresql92 postgresql93 description {Add PostgreSQL 8.3 support} {
256    depends_lib-append      port:postgresql83
257    configure.args-delete   --without-postgres
258    configure.args-append   --with-postgres
259    configure.args-append   --with-postgres-includes=${prefix}/include/postgresql83
260    configure.args-append   --with-postgres-libs=${prefix}/lib/postgresql83
261}
262
263variant postgresql84 conflicts postgresql83 postgresql90 postgresql91 postgresql92 postgresql93 description {Add PostgreSQL 8.4 support} {
264    depends_lib-append      port:postgresql84
265    configure.args-delete   --without-postgres
266    configure.args-append   --with-postgres
267    configure.args-append   --with-postgres-includes=${prefix}/include/postgresql84
268    configure.args-append   --with-postgres-libs=${prefix}/lib/postgresql84
269}
270
271variant postgresql90 conflicts postgresql83 postgresql84 postgresql91 postgresql92 postgresql93 description {Add PostgreSQL 9.0 support} {
272    depends_lib-append      port:postgresql90
273    configure.args-delete   --without-postgres
274    configure.args-append   --with-postgres
275    configure.args-append   --with-postgres-includes=${prefix}/include/postgresql90
276    configure.args-append   --with-postgres-libs=${prefix}/lib/postgresql90
277}
278
279variant postgresql91 conflicts postgresql83 postgresql84 postgresql90 postgresql92 postgresql93 description {Add PostgreSQL 9.1 support} {
280    depends_lib-append      port:postgresql91
281    configure.args-delete   --without-postgres
282    configure.args-append   --with-postgres
283    configure.args-append   --with-postgres-includes=${prefix}/include/postgresql91
284    configure.args-append   --with-postgres-libs=${prefix}/lib/postgresql91
285}
286
287variant postgresql92 conflicts postgresql83 postgresql84 postgresql90 postgresql91 postgresql93 description {Add PostgreSQL 9.2 support} {
288    depends_lib-append      port:postgresql92
289    configure.args-delete   --without-postgres
290    configure.args-append   --with-postgres
291    configure.args-append   --with-postgres-includes=${prefix}/include/postgresql92
292    configure.args-append   --with-postgres-libs=${prefix}/lib/postgresql92
293}
294
295variant postgresql93 conflicts postgresql83 postgresql84 postgresql90 postgresql91 postgresql92 description {Add PostgreSQL 9.3 support} {
296    depends_lib-append      port:postgresql93
297    configure.args-delete   --without-postgres
298    configure.args-append   --with-postgres
299    configure.args-append   --with-postgres-includes=${prefix}/include/postgresql93
300    configure.args-append   --with-postgres-libs=${prefix}/lib/postgresql93
301}
302
303variant sqlite3 description {Add SQLite 3 support} {
304    depends_lib-append      port:sqlite3
305    configure.args-append   --with-sqlite
306    configure.args-append   --with-sqlite-includes=${prefix}/include
307    configure.args-append   --with-sqlite-libs=${prefix}/lib
308}
309
310variant ffmpeg description {Add ffmpeg support} {
311    depends_lib-append      path:lib/libavcodec.dylib:ffmpeg
312    configure.args-append   --with-ffmpeg \
313                            --with-ffmpeg-includes=\"${prefix}/include/libavcodec  \
314                                                     ${prefix}/include/libavformat \
315                                                     ${prefix}/include/libswscale\" \
316                            --with-ffmpeglibs=${prefix}/lib
317}
318
319# python26 variant is only present to allow 'grass +wxgtk28' to coexist with py27-wxpython-3.0
320# once support for wxWidgets 3.0 is complete, support for Python 2.6 may be removed
321variant python26 conflicts python27 description {} {
322    depends_lib-append      port:python26
323    set python_bin          ${frameworks_dir}/Python.framework/Versions/2.6/bin/python2.6
324    #                       Enable support for wxGUI Python extensions
325    #                       (by removing this we wouldn't need to depend on py-wxpython-x.y)
326    configure.args-append   --with-python=${frameworks_dir}/Python.framework/Versions/2.6/bin/python2.6-config
327    build.args-append       PYTHON=${python_bin}
328    # TODO: this port doesn't work with the python portgroup because the group changes too much
329    # but it would make sense to fix this in such a way that python_bin could be determined automatically
330
331    post-patch {
332        # for some reason it fails if python_bin is not defined inside post-patch (figure out why)
333        set python_bin ${frameworks_dir}/Python.framework/Versions/2.6/bin/python2.6
334        reinplace "s|@@PYTHON@@|${python_bin}|" ${worksrcpath}/lib/init/grass.src
335        foreach f $python_scripts {
336            reinplace "s|/usr/bin/env python|${python_bin}|" $f
337        }
338    }
339}
340
341variant python27 conflicts python26 description {} {
342    depends_lib-append      port:python27
343    set python_bin          ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
344    configure.args-append   --with-python=${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7-config
345    build.args-append       PYTHON=${python_bin}
346
347    post-patch {
348        set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
349        reinplace "s|@@PYTHON@@|${python_bin}|" ${worksrcpath}/lib/init/grass.src
350        foreach f $python_scripts {
351            reinplace "s|/usr/bin/env python|${python_bin}|" $f
352        }
353    }
354}
355
356# TODO: in principle wxWidgets is optional and could be disable with
357#       --disable-wxwidgets if there is demand for that
358#       grass 4.6.3 is not compatible with wxWidgets 3.0 yet
359variant wxwidgets30 conflicts wxwidgets28 wxgtk28 description {Use Cocoa-based wxWidgets 3.0 (experimental)} {
360    wxWidgets.use           wxPython-3.0
361    depends_lib-append      port:${wxWidgets.port}
362    configure.args-append   --with-wxwidgets=${wxWidgets.wxconfig}
363}
364variant wxwidgets28 conflicts wxwidgets30 wxgtk28 description {Use Carbon-based wxWidgets 2.8} {
365    # untested (might not work)
366    wxWidgets.use           wxWidgets-2.8
367    depends_lib-append      port:${wxWidgets.port}
368    configure.args-append   --with-wxwidgets=${wxWidgets.wxconfig}
369}
370variant wxgtk28 conflicts wxwidgets30 wxwidgets28 description {Use GTK-based wxWidgets 2.8} {
371    wxWidgets.use           wxGTK-2.8
372    depends_lib-append      port:${wxWidgets.port}
373    configure.args-append   --with-wxwidgets=${wxWidgets.wxconfig}
374}
375
376if {![variant_isset wxwidgets30] && ![variant_isset wxwidgets28] && ![variant_isset wxgtk28]} {
377    default_variants-append +wxgtk28
378}
379if {![variant_isset python26] && ![variant_isset python27]} {
380    if {[variant_isset wxgtk28] || [variant_isset wxwidgets28]} {
381        default_variants-append +python26
382    } else {
383        default_variants-append +python27
384    }
385}
386
387# TODO: if py27-wxpython-3.0 is installed, grass +wxgtk28 cannot be installed with +python27
388#       we could remove this limitation by disabling wxpython support altogether
389#       (in case there is demand for it)
390# TODO: the code below is ugly; any suggestions for improving it are welcome
391if {[variant_isset wxwidgets30]} {
392    if {[variant_isset python26]} {
393        depends_lib-append port:py26-wxpython-3.0
394    } elseif {[variant_isset python27]} {
395        depends_lib-append port:py27-wxpython-3.0
396    }
397} else {
398    if {[variant_isset python26]} {
399        depends_lib-append port:py26-wxpython-2.8
400        if {[variant_isset wxwidgets28]} {
401            require_active_variants py26-wxpython-2.8 carbon gtk
402        } else {
403            require_active_variants py26-wxpython-2.8 gtk carbon
404        }
405    } elseif {[variant_isset python27]} {
406        depends_lib-append port:py27-wxpython-2.8
407        if {[variant_isset wxwidgets28]} {
408            require_active_variants py27-wxpython-2.8 carbon gtk
409        } else {
410            require_active_variants py27-wxpython-2.8 gtk carbon
411        }
412    }
413}
414
415livecheck.type      regex
416livecheck.url       http://grass.osgeo.org/download/software/sources/
417livecheck.regex     grass-(\[0-9.\]+)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.