Created
October 28, 2018 03:18
-
-
Save samtux/b0ab178672b95ee04de235f475f8c4f8 to your computer and use it in GitHub Desktop.
PKGBUILD qgis-git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: gaelic | |
pkgname=qgis-git | |
_pkgname=qgis | |
pkgver=3.5.0_master.r51658.aa42b8689c | |
_pkgver=3.5.0_master | |
pkgrel=1 | |
pkgdesc='Geographic Information System (GIS) that supports vector, raster & database formats - Development master' | |
url='http://qgis.org/' | |
license=('GPL') | |
arch=('i686' 'x86_64') | |
depends=('qt5-tools' 'qt5-script' 'qtkeychain' 'qca-qt5' 'qt5-webkit' 'qt5-3d' 'qt5-serialport' 'proj' 'geos' 'sqlite' 'python-gdal' 'python-owslib' 'python-future' 'python-sip' 'python-psycopg2' 'python-yaml' 'python-numpy' 'python-jinja' 'python-pygments' 'qwtpolar' 'expat' 'python-qscintilla-qt5' 'spatialindex' 'gsl' 'libzip' 'sip') | |
makedepends=('git' 'cmake' 'txt2tags') | |
optdepends=('grass: for GRASS providers and plugin (6 or 7)' | |
# 'gsl: for georeferencer' | |
'postgresql: for postgis and SPIT support' | |
'gpsbabel: for gps plugin' | |
'fcgi: for qgis mapserver' | |
'ocilib: oracle provider') | |
#install="$_pkgname.install" | |
source=("${_pkgname}::git://github.com/qgis/QGIS.git" qgis_es.ts) | |
md5sums=('SKIP' | |
'a82ee56c16ce6fb393272ff909edbc18') | |
#conflicts=('qgis') | |
pkgver(){ | |
cd "$_pkgname" | |
printf "%s.r%s" "$_pkgver" "$(git rev-list --count HEAD).$(git rev-parse --short HEAD)" | |
} | |
prepare() { | |
cd $_pkgname | |
# Fix desktop file for /usr/bin/qgis-github | |
# sed -e 's/\/usr\/bin\/qgis/\/usr\/bin\/qgis-git/g' \ | |
sed -e 's/Exec=qgis/Exec=qgis-git/g' \ | |
-e 's/Icon=qgis/Icon=qgis-git/g' \ | |
-i linux/org.qgis.qgis.desktop.in | |
#cp linux/org.qgis.qgis.desktop.in linux/org.qgis.qgis-git.desktop | |
# 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 | |
install -Dm644 $srcdir/qgis_es.ts "$srcdir/$_pkgname"/i18n/qgis_es.ts | |
} | |
build() { | |
cd $_pkgname/build | |
cmake -G "Unix Makefiles" ../ \ | |
-DCMAKE_INSTALL_PREFIX=/opt/$pkgname \ | |
-DQGIS_MANUAL_SUBDIR=share/man \ | |
-DENABLE_TESTS=FALSE \ | |
-DWITH_INTERNAL_QWTPOLAR=FALSE \ | |
-DWITH_INTERNAL_{HTTPLIB2,JINJA2,MARKUPSAFE,OWSLIB,PYGMENTS,DATEUTIL,PYTZ,YAML,NOSE2,SIX,FUTURE}=FALSE \ | |
-DWITH_GEOREFERENCER=TRUE \ | |
-DWITH_3D=TRUE \ | |
-DWITH_SERVER=TRUE | |
# -DWITH_GLOBE=TRUE | |
make | |
} | |
package() { | |
cd $_pkgname/build | |
# Add optional deps based on selected or autodetected options | |
[[ -n "$(sed -n '/^GRASS_PREFIX:/ s/.*=//p' CMakeCache.txt)" ]] && optdepends+=('grass6: GRASS6 plugin') | |
[[ -n "$(sed -n '/^GRASS_PREFIX7:/ s/.*=//p' CMakeCache.txt)" ]] && optdepends+=('grass: GRASS7 plugin') | |
[[ "$(sed -n '/^WITH_SERVER:/ s/.*=//p' CMakeCache.txt)" == "TRUE" ]] && optdepends+=('fcgi: Map Server') | |
[[ "$(sed -n '/^WITH_GLOBE:/ s/.*=//p' CMakeCache.txt)" == "TRUE" ]] && optdepends+=('osgearth: Globe plugin') | |
make DESTDIR="$pkgdir" install | |
cd "$srcdir/$_pkgname" | |
install -d -m755 $pkgdir/usr/bin | |
ln -s /opt/$pkgname/bin/qgis "$pkgdir/usr/bin/qgis-git" | |
# install desktop files and icons | |
# install -Dm644 linux/org.qgis.qgis-git.desktop -t "$pkgdir/usr/share/applications/" | |
install -Dm644 build/org.qgis.qgis.desktop "$pkgdir/usr/share/applications/org.qgis.qgis-git.desktop" | |
for resolution in `ls /usr/share/icons/hicolor/|egrep '[0-9]'`; do | |
if [ -e debian/icons/qgis-icon{$resolution}.png ] | |
then | |
install -Dm644 debian/icons/qgis-icon${resolution}.png "$pkgdir/usr/share/icons/hicolor/${resolution}/apps/$pkgname.png" | |
fi | |
done | |
install -Dm644 images/icons/qgis_icon.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.svg" | |
# install mime information and icon | |
install -Dm644 debian/qgis.xml "$pkgdir/usr/share/mime/packages/qgis-git.xml" | |
for resolution in `ls /usr/share/icons/hicolor/|egrep '[0-9]'`; do | |
if [ -e debian/icons/qgis-mime-icon{$resolution}.png ] | |
then | |
install -Dm644 debian/icons/qgis-mime-icon${resolution}.png "$pkgdir/usr/share/icons/hicolor/${resolution}/mimetypes/qgis-git-mime.png" | |
fi | |
done | |
install -Dm644 images/icons/qgis_mime_icon.svg "$pkgdir/usr/share/icons/hicolor/scalable/mimetypes/qgis-git-mime.svg" | |
for type in qgs qlr qml qpt; do | |
for resolution in `ls /usr/share/icons/hicolor/|egrep '[0-9]'`; do | |
if [ -e debian/icons/qgis-${type}${resolution}.png ] | |
then | |
install -Dm644 debian/icons/qgis-${type}${resolution}.png "$pkgdir/usr/share/icons/hicolor/${resolution}/mimetypes/qgis-git-$type.png" | |
fi | |
done | |
done | |
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-git-$type.svg" | |
done | |
# compile python files, since the cmake option doesn't seem to account for DESTDIR | |
python -m compileall -q "$pkgdir" | |
# link libraries | |
install -d -m755 "${pkgdir}"/etc/ld.so.conf.d/ | |
echo '/opt/qgis-git/lib' > "${pkgdir}"/etc/ld.so.conf.d/qgis-git.conf | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment