summaryrefslogtreecommitdiff
path: root/pcr/grass/PKGBUILD
blob: aa32f8ca8eaaa095fcd40efb43940d0fd75dcfd8 (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
131
132
133
134
135
136
137
138
# Maintainer: Thomas Dziedzic < gostrc at gmail >
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org
# Contributor: Emiliano Vavassori <syntaxerrormmm(at)gmail.com>

pkgname=grass
pkgver=6.4.2
pkgrel=5
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')
url='http://grass.osgeo.org/'
license=('GPL')
depends=('cfitsio' 'fftw' 'gdal' 'glu' 'libjpeg' 'libpng' 'libtiff' 'libxmu' 'mesa' 'python2' 'postgresql' 'proj' 'tcl' 'tk' 'wxpython' 'xorg-server')
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"
	"grass-tk86-fix.patch")
md5sums=('d3398d6b1e3a2ef19cfb6e39a5ae9919'
         '23da2e9399b3c5504851dec37821abe1'
         '6103480c2a1adc19a50b9e925e5e6d4c'
         '8717c73e7d262b1cff44d35ce80c50bb'
         'b7cb69248a387f70dabd5ce20b8297dc')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # Replacing previous python2 fixes with a patch.
  # Thanks to Gunther Schulz to have reported a possible bug in the patching.
  patch -p1 -i "${srcdir}/grass-python2.patch"
  
  # Solves build issue reported here:
  # http://trac.osgeo.org/grass/ticket/1843
  patch -p1 -i "${srcdir}/grass-tk86-fix.patch"

  # the following exports are probably not needed
  export PYTHON=python2
  export DOXNAME=python2
  export GRASS_python=python2

  # 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
  ./configure ${ENABLE64BIT} \
    --prefix=/opt \
    --enable-64bit \
    --enable-W11 \
    --with-jpeg \
    --with-tiff \
    --with-png \
    --with-tcltk \
    --with-opengl \
    --with-fftw \
    --with-postgres \
    --with-freetype \
    --with-freetype-includes=/usr/include/freetype2 \
    --without-glw \
    --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/bin/wx-config

    # sqlite3 support
    # --with-sqlite \

    # mysql support
    # --with-mysql \
    # --with-mysql-includes=/usr/include/mysql \

    # blas support
    # --with-blas \

    # lapack support
    # --with-lapack \

  make

  # some more potential problems nvm, works without, but save for future use if problems arrise
  #cd ${pkgdir}/opt/grass-${pkgver}
  #sed -i 's/PYTHON = python/PYTHON = python2/' include/Make/Python.make
  #sed -i 's/GRASS_PYTHON=python/GRASS_PYTHON=python2/' etc/Init.sh
}

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

  # install g.html2man which is needed for some extensions
  # FS#25705 - [grass] g.html2man is not installed into package directory
  # https://bugs.archlinux.org/task/25705
  # most likely upstream problem which will be fixed in a version later than 6.4.1
  cp -r ./tools/g.html2man ${pkgdir}/opt/${pkgname}-${pkgver}/tools
}