diff options
Diffstat (limited to 'pcr/grass')
-rw-r--r-- | pcr/grass/PKGBUILD | 247 | ||||
-rw-r--r-- | pcr/grass/grass-python2.patch | 12 | ||||
-rw-r--r-- | pcr/grass/grass-tk86-fix.patch | 11 | ||||
-rw-r--r-- | pcr/grass/grass.conf | 1 | ||||
-rw-r--r-- | pcr/grass/grass.install | 26 | ||||
-rw-r--r-- | pcr/grass/grass.sh | 4 | ||||
-rw-r--r-- | pcr/grass/wxpython2.8-fix.patch | 11 |
7 files changed, 134 insertions, 178 deletions
diff --git a/pcr/grass/PKGBUILD b/pcr/grass/PKGBUILD index 125afee5d..9aeef85cd 100644 --- a/pcr/grass/PKGBUILD +++ b/pcr/grass/PKGBUILD @@ -1,130 +1,151 @@ -# Contributor (Arch) : Thomas Dziedzic < gostrc at gmail > -# Contributor (Arch) : dibblethewrecker dibblethewrecker.at.jiwe.dot.org -# Contributor (Arch) : Emiliano Vavassori <syntaxerrormmm(at)gmail.com> -# Maintainer (Parabola) : - -pkgname=grass -pkgver=6.4.3 -pkgrel=3 -pkgdesc='Geographic Information System (GIS) used for geospatial data management and analysis, image processing, graphics/maps production, spatial modeling, and visualization.' -arch=('i686' 'x86_64' 'mips64el') +# Contributor (Arch) : Maciej Sieczka <msieczka at sieczka dot org> +# Contributor (Arch) : Maciej Sieczka <msieczka at sieczka dot org> +# Maintainer (Parabola) : Omar Vega Ramos <ovruni@gnu.org.pe> + +pkgname='grass' +pkgver='7.0' +pkgrel='1' +pkgdesc="GRASS GIS (7.0 release): geospatial data management and analysis, image \ +processing, graphics/maps production, spatial modeling and visualization." +arch=('i686' 'x86_64') url='http://grass.osgeo.org/' license=('GPL') -depends=('cfitsio' 'fftw' 'gdal' 'glu' 'libjpeg' 'libpng' 'libtiff' 'libxmu' 'ncurses' 'mesa' 'python2' 'postgresql' 'proj' 'tcl' 'tk' 'wxpython2.8' 'xorg-server' 'zlib') -makedepends=('freetype2') -optdepends=('sqlite3: sqlite3 database interface' - 'mysql: mysql database interface' - 'r: R language interface' - 'blas: required for GMATH library' +provides=("$pkgname") + +# More about GRASS build and runtime deps on http://grasswiki.osgeo.org/wiki/Compile_and_Install. +depends=('zlib' 'freetype2' 'cfitsio' 'fftw' 'gdal' 'geos' 'glu' 'libjpeg' + 'liblas' 'libpng' 'libtiff' 'libxmu' 'mesa' 'postgresql' 'proj' + 'wxpython2.8' 'wxgtk2.8' 'xorg-server' 'cairo' 'unixodbc' 'python2' + 'python2-numpy' 'python2-matplotlib' 'python2-pillow') +makedepends=('subversion' 'doxygen') +optdepends=('r: R language interface; see http://grasswiki.osgeo.org/wiki/R_statistics' + 'mariadb: mysql database interface' + 'ffmpeg: ffmpeg support' 'lapack: required for GMATH library' - 'cairo: cairo support' - 'ffmpeg: ffmpeg support' - 'lesstif: motif support') -options=('!libtool' '!makeflags') -install='grass.install' -source=("http://grass.osgeo.org/grass64/source/${pkgname}-${pkgver}.tar.gz" - "grass.sh" - "grass.conf" - "grass-python2.patch" - "wxpython2.8-fix.patch") + 'blas: required for GMATH library' + 'lesstif: motif support') +source=("http://grass.osgeo.org/grass70/source/grass-7.0.0.tar.gz") +md5sums=('25b00b74ddb15284ffe2eacbb8999c7d') + +prepare() { + mv "${srcdir}/grass-7.0.0" "${srcdir}/${pkgname}" + cd "$pkgname" + + msg 'Patching source...' + # Tweak the initial PATH so that it advertised a python2->python link as + # python. No patching to deal with the python/python2/3 issue needed: + ln -sf "`which python2`" "${srcdir}/${pkgname}/python" + + # INSTDIR is partly hardcoded in `configure'. Fix it, so that INST_DIR, which + # is derived from it, is set as needed: + sed -i "s,INSTDIR='\${prefix}'\"/grass-\${GRASS_VERSION_MAJOR}\.\${GRASS_VERSION_MINOR}\.\${GRASS_VERSION_RELEASE}\",INSTDIR='\${prefix}/${pkgname}'," configure + # This e.g. prevents ./configure from not telling true about the "Installation directory:". + + # Custom desktop file: + sed -i -e "s,^Name=GRASS GIS 7\$,Name=GRASS GIS 7.0 release," \ + -e "s,^Icon=grass\$,Icon=/usr/share/icons/${pkgname}-64x64.png," \ + -e "s,^Exec=grass7\$,Exec=${pkgname}," \ + "${srcdir}/${pkgname}/gui/icons/grass.desktop" +} build() { - cd "${srcdir}/${pkgname}-${pkgver}" - - # Fixing by hand shebang for .py files. - find . -iname \*.py | xargs sed -ie 's:^#!/usr/bin/env python$:#!/usr/bin/env python2:' - find . -iname \*.py | xargs sed -ie 's:^#!/usr/bin/python$:#!/usr/bin/env python2:' - - # Fixing Makefile compilation - patch -p0 -i "${srcdir}/grass-python2.patch" - - # Fixing linking to wxpython 2.8 - Thanks to czk <msieczka(at)sieczka.org> - patch -p0 -i "${srcdir}/wxpython2.8-fix.patch" - - # The following exports are probably not needed - export PYTHON=python2 - export DOXNAME=python2 - export GRASS_python=python2 - - # Trying to fix a problem with GRASS configure - # Thanks to Scimmia from ArchLinux Forum - # https://bbs.archlinux.org/viewtopic.php?id=161172 - unset CPPFLAGS - - # Enabling 64bit support - EGV - if [ "$CARCH" = "x86_64" ]; then - ENABLE64BIT="--enable-64bit" - else - ENABLE64BIT="--disable-64bit" - fi - - # see ${srcdir}/grass-6.4.0/REQUIREMENTS.html for options - # GLw is hard disabled, since no package in Archlinux can provide it - EGV - # Fixing dependency on wxpython2.8 in configure. - EGV - ./configure ${ENABLE64BIT} \ + cd "$pkgname" + msg 'Configuring build...' + PATH="${srcdir}/${pkgname}:$PATH" + export PATH + # Enabling only those features which are not enabled by default. Out of the + # usefull ones, only DWG, MySQL, FFMPEG and Motif are left disabled. LAPACK + # and BLAS are not used for anything in GRASS anyway: + + # GRASS build dystem can't cope with current Arch's /etc/makepkg.conf default CPPFLAGS="-D_FORTIFY_SOURCE=2". + # At configure it throws: + # + # checking for curses.h... no + # configure: error: *** Unable to locate curses includes. + # + # Due to (in config.log): + # + # In file included from /usr/include/assert.h:36:0, + # from configure:1527: + # /usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp] + # # warning _FORTIFY_SOURCE requires compiling with optimization (-O) + # ^ + + # I don't have any better idea than removing any -D_FORTIFY_SOURCE occurences from CPPFLAGS: + CPPFLAGS=`echo $CPPFLAGS | sed 's/-D_FORTIFY_SOURCE=.//g'` CFLAGS="$CFLAGS -Wall" CXXFLAGS="$CXXFLAGS -Wall" ./configure \ --prefix=/opt \ - --enable-W11 \ - --without-glw \ - --with-jpeg \ - --with-tiff \ - --with-png \ - --with-tcltk \ - --with-opengl \ - --with-fftw \ - --with-postgres \ + --exec-prefix="/opt/$pkgname" \ + --with-cxx \ + --with-cairo \ --with-freetype \ --with-freetype-includes=/usr/include/freetype2 \ - --with-nls \ - --with-gdal \ --with-geos \ + --with-liblas \ + --with-nls \ + --with-netcdf \ + --with-odbc \ + --with-openmp \ + --with-postgres \ + --with-python=/usr/bin/python2-config \ + --with-readline \ --with-proj-includes=/usr/include \ --with-proj-libs=/usr/lib \ --with-proj-share=/usr/share/proj \ - --with-python=/usr/bin/python2-config \ - --with-wxwidgets=/usr/lib/wx/config/gtk2-unicode-release-2.8 - - # sqlite3 support - # --with-sqlite \ - - # mysql support - # --with-mysql \ - # --with-mysql-includes=/usr/include/mariadb \ - - # blas support - # --with-blas \ - - # lapack support - # --with-lapack \ - + --with-pthread \ + --with-sqlite \ + --with-wxwidgets=/usr/bin/wx-config-2.8 + + # According to GRASS dev team, --enable-64bit has effect only on AIX, HP-UX, + # IRIX and Solaris. It's *always* enabled on GNU/Linux if the build platform + # supports it, no matter what "64bit support:" on the configure output reads, + # so there's no need to set it explicitely on Arch. + + # To provide a usefull stacktrace: + # + # CFLAGS="-O0 -ggdb -Wall -Werror-implicit-function-declaration -fexceptions" + # CXXFLAGS="-O0 -ggdb -Wall -Werror-implicit-function-declaration -fexceptions" + # options=(!strip) + # Not sure if -Werror-implicit-function-declaration -fexceptions should really go to CXXFLAGS. + # Let me know if you know. + + msg 'Building...' make + # That used to be `make PYTHON=python2' } package() { - cd "${srcdir}/${pkgname}-${pkgver}" - - make \ - INST_DIR=${pkgdir}/opt/grass-${pkgver} \ - BINDIR=${pkgdir}/usr/bin \ - install - - # fix $GISBASE path - sed -i "s|GISBASE=${pkgdir}/opt/grass-${pkgver}|GISBASE=/opt/grass-${pkgver}|g" \ - ${pkgdir}/usr/bin/grass64 - - # install profile.d file - install -D ${srcdir}/grass.sh \ - ${pkgdir}/etc/profile.d/grass.sh - - # install some freedesktop.org compatibility - install -D -m644 gui/icons/grass.desktop \ - ${pkgdir}/usr/share/applications/grass.desktop - - sed -i -e 's/grass65/grass64/' -e 's_/usr/share/icons_/usr/share/pixmaps_' \ - ${pkgdir}/usr/share/applications/grass.desktop - - install -D -m644 gui/icons/grass-48x48.png \ - ${pkgdir}/usr/share/pixmaps/grass-48x48.png - - install -D -m644 ${srcdir}/grass.conf \ - ${pkgdir}/etc/ld.so.conf.d/grass.conf + cd "$pkgname" + # Install GRASS in $pkgir of makepkg's fakeroot env: + make prefix="${pkgdir}/opt" exec_prefix="${pkgdir}/opt/${pkgname}" INST_DIR="${pkgdir}/opt/${pkgname}" install + + msg 'Patching the build results...' + # During `make install' several files get a content based on `INST_DIR' and + # `UNIX_BIN' make vars. I don't know how to avoid this without changing + # GRASS build system. Doing some post-install tweaks then: + sed -i "s,${pkgdir},,g" "${pkgdir}/opt/${pkgname}/include/Make/Platform.make" \ + "${pkgdir}/opt/${pkgname}/include/Make/Grass.make" \ + "${pkgdir}/opt/${pkgname}/etc/fontcap" \ + "${pkgdir}/opt/${pkgname}/bin/grass70" \ + "${pkgdir}/opt/${pkgname}/demolocation/.grassrc70" + + # Link GRASS exec script in /usr/bin under a custom name. + # This allows e.g. grass70 and grass70-svn be co-installed: + mkdir -p "${pkgdir}/usr/bin" + ln -sf "/opt/${pkgname}/bin/grass70" "${pkgdir}/usr/bin/grass" + + # Instead of patching GRASS Python scripts to use `python2' and messing with + # GRASS_PYTHON, link to a correct interpreter from $GISBASE: + ln -sf "`which python2`" "${pkgdir}/opt/${pkgname}/bin/python" + + # The startup Python 2 script needs a patch nevertheless: + sed -i '1 s/python/python2/' "${pkgdir}/opt/${pkgname}/bin/grass70" + + # Install an ldconfig conf for GRASS libs in /opt to be visible on the + # system. Arch runs `ldconfig' after install automatically: + echo "/opt/${pkgname}/lib" > "${srcdir}/${pkgname}.conf" + install -D -m644 "${srcdir}/${pkgname}.conf" "${pkgdir}/etc/ld.so.conf.d/${pkgname}.conf" + + # Desktop integration: + install -D -m644 "${srcdir}/${pkgname}/gui/icons/grass-64x64.png" "${pkgdir}/usr/share/icons/${pkgname}-64x64.png" + install -D -m644 "${srcdir}/${pkgname}/gui/icons/grass.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop" } diff --git a/pcr/grass/grass-python2.patch b/pcr/grass/grass-python2.patch deleted file mode 100644 index 7ab74a7c7..000000000 --- a/pcr/grass/grass-python2.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur include/Make/Platform.make.in include/Make/Platform.make.in-new ---- include/Make/Platform.make.in 2010-11-08 08:23:48.000000000 +0100 -+++ include/Make/Platform.make.in-new 2012-08-16 09:33:35.484354613 +0200 -@@ -217,7 +217,7 @@ - USE_CAIRO = @USE_CAIRO@ - - #Python --PYTHON = python -+PYTHON = python2 - PYTHONINC = @PYTHONINC@ - PYTHONCFLAGS = @PYTHONCFLAGS@ - PYTHONLDFLAGS = @PYTHONLDFLAGS@ diff --git a/pcr/grass/grass-tk86-fix.patch b/pcr/grass/grass-tk86-fix.patch deleted file mode 100644 index f0dbb7c2b..000000000 --- a/pcr/grass/grass-tk86-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- grass-6.4.2/visualization/nviz/src/draw.c 2008-12-19 21:29:59.000000000 +0100 -+++ grass-6.4.2/visualization/nviz/src/draw_new.c 2013-01-21 22:22:09.819456565 +0100 -@@ -32,7 +32,7 @@ - void CancelFunc_Hook(void) - { - if (cancel_script != NULL) { -- TkCopyAndGlobalEval(cancel_interp, cancel_script); -+ Tcl_EvalEx(cancel_interp, cancel_script, -1, TCL_EVAL_GLOBAL); - } - } - diff --git a/pcr/grass/grass.conf b/pcr/grass/grass.conf deleted file mode 100644 index bb4964d93..000000000 --- a/pcr/grass/grass.conf +++ /dev/null @@ -1 +0,0 @@ -/opt/grass/lib diff --git a/pcr/grass/grass.install b/pcr/grass/grass.install deleted file mode 100644 index 878ea0186..000000000 --- a/pcr/grass/grass.install +++ /dev/null @@ -1,26 +0,0 @@ -## arg 1: the new package version -post_install() { - pkgver=${1%-*} - - # Create symlink for version workaround. - ln -sf /opt/grass-${pkgver} /opt/grass - - echo 'Please relogin for required variables to be set from /etc/profile.d/grass.sh' -} - -## arg 1: the new package version -## arg 2: the old package version -post_upgrade() { - pkgver=${1%-*} - - # Updating symlink for new version - ln -sf /opt/grass-${pkgver} /opt/grass -} - -## arg 1: the old package version -pre_remove() { - # Removing cruft symlink - rm -f /opt/grass -} - -# vim:set ts=2 sw=2 et: diff --git a/pcr/grass/grass.sh b/pcr/grass/grass.sh deleted file mode 100644 index e36980c16..000000000 --- a/pcr/grass/grass.sh +++ /dev/null @@ -1,4 +0,0 @@ -export GISBASE=/opt/grass -export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts -export MANPATH=$MANPATH:$GISBASE/man -export GRASS_PYTHON=python2 diff --git a/pcr/grass/wxpython2.8-fix.patch b/pcr/grass/wxpython2.8-fix.patch deleted file mode 100644 index a4620bfb5..000000000 --- a/pcr/grass/wxpython2.8-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ -# Thanks to czk <msieczka(at)sieczka.org> for providing the patch inside aur/grass64 PKGBUILD ---- ./gui/wxpython/core/globalvar.py 2013-07-10 00:09:27.000000000 +0200 -+++ ./gui/wxpython/core/globalvar.py.wxversion_hack 2014-01-25 15:45:02.781992175 +0100 -@@ -51,6 +51,7 @@ - except ImportError, e: - raise ImportError(e) - # wxversion.select(str(minVersion[0]) + '.' + str(minVersion[1])) -+ wxversion.select('2.8') - wxversion.ensureMinimal(str(minVersion[0]) + '.' + str(minVersion[1])) - import wx - version = wx.version().split(' ')[0] |