upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / gdal / trunk / PKGBUILD
blobe03698db408ef0da9d92efc7bf9bec7a1660914d
1 # Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
2 # Maintainer: Bruno Pagani <archange@archlinux.org>
3 # Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org
4 # Contributor: William Rea <sillywilly@gmail.com>
6 pkgbase=gdal
7 pkgname=(gdal python-gdal)
8 pkgver=3.7.0
9 pkgrel=1
10 pkgdesc="A translator library for raster and vector geospatial data formats"
11 arch=(x86_64)
12 url="https://gdal.org/"
13 license=(custom)
14 makedepends=(cmake opencl-headers python-setuptools python-numpy
15              proj arrow blosc cfitsio curl crypto++ libdeflate expat libfreexl
16              libgeotiff geos giflib libheif hdf5 libjpeg-turbo json-c libjxl xz
17              libxml2 lz4 mariadb-libs netcdf unixodbc ocl-icd openexr openjpeg2
18              openssl pcre2 libpng podofo poppler postgresql-libs qhull
19              libspatialite sqlite swig libtiff libwebp xerces-c zlib zstd)
20 # armadillo basisu brunsli lerc libkml qb3 rasterlite2 sfcgal tiledb
21 # ogdi
22 changelog=$pkgbase.changelog
23 source=(https://download.osgeo.org/${pkgbase}/${pkgver}/${pkgbase}-${pkgver}.tar.xz)
24 b2sums=('400cc17fc636c637f7c40e93aed8e2db7bfbbe73741da4135cfeec8dbcda24ce0c8035214edf038afc29a916012da86a78d789729540f870231dfa6aa27e424a')
26 build() {
27   cmake -B build -S $pkgbase-$pkgver \
28     -DCMAKE_INSTALL_PREFIX=/usr \
29     -DCMAKE_CXX_STANDARD=17 \
30     -DENABLE_IPO=ON \
31     -DBUILD_PYTHON_BINDINGS=ON \
32     -DGDAL_ENABLE_PLUGINS=ON \
33     -DGDAL_USE_ARROW=ON \
34     -DGDAL_USE_BLOSC=ON \
35     -DGDAL_USE_CFITSIO=ON \
36     -DGDAL_USE_CURL=ON \
37     -DGDAL_USE_CRYPTOPP=ON \
38     -DGDAL_USE_DEFLATE=ON \
39     -DGDAL_USE_EXPAT=ON \
40     -DGDAL_USE_FREEXL=ON \
41     -DGDAL_USE_GEOTIFF=ON \
42     -DGDAL_USE_GEOS=ON \
43     -DGDAL_USE_GIF=ON \
44     -DGDAL_USE_HEIF=ON \
45     -DGDAL_USE_HDF5=ON \
46     -DGDAL_USE_ICONV=ON \
47     -DGDAL_USE_JPEG=ON \
48     -DGDAL_USE_JSONC=ON \
49     -DGDAL_USE_JXL=ON \
50     -DGDAL_USE_LIBLZMA=ON \
51     -DGDAL_USE_LIBXML2=ON \
52     -DGDAL_USE_LZ4=ON \
53     -DGDAL_USE_MYSQL=ON \
54     -DGDAL_USE_NETCDF=ON \
55     -DGDAL_USE_ODBC=ON \
56     -DGDAL_USE_OPENCL=ON \
57     -DGDAL_USE_OPENEXR=ON \
58     -DGDAL_USE_OPENJPEG=ON \
59     -DGDAL_USE_OPENSSL=ON \
60     -DGDAL_USE_PARQUET=ON \
61     -DGDAL_USE_PCRE2=ON \
62     -DGDAL_USE_PNG=ON \
63     -DGDAL_USE_POPPLER=ON \
64     -DGDAL_USE_POSTGRESQL=ON \
65     -DGDAL_USE_QHULL=ON \
66     -DGDAL_USE_SPATIALITE=ON \
67     -DGDAL_USE_SQLITE3=ON \
68     -DGDAL_USE_TIFF=ON \
69     -DGDAL_USE_WEBP=ON \
70     -DGDAL_USE_XERCESC=ON \
71     -DGDAL_USE_ZLIB=ON \
72     -DGDAL_USE_ZSTD=ON
73   make -C build
76 package_gdal () {
77   depends=(proj blosc crypto++ curl libdeflate expat libfreexl geos libgeotiff
78            giflib libjpeg-turbo json-c xz libxml2 lz4 unixodbc ocl-icd openssl
79            pcre2 libpng qhull libspatialite sqlite libtiff xerces-c zlib zstd)
80   optdepends=('arrow: Arrow/Parquet support'
81               'cfitsio: FITS support'
82               'hdf5: HDF5 support'
83               'libheif: HEIF support'
84               'libjxl: JPEG XL support'
85               'mariadb-libs: MySQL support'
86               'netcdf: netCDF support'
87               'openexr: EXR support'
88               'openjpeg2: JP2 support'
89               'podofo: PDF support'
90               'poppler: PDF support'
91               'postgresql-libs: PostgreSQL support'
92               'libwebp: WebP support')
94   make -C build DESTDIR="${pkgdir}" install
95   install -Dm644 ${pkgname}-${pkgver}/LICENSE.TXT -t "${pkgdir}"/usr/share/licenses/$pkgbase/
96   # Move python stuff
97   mkdir {bin,lib}
98   mv "${pkgdir}"/usr/bin/*py bin
99   mv "${pkgdir}"/usr/lib/python* lib
102 package_python-gdal () {
103   pkgdesc="Python bindings for GDAL"
104   depends=("gdal=$pkgver" 'python-numpy')
106   install -d "${pkgdir}"/usr/{bin,lib}
107   mv bin/* "${pkgdir}"/usr/bin
108   mv lib/* "${pkgdir}"/usr/lib
109   install -dm755 "${pkgdir}"/usr/share/licenses
110   ln -s $pkgbase "${pkgdir}"/usr/share/licenses/$pkgname
111   # byte-compile python modules since the CMake build does not do it.
112   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
113   python -m compileall -o 0 -o 1 -o 2 --hardlink-dupes -s "${pkgdir}" "${pkgdir}"${site_packages}