From 750ff65be4f2b879529f1848c3ac50841d00d872 Mon Sep 17 00:00:00 2001 From: Krul Ceter Date: Sun, 30 Oct 2022 05:35:32 +0300 Subject: [PATCH] libgdal: update to 3.5.3. --- common/shlibs | 2 +- srcpkgs/libgdal-python3 | 1 + srcpkgs/libgdal/patches/10-atoll.patch | 34 +++++++++++ .../patches/20-userfaultfd-detection.patch | 13 +++++ srcpkgs/libgdal/patches/30-license.patch | 13 +++++ .../libgdal/patches/40-fix-setup-py-cc.patch | 19 +++++++ ...e16e27c5fc4c491debe50bf2b7f3e94ed334.patch | 53 ----------------- ...c4893e6d14d488dfed25745d79f11bee45b9.patch | 31 ---------- srcpkgs/libgdal/patches/missing-include.patch | 12 ---- srcpkgs/libgdal/template | 57 +++++++++++++------ srcpkgs/libgdal/update | 2 +- 11 files changed, 122 insertions(+), 115 deletions(-) create mode 120000 srcpkgs/libgdal-python3 create mode 100644 srcpkgs/libgdal/patches/10-atoll.patch create mode 100644 srcpkgs/libgdal/patches/20-userfaultfd-detection.patch create mode 100644 srcpkgs/libgdal/patches/30-license.patch create mode 100644 srcpkgs/libgdal/patches/40-fix-setup-py-cc.patch delete mode 100644 srcpkgs/libgdal/patches/9ef8e16e27c5fc4c491debe50bf2b7f3e94ed334.patch delete mode 100644 srcpkgs/libgdal/patches/ab72c4893e6d14d488dfed25745d79f11bee45b9.patch delete mode 100644 srcpkgs/libgdal/patches/missing-include.patch diff --git a/common/shlibs b/common/shlibs index a350b6d0bb7..5157aca6f91 100644 --- a/common/shlibs +++ b/common/shlibs @@ -2510,7 +2510,7 @@ libu2f-host.so.0 libu2f-host-1.1.10_5 libu2f-server.so.0 libu2f-server-1.1.0_9 libsqlcipher.so.0 sqlcipher-4.3.0_3 libgta.so.1 libgta-1.2.0_1 -libgdal.so.26 libgdal-3.0.4_9 +libgdal.so.31 libgdal-3.5.3_1 libosgViewer.so.131 osg-3.4.1_1 libosgShadow.so.131 osg-3.4.1_1 libosgParticle.so.131 osg-3.4.1_1 diff --git a/srcpkgs/libgdal-python3 b/srcpkgs/libgdal-python3 new file mode 120000 index 00000000000..377d50dfc2b --- /dev/null +++ b/srcpkgs/libgdal-python3 @@ -0,0 +1 @@ +libgdal \ No newline at end of file diff --git a/srcpkgs/libgdal/patches/10-atoll.patch b/srcpkgs/libgdal/patches/10-atoll.patch new file mode 100644 index 00000000000..a114098612c --- /dev/null +++ b/srcpkgs/libgdal/patches/10-atoll.patch @@ -0,0 +1,34 @@ +Author: Holger Jaekel +Summary: musl atoll() doesn't return ERANGE in case of overflow +---- + +--- a/port/cpl_conv.cpp ++++ b/port/cpl_conv.cpp +@@ -1011,8 +1011,6 @@ + #endif + } + +-#if defined(__MINGW32__) || defined(__sun__) +- + // mingw atoll() doesn't return ERANGE in case of overflow + static int CPLAtoGIntBigExHasOverflow(const char* pszString, GIntBig nVal) + { +@@ -1035,8 +1033,6 @@ + return strcmp(szBuffer, pszString) != 0; + } + +-#endif +- + /************************************************************************/ + /* CPLAtoGIntBigEx() */ + /************************************************************************/ +@@ -1065,9 +1061,7 @@ + GIntBig nVal = atol(pszString); + #endif + if( errno == ERANGE +-#if defined(__MINGW32__) || defined(__sun__) + || CPLAtoGIntBigExHasOverflow(pszString, nVal) +-#endif + ) + { + if( pbOverflow ) diff --git a/srcpkgs/libgdal/patches/20-userfaultfd-detection.patch b/srcpkgs/libgdal/patches/20-userfaultfd-detection.patch new file mode 100644 index 00000000000..1496581453b --- /dev/null +++ b/srcpkgs/libgdal/patches/20-userfaultfd-detection.patch @@ -0,0 +1,13 @@ +userfaultfd is disabled in musl + +--- a/cmake/helpers/configure.cmake ++++ b/cmake/helpers/configure.cmake +@@ -337,8 +337,6 @@ + set(DONT_DEPRECATE_SPRINTF 1) + add_definitions(-DDONT_DEPRECATE_SPRINTF) + endif () +- +- check_include_file("linux/userfaultfd.h" HAVE_USERFAULTFD_H) + endif () + + if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") diff --git a/srcpkgs/libgdal/patches/30-license.patch b/srcpkgs/libgdal/patches/30-license.patch new file mode 100644 index 00000000000..5c310c8c8e8 --- /dev/null +++ b/srcpkgs/libgdal/patches/30-license.patch @@ -0,0 +1,13 @@ +LICENSE.txt is placed separately to /usr/share/licenses. +There is no need to duplicate it to /usr/share. + +--- a/gdal.cmake ++++ b/gdal.cmake +@@ -576,7 +576,6 @@ + PROPERTY PUBLIC_HEADER ${CMAKE_CURRENT_BINARY_DIR}/port/cpl_config.h) + + set(GDAL_DATA_FILES +- LICENSE.TXT + data/GDALLogoBW.svg + data/GDALLogoColor.svg + data/GDALLogoGS.svg diff --git a/srcpkgs/libgdal/patches/40-fix-setup-py-cc.patch b/srcpkgs/libgdal/patches/40-fix-setup-py-cc.patch new file mode 100644 index 00000000000..cc9078d9a50 --- /dev/null +++ b/srcpkgs/libgdal/patches/40-fix-setup-py-cc.patch @@ -0,0 +1,19 @@ +--- a/swig/python/setup.py.in ++++ b/swig/python/setup.py.in +@@ -29,14 +29,12 @@ + if os.environ['CXX'].strip().startswith('ccache ') and os.environ['CXX'].strip()[len('ccache '):].find(' ') < 0: + os.environ['CXX'] = os.environ['CXX'].strip()[len('ccache '):] + else: +- print('WARNING: "CXX=%s" was defined in the environment and contains more than one word. Unsetting it since that is incompatible of setuptools' % os.environ['CXX']) +- del os.environ['CXX'] ++ os.environ['CXX'] = os.environ['CXX'].split(' ', 1)[0] + if 'CC' in os.environ and os.environ['CC'].strip().find(' ') >= 0: + if os.environ['CC'].strip().startswith('ccache ') and os.environ['CC'].strip()[len('ccache '):].find(' ') < 0: + os.environ['CC'] = os.environ['CC'].strip()[len('ccache '):] + else: +- print('WARNING: "CC=%s" was defined in the environment and contains more than one word. Unsetting it since that is incompatible of setuptools' % os.environ['CC']) +- del os.environ['CC'] ++ os.environ['CC'] = os.environ['CC'].split(' ', 1)[0] + + # --------------------------------------------------------------------------- + # Switches diff --git a/srcpkgs/libgdal/patches/9ef8e16e27c5fc4c491debe50bf2b7f3e94ed334.patch b/srcpkgs/libgdal/patches/9ef8e16e27c5fc4c491debe50bf2b7f3e94ed334.patch deleted file mode 100644 index 968edeb32c7..00000000000 --- a/srcpkgs/libgdal/patches/9ef8e16e27c5fc4c491debe50bf2b7f3e94ed334.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 9ef8e16e27c5fc4c491debe50bf2b7f3e94ed334 Mon Sep 17 00:00:00 2001 -From: Even Rouault -Date: Mon, 5 Oct 2020 12:11:52 +0200 -Subject: [PATCH] JPEG2000: make it build with Jasper 2.0.21 (fixes #3012) - ---- - gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp | 16 +++++++++------- - gdal/frmts/jpeg2000/jpeg2000dataset.cpp | 2 +- - 2 files changed, 10 insertions(+), 8 deletions(-) - -diff --git a/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp b/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp -index 10a4f96f0ee..ebcac4010ce 100644 ---- a/frmts/jpeg2000/jpeg2000_vsil_io.cpp -+++ b/frmts/jpeg2000/jpeg2000_vsil_io.cpp -@@ -94,13 +94,24 @@ - * File stream object. - \******************************************************************************/ - -+#if defined(PRIjas_seqent) -+static int JPEG2000_VSIL_read(jas_stream_obj_t *obj, char *buf, unsigned cnt) -+#else - static int JPEG2000_VSIL_read(jas_stream_obj_t *obj, char *buf, int cnt) -+#endif - { - jas_stream_VSIFL_t *fileobj = JAS_CAST(jas_stream_VSIFL_t *, obj); - return static_cast(VSIFReadL(buf, 1, cnt, fileobj->fp)); - } - -+#if defined(JAS_INCLUDE_JP2_CODEC) -+// Jasper 2.0.21 -+static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, const char *buf, unsigned int cnt) -+#elif defined(PRIjas_seqent) -+static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, char *buf, unsigned int cnt) -+#else - static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, char *buf, int cnt) -+#endif - { - jas_stream_VSIFL_t *fileobj = JAS_CAST(jas_stream_VSIFL_t *, obj); - return static_cast(VSIFWriteL(buf, 1, cnt, fileobj->fp)); - -diff --git a/gdal/frmts/jpeg2000/jpeg2000dataset.cpp b/gdal/frmts/jpeg2000/jpeg2000dataset.cpp -index a5a6b258ed9..bd1e7763186 100644 ---- a/frmts/jpeg2000/jpeg2000dataset.cpp -+++ b/frmts/jpeg2000/jpeg2000dataset.cpp -@@ -513,7 +513,7 @@ int JPEG2000Dataset::DecodeImage() - for ( iBand = 0; iBand < nBands; iBand++ ) - { - JPEG2000RasterBand* poBand = (JPEG2000RasterBand*) GetRasterBand(iBand+1); -- if (poBand->iDepth != jas_image_cmptprec( psImage, iBand ) || -+ if (poBand->iDepth != static_cast(jas_image_cmptprec( psImage, iBand )) || - poBand->bSignedness != jas_image_cmptsgnd( psImage, iBand )) - { - CPLError(CE_Failure, CPLE_AppDefined, diff --git a/srcpkgs/libgdal/patches/ab72c4893e6d14d488dfed25745d79f11bee45b9.patch b/srcpkgs/libgdal/patches/ab72c4893e6d14d488dfed25745d79f11bee45b9.patch deleted file mode 100644 index 643eac882f6..00000000000 --- a/srcpkgs/libgdal/patches/ab72c4893e6d14d488dfed25745d79f11bee45b9.patch +++ /dev/null @@ -1,31 +0,0 @@ -From ab72c4893e6d14d488dfed25745d79f11bee45b9 Mon Sep 17 00:00:00 2001 -From: Even Rouault -Date: Mon, 10 Aug 2020 17:26:53 +0200 -Subject: [PATCH] JPEG2000: fix build with Jasper 2.0.17 (fixes #2844) - ---- - gdal/frmts/jpeg2000/jpeg2000dataset.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gdal/frmts/jpeg2000/jpeg2000dataset.cpp b/gdal/frmts/jpeg2000/jpeg2000dataset.cpp -index 3e668ffe503..2d3f4e46876 100644 ---- a/frmts/jpeg2000/jpeg2000dataset.cpp -+++ b/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(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; diff --git a/srcpkgs/libgdal/patches/missing-include.patch b/srcpkgs/libgdal/patches/missing-include.patch deleted file mode 100644 index 71d19440683..00000000000 --- a/srcpkgs/libgdal/patches/missing-include.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: gdal-3.0.4/ogr/ogrsf_frmts/cad/libopencad/dwg/r2000.cpp -=================================================================== ---- gdal-3.0.4.orig/ogr/ogrsf_frmts/cad/libopencad/dwg/r2000.cpp -+++ gdal-3.0.4/ogr/ogrsf_frmts/cad/libopencad/dwg/r2000.cpp -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - #include - #include - diff --git a/srcpkgs/libgdal/template b/srcpkgs/libgdal/template index ce58be57dc8..f10280ce4f5 100644 --- a/srcpkgs/libgdal/template +++ b/srcpkgs/libgdal/template @@ -1,29 +1,41 @@ # Template file for 'libgdal' pkgname=libgdal -version=3.0.4 -revision=12 +version=3.5.3 +revision=1 wrksrc="gdal-${version}" -build_style=gnu-configure -configure_args="--with-liblzma --with-webp --with-zstd --with-podofo --with-opencl=yes" -hostmakedepends="gettext-devel pkg-config python-numpy json-c-devel" -makedepends="freexl-devel geos-devel jasper-devel json-c-devel - libcurl-devel libopenexr-devel libopenjpeg2-devel libpodofo-devel libqhull-devel - libwebp-devel libxml2-devel libzstd-devel netcdf-devel opencl2-headers pcre2-devel - proj-devel sqlite-devel ocl-icd-devel" +build_style=cmake +build_helper=python3 +configure_args="-DGDAL_USE_OPENCL=ON + -DPython_NumPy_INCLUDE_DIR=/${py3_sitelib}/numpy/core/include/numpy" +hostmakedepends="pkg-config bison swig python3-numpy" +makedepends="python3-devel freexl-devel c-blosc-devel geos-devel expat-devel + jasper-devel giflib-devel json-c-devel libcurl-devel libopenexr-devel + libjpeg-turbo-devel libpng-devel tiff-devel libqhull-devel libwebp-devel + libxml2-devel liblzma-devel zlib-devel libzstd-devel libdeflate-devel + netcdf-devel opencl2-headers pcre2-devel proj-devel sqlite-devel + ocl-icd-devel libxerces-c-devel libspatialite-devel + postgresql-libs-devel" +checkdepends="python3-pytest" short_desc="Geospatial Data Abstraction Library" maintainer="Orphaned " license="MIT" -homepage="http://www.gdal.org/" -distfiles="http://download.osgeo.org/gdal/${version}/gdal-${version}.tar.xz" -checksum=5569a4daa1abcbba47a9d535172fc335194d9214fdb96cd0f139bb57329ae277 -subpackages="libgdal-devel libgdal-tools" +homepage="https://www.gdal.org" +changelog="https://github.com/OSGeo/gdal/raw/v${version}/NEWS.md" +distfiles="https://download.osgeo.org/gdal/${version}/gdal-${version}.tar.xz" +checksum=d32223ddf145aafbbaec5ccfa5dbc164147fb3348a3413057f9b1600bb5b3890 +subpackages="libgdal-devel libgdal-tools libgdal-python3" +python_version=3 if [ -z "$CROSS_BUILD" ]; then - makedepends+=" hdf5-devel" + makedepends+=" hdf5-devel armadillo-devel" +fi + +# "error: static assertion failed: OFF_T should be 64 bits !" +if [ "$XBPS_TARGET_WORDSIZE" = "64" ]; then + makedepends+=" cfitsio-devel" fi post_install() { - vinstall gdal.pc 644 usr/lib/pkgconfig vlicense LICENSE.TXT } @@ -31,6 +43,8 @@ libgdal-tools_package() { depends="${sourcepkg}>=${version}_${revision}" short_desc+=" - tools" pkg_install() { + vmove usr/share/man/man1 + vmove usr/share/bash-completion vmove usr/bin } } @@ -40,9 +54,18 @@ libgdal-devel_package() { short_desc+=" - development files" pkg_install() { vmove usr/bin/gdal-config + vmove usr/share/man/man1/gdal-config.1 vmove usr/include vmove usr/lib/pkgconfig - vmove usr/lib/*.a - vmove usr/lib/*.so + vmove usr/lib/cmake + vmove "usr/lib/*.so" + } +} + +libgdal-python3_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - python3 bindings" + pkg_install() { + vmove ${py3_sitelib} } } diff --git a/srcpkgs/libgdal/update b/srcpkgs/libgdal/update index 489f765d437..64898fa33ad 100644 --- a/srcpkgs/libgdal/update +++ b/srcpkgs/libgdal/update @@ -1,2 +1,2 @@ -site=http://trac.osgeo.org/gdal/wiki/DownloadSource +site=https://download.osgeo.org/gdal pattern='gdal-\K[\d]+\.[\d]+\.[\d]+'