summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 97aa55867ea08848ca2d4469a29518054dc60916 (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
# Maintainer: Doug Newgard <scimmia at archlinux dot info>
# Contributor: Maciej Sieczka <msieczka at sieczka dot org>

pkgname=grass
pkgver=7.0.1
pkgrel=3
_shortver=${pkgver%.*}
_shortver=${_shortver/./}
pkgdesc='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=('fftw' 'gdal' 'glu' 'wxpython' 'python2-pillow')
makedepends=('libxt')
optdepends=('postgresql: PostgreSQL database interface')
source=("http://grass.osgeo.org/grass$_shortver/source/$pkgname-$pkgver.tar.gz")
sha256sums=('0987dd1618fde24b05785a502c7db8c09401a522a7a3ee50543068fab4eb405f')

prepare() {
  cd $pkgname-$pkgver

  ln -sf "$(which python2)" python

  sed -i 's/\(env \|\/usr\/bin\/\)python$/&2/' $(find . -name "*.py")
  sed -i '/os\.environ.*GRASS_PYTHON/ s/"python"/"python2"/' lib/init/grass.py
  sed -i "/^Exec/ s/=.*/=grass$_shortver/" gui/icons/grass.desktop
}

build() {
  cd $pkgname-$pkgver

  export PATH="$srcdir/$pkgname-$pkgver:$PATH"
  export CFLAGS="$CPPFLAGS $CFLAGS"
  export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
  unset CPPFLAGS

  ./configure \
    --prefix=/opt/$pkgname \
    --with-freetype-includes=/usr/include/freetype2 \
    --with-wxwidgets \
    --with-readline \
    --with-geos \
    --with-postgres

  make
}

package() {
  cd $pkgname-$pkgver

  make exec_prefix="$pkgdir/usr" INST_DIR="$pkgdir/opt/$pkgname" install

  sed -i "s|$pkgdir||g" "$pkgdir/opt/grass/demolocation/.grassrc$_shortver" "$pkgdir/usr/bin/grass$_shortver"
  sed -i "s|$srcdir||g" "$pkgdir/opt/grass/docs/html/t.connect.html"

  install -Dm644 gui/icons/grass-64x64.png "$pkgdir/usr/share/pixmaps/grass.png"
  install -Dm644 gui/icons/grass.desktop "$pkgdir/usr/share/applications/grass.desktop"
}