summaryrefslogtreecommitdiff
path: root/pcr/grass/PKGBUILD
blob: 125afee5dff1c87fb791715fd80616ae24606831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# 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')
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'
            '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")

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} \
    --prefix=/opt \
    --enable-W11 \
    --without-glw \
    --with-jpeg \
    --with-tiff \
    --with-png \
    --with-tcltk \
    --with-opengl \
    --with-fftw \
    --with-postgres \
    --with-freetype \
    --with-freetype-includes=/usr/include/freetype2 \
    --with-nls \
    --with-gdal \
    --with-geos \
    --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 \

  make
}

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
}