mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 02:22:13 +08:00
105 lines
3.5 KiB
Bash
105 lines
3.5 KiB
Bash
# Contributions from AUR: https://aur.archlinux.org/packages/grass70-svn/
|
|
|
|
pkgname=grass
|
|
pkgver=7.0.3
|
|
pkgrel=1
|
|
_shortver=${pkgver%.*}; _shortver=${_shortver/./}
|
|
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')
|
|
|
|
# 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'
|
|
'blas' 'libpng' 'libtiff' 'libxmu' 'mesa' 'postgresql' 'proj'
|
|
'xorg-server' 'cairo' 'unixodbc' 'python2'
|
|
'python2-numpy' 'python2-pillow')
|
|
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'
|
|
'blas: required for GMATH library'
|
|
'lesstif: motif support')
|
|
source=("http://grass.osgeo.org/grass70/source/${pkgname}-${pkgver}.tar.gz")
|
|
md5sums=('dfbd39829036ee2d59b13c35a183ec0e')
|
|
|
|
|
|
prepare() {
|
|
cd $pkgname-$pkgver
|
|
|
|
# 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
|
|
|
|
# Fix path
|
|
sed -i '/^\s*INSTDIR/ s/".*"//' configure
|
|
}
|
|
|
|
build() {
|
|
cd "$pkgname-$pkgver"
|
|
# Ancient autoconf used upstream can't handle CPPFLAGS correctly
|
|
export CFLAGS="$CPPFLAGS $CFLAGS"
|
|
export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
|
unset CPPFLAGS
|
|
|
|
#No way to bypass wxpython failures, no need to have it since we don't use it
|
|
rm -r ${srcdir}/${pkgname}-${pkgver}/gui/wxpython
|
|
|
|
./configure \
|
|
--prefix=/opt/$pkgname \
|
|
--with-cxx \
|
|
--with-cairo \
|
|
--with-freetype \
|
|
--with-freetype-includes=/usr/include/freetype2 \
|
|
--with-geos \
|
|
--with-python \
|
|
--with-blas \
|
|
--with-lapack \
|
|
--with-nls \
|
|
--with-netcdf \
|
|
--with-odbc \
|
|
--with-openmp \
|
|
--with-postgres \
|
|
--with-python=/usr/bin/python2-config \
|
|
--with-readline \
|
|
--with-proj-includes=/usr/include \
|
|
--with-proj-libs=/usr/lib \
|
|
--with-proj-share=/usr/share/proj \
|
|
--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() {
|
|
cd $pkgname-$pkgver
|
|
|
|
make exec_prefix="$pkgdir/usr" INST_DIR="$pkgdir/opt/$pkgname" install
|
|
|
|
# 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"
|
|
|
|
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
|
|
}
|