summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Kuster2020-10-08 12:53:50 -0700
committerOliver Kuster2020-10-08 12:58:20 -0700
commit035f1f57d025b8a0b8b313d1645e151aefcb28e6 (patch)
tree88738772871f5773b6642fa583e67c2767a0e252
downloadaur-035f1f57d025b8a0b8b313d1645e151aefcb28e6.tar.gz
Initial commit
-rw-r--r--.SRCINFO58
-rw-r--r--PKGBUILD105
-rw-r--r--gdal-ecw.changelog0
-rw-r--r--jpeg2000-issue-vendor.patch49
4 files changed, 212 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..511b50071415
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,58 @@
+pkgbase = gdal-ecw
+ pkgdesc = A translator library for raster geospatial data formats, with support to ECW format. Based on gdal-hdf4 AUR package.
+ pkgver = 3.0.4
+ pkgrel = 1.0
+ url = http://www.gdal.org/
+ changelog = gdal-ecw.changelog
+ arch = x86_64
+ license = custom
+ makedepends = perl
+ makedepends = swig
+ makedepends = chrpath
+ makedepends = doxygen
+ makedepends = python-numpy
+ makedepends = boost
+ depends = curl
+ depends = geos
+ depends = giflib
+ depends = hdf5
+ depends = libgeotiff
+ depends = libjpeg-turbo
+ depends = libpng
+ depends = libspatialite
+ depends = libtiff
+ depends = netcdf
+ depends = openjpeg2
+ depends = poppler
+ depends = cfitsio
+ depends = sqlite
+ depends = mariadb-libs
+ depends = postgresql-libs
+ depends = xerces-c
+ depends = json-c
+ depends = libecwj2
+ optdepends = postgresql: postgresql database support
+ optdepends = mariadb: mariadb database support
+ optdepends = perl: perl binding support
+ provides = gdal
+ conflicts = gdal
+ options = !emptydirs
+ source = https://download.osgeo.org/gdal/3.0.4/gdal-3.0.4.tar.xz
+ source = poppler-20.08.0.patch::https://git.archlinux.org/svntogit/community.git/plain/trunk/poppler-20.08.0.patch?h=packages/gdal
+ source = gdal-perl-vendor.patch::https://git.archlinux.org/svntogit/community.git/plain/trunk/gdal-perl-vendor.patch?h=packages/gdal
+ source = jpeg2000-issue-vendor.patch
+ sha256sums = 5569a4daa1abcbba47a9d535172fc335194d9214fdb96cd0f139bb57329ae277
+ sha256sums = dc8ccbc9a672a8489a1660fa66804d74c3015c47b44e2d41e17f8609249279df
+ sha256sums = 2103b98f2f15954f042d5620658b30d703125927bde2e5eb671c5facb6c2f5ed
+ sha256sums = 021190817ae924f08d252be5a9c441f555a2000e61fc6fbbd5386273c2646aba
+
+pkgname = gdal-ecw
+
+pkgname = python-gdal-ecw
+ pkgdesc = Python bindings for GDAL, with support to ECW format
+ depends = gdal-ecw=3.0.4
+ depends = python-numpy
+ optdepends =
+ provides = python-gdal
+ conflicts = python-gdal
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d12b4a49ccf9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,105 @@
+# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
+# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org
+# Contributor: William Rea <sillywilly@gmail.com>
+# Contributor: Luigi Ranghetti <ggranga@gmail.com>
+# Contributor: Oliver Kuster <olivervbk@gmail.com>
+
+pkgbase=gdal-ecw
+_pkgbase=gdal
+provides=('gdal')
+conflicts=('gdal')
+pkgname=('gdal-ecw' 'python-gdal-ecw')
+pkgver=3.0.4
+pkgrel=1.0
+pkgdesc="A translator library for raster geospatial data formats, with support to ECW format. Based on gdal-hdf4 AUR package."
+arch=('x86_64')
+url="http://www.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'
+# needed for ecw support:
+'libecwj2' )
+
+makedepends=('perl' 'swig' 'chrpath' 'doxygen' 'python-numpy' '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-20.08.0.patch::https://git.archlinux.org/svntogit/community.git/plain/trunk/poppler-20.08.0.patch?h=packages/gdal
+ gdal-perl-vendor.patch::https://git.archlinux.org/svntogit/community.git/plain/trunk/gdal-perl-vendor.patch?h=packages/gdal
+ jpeg2000-issue-vendor.patch)
+sha256sums=('5569a4daa1abcbba47a9d535172fc335194d9214fdb96cd0f139bb57329ae277'
+ 'dc8ccbc9a672a8489a1660fa66804d74c3015c47b44e2d41e17f8609249279df'
+ '2103b98f2f15954f042d5620658b30d703125927bde2e5eb671c5facb6c2f5ed'
+ '021190817ae924f08d252be5a9c441f555a2000e61fc6fbbd5386273c2646aba')
+
+prepare() {
+ cd "${srcdir}"/$_pkgbase-$pkgver
+
+# Fix mandir
+ sed -i "s|^mandir=.*|mandir='\${prefix}/share/man'|" configure
+
+# Fix build with poppler 20.08.0
+ patch -Np2 -i "${srcdir}"/poppler-20.08.0.patch
+
+# Fix Perl bindings installation path
+ patch -Np0 -i "${srcdir}"/gdal-perl-vendor.patch
+
+# Fix compilation issues related to jpeg2000:
+# https://github.com/OSGeo/gdal/issues/2844
+ patch -Np2 -i "${srcdir}"/jpeg2000-issue-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 \
+ --with-ecw
+
+# 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 -j$(nproc)
+ make man
+
+ cd "${srcdir}"/$_pkgbase-$pkgver/swig/python
+ python3 setup.py build
+}
+
+package_gdal-ecw () {
+ 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-ecw () {
+ pkgdesc="Python bindings for GDAL, with support to ECW format"
+ provides=("python-gdal")
+ conflicts=("python-gdal")
+ depends=("gdal-ecw=$pkgver" 'python-numpy')
+ optdepends=()
+
+ cd "${srcdir}"/$_pkgbase-$pkgver/swig/python
+ python3 setup.py install --root="$pkgdir" --optimize=1
+ install -Dm755 -t "${pkgdir}"/usr/bin scripts/*.py
+
+ install -dm755 "${pkgdir}"/usr/share/licenses
+ ln -s $_pkgbase "${pkgdir}"/usr/share/licenses/$pkgname
+}
diff --git a/gdal-ecw.changelog b/gdal-ecw.changelog
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/gdal-ecw.changelog
diff --git a/jpeg2000-issue-vendor.patch b/jpeg2000-issue-vendor.patch
new file mode 100644
index 000000000000..1ab671341b45
--- /dev/null
+++ b/jpeg2000-issue-vendor.patch
@@ -0,0 +1,49 @@
+unchanged:
+--- a/gdal/frmts/jpeg2000/jpeg2000dataset.cpp
++++ b/gdal/frmts/jpeg2000/jpeg2000dataset.cpp
+@@ -484,7 +484,7 @@ int JPEG2000Dataset::DecodeImage()
+ /* the JP2 boxes match the ones of the code stream */
+ if (nBands != 0)
+ {
+- if (nBands != jas_image_numcmpts( psImage ))
++ if (nBands != static_cast<int>(jas_image_numcmpts( psImage )))
+ {
+ CPLError(CE_Failure, CPLE_AppDefined,
+ "The number of components indicated in the IHDR box (%d) mismatch "
+@@ -595,7 +595,7 @@ GDALDataset *JPEG2000Dataset::Open( GDALOpenInfo * poOpenInfo )
+
+ {
+ int iFormat;
+- char *pszFormatName = nullptr;
++ const char *pszFormatName = nullptr;
+
+ if (!Identify(poOpenInfo))
+ return nullptr;
+only in patch2:
+unchanged:
+--- a/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp
++++ b/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp
+@@ -94,13 +94,23 @@ typedef struct {
+ * File stream object.
+ \******************************************************************************/
+
++// PRIjas_seqent macro is defined since Jasper 2.0.17
++
++#ifndef PRIjas_seqent
+ static int JPEG2000_VSIL_read(jas_stream_obj_t *obj, char *buf, int cnt)
++#else
++static int JPEG2000_VSIL_read(jas_stream_obj_t *obj, char *buf, unsigned cnt)
++#endif
+ {
+ jas_stream_VSIFL_t *fileobj = JAS_CAST(jas_stream_VSIFL_t *, obj);
+ return static_cast<int>(VSIFReadL(buf, 1, cnt, fileobj->fp));
+ }
+
++#ifndef PRIjas_seqent
+ static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, char *buf, int cnt)
++#else
++static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, char *buf, unsigned int cnt)
++#endif
+ {
+ jas_stream_VSIFL_t *fileobj = JAS_CAST(jas_stream_VSIFL_t *, obj);
+ return static_cast<int>(VSIFWriteL(buf, 1, cnt, fileobj->fp));