desktop/qgis/PKGBUILD
2018-03-05 08:28:20 +00:00

78 lines
2.8 KiB
Bash

pkgname=qgis
pkgver=2.18.17
pkgrel=1
pkgdesc='A Geographic Information System (GIS) that supports vector, raster and database formats'
url='http://qgis.org/'
license=('GPL')
arch=('x86_64')
depends=('gcc-libs' 'glibc' 'gdal' 'proj' 'geos' 'expat' 'libspatialite' 'spatialindex' 'postgresql-libs' 'qca' 'qt' 'qwt6' 'sqlite3' 'python2' 'qscintilla-python2' 'pyqt4-python2' 'python2-pyspatialite'
'python2-jinja')
makedepends=('cmake' 'flex' 'bison' 'fcgi' 'grass' 'gsl' 'postgis' 'python2-sip' 'python2-pip' 'python2-setuptools')
optdepends=('fcgi: qgis mapserver'
'grass: grass plugin'
'gsl: georeferencer'
'python2-sip: python-support'
'postgis: postgis support and SPIT plugin')
source=("http://qgis.org/downloads/$pkgname-$pkgver.tar.bz2")
sha256sums=('5e20709598b01e207d4a0d4992ff08e1751f4fbf832b3c76fa71adc869a1bcdb')
prepare() {
cd $pkgname-$pkgver
# Fix references to "python"
sed -i 's/\(env \|\/usr\/bin\/\)python$/&2/' $(find . -iname "*.py")
# Remove mime types already defined by freedesktop.org
sed -e '/type="image\/tiff"/,/<\/mime-type>/d' \
-e '/type="image\/jpeg"/,/<\/mime-type>/d' \
-e '/type="image\/jp2"/,/<\/mime-type>/d' \
-e '/type="application\/x-adobe-mif"/,/<\/mime-type>/d' \
-i debian/qgis.xml
[[ -d build ]] || mkdir build
}
build() {
cd $pkgname-$pkgver/build
cmake -G "Unix Makefiles" ../ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_GRASS=OFF \
-DGRASS_PREFIX=/opt/grass \
-DGRASS_INCLUDE_DIR=/opt/grass/include/ \
-DQGIS_MANUAL_SUBDIR=share/man \
-DPYTHON_EXECUTABLE=/usr/bin/python2 \
-DENABLE_TESTS=FALSE \
-DCMAKE_SKIP_RPATH=TRUE
make
}
package() {
cd $pkgname-$pkgver/build
make DESTDIR=$pkgdir install
# install python2-psycopg2
pip2 install --target=$pkgdir/usr/share/qgis/python psycopg2
# create a more user-friendly application name link
ln -s /usr/bin/qgis "$pkgdir/usr/bin/quantum-gis"
cd ..
# install some freedesktop.org compatibility
install -Dm644 debian/{qgis,qbrowser}.desktop -t "$pkgdir/usr/share/applications/"
for prog in qgis qbrowser; do
install -Dm644 images/icons/${prog}_icon.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/$prog.svg"
done
# install mime information and icons
install -Dm644 debian/qgis.xml "$pkgdir/usr/share/mime/packages/qgis.xml"
install -Dm644 images/icons/qgis-mime-icon.png "$pkgdir/usr/share/icons/hicolor/128x128/mimetypes/qgis-mime.png"
for type in asc ddf dem dt0 dxf gml img mime mldata qgs qlr qml qpt shp sqlite; do
install -Dm644 images/icons/qgis_${type}_icon.svg "$pkgdir/usr/share/icons/hicolor/scalable/mimetypes/qgis-$type.svg"
done
}