PKGBUILD 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Maintainer (arch): Doug Newgard <scimmia at archlinux dot info>
  2. # Contributor: Maciej Sieczka <msieczka at sieczka dot org>
  3. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  4. pkgname=grass
  5. pkgver=7.2.0
  6. pkgrel=1
  7. _shortver=${pkgver%.*}; _shortver=${_shortver/./}
  8. pkgdesc='Geospatial data management and analysis, image processing, graphics/maps production, spatial modeling and visualization'
  9. arch=('i686' 'x86_64')
  10. url='http://grass.osgeo.org/'
  11. license=('GPL')
  12. depends=('fftw' 'gdal' 'glu' 'python2-pillow' 'subversion' 'wxpython')
  13. makedepends=('libxt')
  14. optdepends=('postgresql: PostgreSQL database interface')
  15. source=("http://grass.osgeo.org/grass$_shortver/source/$pkgname-$pkgver.tar.gz")
  16. md5sums=('9ba295bbf2d8d84ad46fced1597814df')
  17. prepare() {
  18. cd $pkgname-$pkgver
  19. # Change everything to use python2
  20. sed -i 's/\(env \|\/usr\/bin\/\)python$/&2/' $(find . -iname "*.py")
  21. sed -i '/os\.environ.*GRASS_PYTHON/ s/"python"/"python2"/' lib/init/grass.py
  22. sed -i '/^PYTHON/ s/python$/&2/' include/Make/Platform.make.in
  23. # Fix path
  24. sed -i '/^\s*INSTDIR/ s/".*"//' configure
  25. }
  26. build() {
  27. cd $pkgname-$pkgver
  28. export CXXFLAGS="-std=c++98 $CXXFLAGS"
  29. # Ancient autoconf used upstream can't handle CPPFLAGS correctly, so set CPP to ignore warnings
  30. CPP="gcc -E -w" \
  31. ./configure \
  32. --prefix=/opt/$pkgname \
  33. --with-freetype-includes=/usr/include/freetype2 \
  34. --with-wxwidgets \
  35. --with-readline \
  36. --with-pthread \
  37. --with-netcdf \
  38. --with-nls \
  39. --with-geos \
  40. --with-postgres
  41. make
  42. }
  43. package() {
  44. cd $pkgname-$pkgver
  45. make exec_prefix="$pkgdir/usr" INST_DIR="$pkgdir/opt/$pkgname" install
  46. # Install linker config file, needed for qgis to find grass
  47. install -d "$pkgdir/etc/ld.so.conf.d/"
  48. echo "/opt/$pkgname/lib" > "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"
  49. cd "$pkgdir/opt/$pkgname"
  50. # Fix for 3rd party python scripts
  51. ln -s ../../../usr/bin/python2 bin/python
  52. # Put freedesktop.org files in correct location
  53. mv share "$pkgdir/usr"
  54. # Fix some paths that get hard coded by make install
  55. sed -i "s|$pkgdir||g" demolocation/.grassrc$_shortver \
  56. include/Make/{Platform,Grass}.make \
  57. etc/fontcap \
  58. "$pkgdir/usr/bin/grass$_shortver"
  59. sed -i "s|$srcdir||g" docs/html/t.connect.html
  60. }