You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
3.1 KiB

# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org
# Contributor: William Rea <sillywilly@gmail.com>
pkgbase=gdal
pkgname=('gdal' 'python-gdal')
pkgver=3.3.1
pkgrel=8.1
pkgdesc="A translator library for raster geospatial data formats"
arch=('x86_64')
url="https://gdal.org/"
license=('custom')
depends=('curl' 'geos' 'giflib' 'hdf5' 'libgeotiff' 'libjpeg-turbo' 'libpng' 'libspatialite' 'libtiff' 'netcdf'
'openjpeg2' 'poppler' 'cfitsio' 'sqlite' 'mariadb-libs' 'postgresql-libs' 'xerces-c' 'json-c')
makedepends=('perl' 'swig' 'chrpath' 'doxygen' 'python-breathe' 'python-numpy' 'python-sphinx' 'boost')
optdepends=('postgresql: postgresql database support'
'mariadb: mariadb database support'
'perl: perl binding support')
options=('!emptydirs')
changelog=$pkgbase.changelog
source=(https://download.osgeo.org/${pkgbase}/${pkgver}/${pkgbase}-${pkgver}.tar.xz
poppler-21.10.0.patch
gdal-perl-vendor.patch)
sha256sums=('48ab00b77d49f08cf66c60ccce55abb6455c3079f545e60c90ee7ce857bccb70'
'3074318889631fa9a9f351feccedb4d7a368b56017cc3660276c7aac154af6de'
'2103b98f2f15954f042d5620658b30d703125927bde2e5eb671c5facb6c2f5ed')
prepare() {
cd "${srcdir}"/$pkgbase-$pkgver
# Fix mandir
sed -i "s|^mandir=.*|mandir='\${prefix}/share/man'|" configure
# Fix build with poppler 21.10.0
patch -Np2 -i "${srcdir}"/poppler-21.10.0.patch
# Fix Perl bindings installation path
patch -Np0 -i "${srcdir}"/gdal-perl-vendor.patch
}
build() {
cd "${srcdir}"/$pkgbase-$pkgver
./configure --prefix=/usr --with-netcdf --with-libtiff --with-sqlite3 --with-geotiff \
--with-mysql --with-curl --with-hdf5 --with-perl --with-geos \
--with-png --with-poppler --with-spatialite --with-openjpeg
# workaround for bug #13646
# sed -i 's/PY_HAVE_SETUPTOOLS=1/PY_HAVE_SETUPTOOLS=/g' ./GDALmake.opt
# sed -i 's/EXE_DEP_LIBS/KILL_EXE_DEP_LIBS/' apps/GNUmakefile
make
make man
cd "${srcdir}"/$pkgbase-$pkgver/swig/python
python setup.py build
}
package_gdal () {
cd "${srcdir}"/$pkgbase-$pkgver
make DESTDIR="${pkgdir}" install
make DESTDIR="${pkgdir}" install-man
# install license
install -Dm644 LICENSE.TXT "${pkgdir}"/usr/share/licenses/$pkgbase/LICENSE
# Remove RPATH
eval local $(perl -V:vendorarch)
chrpath --delete "${pkgdir}"${vendorarch}/auto/Geo/OSR/OSR.so
chrpath --delete "${pkgdir}"${vendorarch}/auto/Geo/OGR/OGR.so
chrpath --delete "${pkgdir}"${vendorarch}/auto/Geo/GDAL/GDAL.so
chrpath --delete "${pkgdir}"${vendorarch}/auto/Geo/GDAL/Const/Const.so
chrpath --delete "${pkgdir}"${vendorarch}/auto/Geo/GNM/GNM.so
}
package_python-gdal () {
pkgdesc="Python bindings for GDAL"
depends=("gdal=$pkgver" 'python-numpy')
optdepends=()
cd "${srcdir}"/$pkgbase-$pkgver/swig/python
python setup.py install --root="$pkgdir" --optimize=1 --skip-build
# install -Dm755 -t "${pkgdir}"/usr/bin scripts/*.py
install -dm755 "${pkgdir}"/usr/share/licenses
ln -s $pkgbase "${pkgdir}"/usr/share/licenses/$pkgname
}