# Maintainer: SaultDon # Contributor: Lantald < lantald at gmx.com > # Contributor: Thomas Dziedzic < gostrc at gmail > # Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org # Contributor: Gerardo Exequiel Pozzi # Contributor: Eric Forgeot < http://esclinux.tk > # GRASS Plugin, Globe Plugin and QGIS Map Server are disabled in cmake by default. # Uncomment them in the build() portion if you'd like enabled during the build. pkgname=qgis pkgver=2.4.0 pkgrel=3 pkgdesc='Quantum GIS is a Geographic Information System (GIS) that supports vector, raster & database formats' url='http://qgis.org/' license=('GPL') arch=('i686' 'x86_64') # https://raw.githubusercontent.com/qgis/QGIS/final-2_4_0/INSTALL depends=('qt4>=4.8.6' 'proj' 'geos' 'sqlite>=3.8.4.1' 'gdal>=1.11.0' 'expat>=2.1.0' 'qwt>=6.1.0' 'qwtpolar>=1.1.0' 'python2' 'python2-pyqt4>=4.11.1' 'python2-qscintilla>=2.8.3' 'python2-sip>=4.16.2' 'python2-psycopg2' 'libspatialite' 'spatialindex') makedepends=('cmake' 'flex' 'bison' 'txt2tags') optdepends=('grass: GRASS plugin support' # Uncomment relevant cmake option in build() below 'fcgi: QGIS Map Server support' # if you want GRASS, QGIS Map Server 'osgearth: QGIS Globe plugin support' # or the Globe Plugin enabled 'gsl: Georeferencing plugin support' 'gpsbabel: GPS toolbar support') provides=("$pkgname=$pkgver") conflicts=("$pkgname-git") install="$pkgname.install" source=("$pkgname-$pkgver.tar.gz::https://github.com/qgis/QGIS/archive/final-2_4_0.tar.gz" 'qgis.sh' 'canvas-qt-flicker.patch' 'https://raw.githubusercontent.com/Ariki/QGIS/support-configure-ng/cmake/FindPyQt.py') md5sums=('db3428c1a2adced11a6a655fe2bb9eb3' '9431344b724d85ec82a93ce8ce4ddbbb' 'e7f8231f99a56f07788113097fbf6f7c' '741c35e251e5623b86c29251567ba1dd') prepare() { mv "$srcdir/QGIS-final-2_4_0" "$srcdir/$pkgname-$pkgver" cd "$srcdir/$pkgname-$pkgver" patch -p1 -i "$srcdir/canvas-qt-flicker.patch" # http://hub.qgis.org/issues/4011 mv ../FindPyQt.py cmake/ # https://hub.qgis.org/issues/10596 # http://www.uclmail.net/users/babayoshihiko/fink/qgis/pyqt4-sip/index.html perl -pi -e "s|from PyQt4 import pyqtconfig||" python/console/console.py perl -pi -e "s|pyqtconfig\.Configuration\(\)\.qt_version >= 0x40700|True|" python/console/console.py } build() { # Fix insecure RPATH is weird, but just works ;) # echo "os.system(\"sed -i '/^LFLAGS/s|-Wl,-rpath,.\+ ||g' gui/Makefile core/Makefile\")" >> python/configure.py.in cd "$srcdir/$pkgname-$pkgver" # Fixing by hand shebang for .py files. find . -iname '*.py' | xargs sed -ie 's:^#!/usr/bin/env python$:#!/usr/bin/env python2:' find . -iname '*.py' | xargs sed -ie 's:^#!/usr/bin/python$:#!/usr/bin/env python2:' if [ -d build ]; then rm -rf build fi mkdir build cd build cmake ../ \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_INSTALL_PREFIX=/usr \ -DENABLE_TESTS=OFF \ -DQGIS_MANUAL_SUBDIR=share/man \ -DPYTHON_EXECUTABLE=/usr/bin/python2 \ -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so \ -DPYTHON_INCLUDE_PATH=/usr/include/python2.7 \ -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python2.7/site-packages \ -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4 \ -DWITH_INTERNAL_QWTPOLAR=OFF \ -DWITH_INTERNAL_SPATIALITE=OFF \ # -DGRASS_PREFIX=/opt/grass \ # -DWITH_MAPSERVER=TRUE \ # -DWITH_GLOBE=TRUE \ make # TODO: fix $srcdir warning if it's a real problem... } package() { cd "$srcdir/$pkgname-$pkgver/build" make DESTDIR="$pkgdir/" install # install some freedesktop.org compatibility install -D -m644 "$srcdir/$pkgname-$pkgver/debian/qgis.desktop" \ "$pkgdir/usr/share/applications/qgis.desktop" install -D -m644 "$srcdir/$pkgname-$pkgver/debian/qbrowser.desktop" \ "$pkgdir/usr/share/applications/qbrowser.desktop" # TODO: these aren't working for some reason, ie, .qgs files are not opened by QGIS... install -dm755 "$pkgdir/usr/share/pixmaps" \ "$pkgdir/usr/share/mimelnk/application" for mime in "$srcdir/$pkgname-$pkgver/debian/mime/application/"*.desktop do install -m644 "$mime" "$pkgdir/usr/share/mimelnk/application" done ln -s /usr/share/qgis/images/icons/qgis-icon.xpm "$pkgdir/usr/share/pixmaps/qgis.xpm" ln -s /usr/share/qgis/images/icons/qgis-mime-icon.png "$pkgdir/usr/share/pixmaps/qgis-mime-icon.png" # enable qgis for python by setting PYTHONPATH install -Dm755 "$srcdir/qgis.sh" \ "$pkgdir/etc/profile.d/qgis.sh" }