summaryrefslogtreecommitdiff
path: root/pcr/qgis/PKGBUILD
blob: f76848c8fc7a6bee685297758c05e65ae85a8e91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Maintainer (Arch): Doug Newgard <scimmia at archlinux dot info>
# Maintainer (Arch): XavierCLL <xavier.corredor.llano (a) gmail.com>
# Contributor (Arch): SaultDon <sault.don gmail>
# Contributor (Arch): Lantald < lantald at gmx.com >
# Contributor (Arch): Thomas Dziedzic < gostrc at gmail >
# Contributor (Arch): dibblethewrecker dibblethewrecker.at.jiwe.dot.org
# Contributor (Arch): Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
# Contributor (Arch): Eric Forgeot < http://esclinux.tk >
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

# Globe Plugin and Map Server are disabled in cmake by default.
# Uncomment them in the build() portion if you'd like them enabled.
# You will also need to install osgearth or fcgi, respectively, before building.

pkgname=qgis
pkgver=2.12.1
pkgrel=1.parabola1
pkgdesc='Geographic Information System (GIS) that supports vector, raster & database formats, without nonfree ElvenSword resource'
url='http://qgis.org/'
license=('GPL')
arch=('i686' 'x86_64')
depends=('qca-qt4' 'gdal' 'qwtpolar' 'gsl' 'spatialindex' 'icu'
         'python2-qscintilla' 'python2-sip' 'python2-psycopg2' 'python2-six' 'python2-dateutil'
         'python2-httplib2' 'python2-jinja' 'python2-markupsafe' 'python2-pygments' 'python2-pytz')
makedepends=('cmake' 'txt2tags' 'perl')
optdepends=('gpsbabel: GPS Tool plugin')
install="$pkgname.install"
mksource=("http://qgis.org/downloads/$pkgname-$pkgver.tar.bz2")
source=("https://repo.parabola.nu/other/${pkgname}-libre/${pkgname}-libre-${pkgver}.tar.bz2"
        "libre.patch")
mkmd5sums=('b47a7e040341164fd2b8f7970055e3d0')
md5sums=('9399b11476a6df55e3446b1bb6101679'
         '6c5f082d7f41f45762030a80aa89d5ff')

mksource() {
  cd $pkgname-$pkgver

  # remove nonfree resource
  rm -rv "resources/cpt-city-qgis-min/es"
}

prepare() {
  cd $pkgname-$pkgver

  patch -Np1 -i "$srcdir/libre.patch"

  # Fixing shebang for .py files
  sed -i 's/\(env \|\/usr\/bin\/\)python$/&2/' $(find . -iname "*.py")

  # Fix console.py for new pyqt build system
  sed -e '/from PyQt4.QtCore/ s/$/, QT_VERSION/' \
      -e '/import pyqtconfig/d' \
      -e 's/pyqtconfig.*qt_version/QT_VERSION/' \
      -i python/console/console.py

  [[ -d build ]] || mkdir build
}

build() {
  cd $pkgname-$pkgver/build

  cmake -G "Unix Makefiles" ../ \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DQGIS_MANUAL_SUBDIR=share/man \
    -DENABLE_TESTS=FALSE \
    -DCMAKE_SKIP_RPATH=TRUE \
    -DPYTHON_EXECUTABLE=/usr/bin/python2 \
    -DWITH_INTERNAL_QWTPOLAR=FALSE \
    -DWITH_INTERNAL_SIX=FALSE \
    -DWITH_INTERNAL_DATEUTIL=FALSE \
    -DWITH_INTERNAL_HTTPLIB2=FALSE \
    -DWITH_INTERNAL_JINJA2=FALSE \
    -DWITH_INTERNAL_MARKUPSAFE=FALSE \
    -DWITH_INTERNAL_PYGMENTS=FALSE \
    -DWITH_INTERNAL_PYTZ=FALSE \
#    -DWITH_SERVER=TRUE \
#    -DWITH_GLOBE=TRUE

  make
}

package() {
  cd $pkgname-$pkgver

  # Add optional deps based on selected or autodetected options
  [[ -n "$(awk -F= '/^GRASS_PREFIX:/ {print $2}' build/CMakeCache.txt)" ]] && \
    optdepends+=('grass6: GRASS6 plugin')
  [[ -n "$(awk -F= '/^GRASS_PREFIX7:/ {print $2}' build/CMakeCache.txt)" ]] && \
    optdepends+=('grass: GRASS7 plugin')
  [[ "$(awk -F= '/^WITH_SERVER:/ {print $2}' build/CMakeCache.txt)" == "TRUE" ]] && \
    optdepends+=('fcgi: Map Server')
  [[ "$(awk -F= '/^WITH_GLOBE:/ {print $2}' build/CMakeCache.txt)" == "TRUE" ]] && \
    optdepends+=('osgearth: Globe plugin')

  make -C build DESTDIR="$pkgdir" install

  # install some freedesktop.org compatibility
  install -Dm644 debian/{qgis,qbrowser}.desktop -t "$pkgdir/usr/share/applications/"
  install -Dm644 debian/qgis-icon512x512.png "$pkgdir/usr/share/pixmaps/qgis.png"
  install -Dm644 debian/qbrowser-icon512x512.png "$pkgdir/usr/share/pixmaps/qbrowser.png"
  install -Dm644 images/icons/qgis-mime-icon.png "$pkgdir/usr/share/pixmaps/qgis-mime.png"

  # TODO: these aren't working for some reason, ie, .qgs files are not opened by QGIS...
  # Appears to be a conflict with some file types being defaulted to google-chrome/chromium if that's installed as well.
  for mime in debian/mime/application/*.desktop
    do install -Dm644 "$mime" -t "$pkgdir/usr/share/mimelnk/application/"
  done

  # compile python files, since the cmake option doesn't seem to account for DESTDIR
  python2 -m compileall -q "$pkgdir"
}