desktop/grass/PKGBUILD

103 lines
3.5 KiB
Bash
Raw Normal View History

2015-12-07 02:15:47 +08:00
# Contributions from AUR: https://aur.archlinux.org/packages/grass70-svn/
2016-02-21 21:15:08 +08:00
pkgname=grass
2018-11-08 12:31:17 +08:00
pkgver=7.4.2
2016-10-04 04:12:28 +08:00
pkgrel=1
2015-12-07 02:15:47 +08:00
_shortver=${pkgver%.*}; _shortver=${_shortver/./}
2015-03-15 21:42:21 +08:00
pkgdesc="GRASS GIS: geospatial data management and analysis, image processing, graphics/maps production, spatial modeling and visualization."
arch=('x86_64')
url='http://grass.osgeo.org/'
license=('GPL')
2015-03-15 21:42:21 +08:00
# 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'
2016-03-28 01:52:09 +08:00
'openblas' 'libpng' 'libtiff' 'libxmu' 'mesa' 'postgresql' 'proj'
2015-03-15 21:42:21 +08:00
'xorg-server' 'cairo' 'unixodbc' 'python2'
2016-03-28 01:52:09 +08:00
'python2-numpy' 'python2-pillow' 'lapack')
2015-03-15 21:42:21 +08:00
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'
2015-03-15 21:42:21 +08:00
'lesstif: motif support')
2017-01-04 17:50:12 +08:00
source=("http://grass.osgeo.org/grass$_shortver/source/${pkgname}-${pkgver}.tar.gz")
2018-11-08 12:31:17 +08:00
sha1sums=('34135720f473a21a569fad1a71608d9cf8ec43d9')
2015-03-15 21:42:21 +08:00
prepare() {
2015-12-07 02:15:47 +08:00
cd $pkgname-$pkgver
2015-12-07 02:15:47 +08:00
# Change everything to use python2
sed -i 's/\(env \|\/usr\/bin\/\)python$/&2/' $(find . -iname "*.py")
sed -i '/os\.environ.*GRASS_PYTHON/ s/"python"/"python2"/' lib/init/grass.py
sed -i '/^PYTHON/ s/python$/&2/' include/Make/Platform.make.in
2015-12-07 02:15:47 +08:00
# Fix path
sed -i '/^\s*INSTDIR/ s/".*"//' configure
2015-03-15 21:42:21 +08:00
}
build() {
cd "$pkgname-$pkgver"
2015-12-07 02:15:47 +08:00
# Ancient autoconf used upstream can't handle CPPFLAGS correctly
export CFLAGS="$CPPFLAGS $CFLAGS"
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
unset CPPFLAGS
2015-03-15 21:42:21 +08:00
#No way to bypass wxpython failures, no need to have it since we don't use it
2015-12-07 02:15:47 +08:00
rm -r ${srcdir}/${pkgname}-${pkgver}/gui/wxpython
2015-03-15 21:42:21 +08:00
./configure \
2015-12-07 02:15:47 +08:00
--prefix=/opt/$pkgname \
2015-03-15 21:42:21 +08:00
--with-cxx \
--with-cairo \
--with-freetype \
--with-freetype-includes=/usr/include/freetype2 \
--with-geos \
--with-python \
2016-03-28 01:52:09 +08:00
--with-openblas \
--with-lapack \
2015-03-15 21:42:21 +08:00
--with-nls \
--with-netcdf \
--with-odbc \
--with-openmp \
--with-postgres \
--with-python=/usr/bin/python2-config \
--with-readline \
--with-proj-includes=/usr/include \
2015-03-15 21:42:21 +08:00
--with-proj-libs=/usr/lib \
--with-proj-share=/usr/share/proj \
2015-03-15 21:42:21 +08:00
--with-pthread \
--with-sqlite \
--with-mysql-includes=/usr/include/mysql \
--with-mysql \
--without-wxwidgets
#make sure wxpython is not attempted by make
sed -i "s/SUBDIRS = icons images scripts xml wxpython/SUBDIRS = icons images scripts xml/g" ${srcdir}/${pkgname}-${pkgver}/gui/Makefile
make
}
package() {
2015-12-07 02:15:47 +08:00
cd $pkgname-$pkgver
2015-03-15 21:42:21 +08:00
2015-12-07 02:15:47 +08:00
make exec_prefix="$pkgdir/usr" INST_DIR="$pkgdir/opt/$pkgname" install
2015-03-15 21:42:21 +08:00
2015-12-07 02:15:47 +08:00
# Install linker config file, needed for qgis to find grass
install -d "$pkgdir/etc/ld.so.conf.d/"
echo "/opt/$pkgname/lib" > "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"
2015-03-15 21:42:21 +08:00
2015-12-07 02:15:47 +08:00
cd "$pkgdir/opt/$pkgname"
# Put freedesktop.org files in correct location
mv share "$pkgdir/usr"
install -Dm644 gui/icons/grass-48x48.png "$pkgdir/usr/share/icons/hicolor/48x48/apps/grass.png"
install -Dm644 gui/icons/grass-64x64.png "$pkgdir/usr/share/icons/hicolor/64x64/apps/grass.png"
# Fix some paths that get hard coded by make install
sed -i "s|$pkgdir||g" demolocation/.grassrc$_shortver \
include/Make/{Platform,Grass}.make \
etc/fontcap \
"$pkgdir/usr/bin/grass$_shortver"
sed -i "s|$srcdir||g" docs/html/t.connect.html
}