SHA256
1
0
forked from pool/gdal

Accepting request 1038614 from home:bruno_friedmann:branches:Application:Geo

- Improve packaging
  + add proj for datum presence for tests
  + add cmake-full with tests_support (ctest)
  + add bison, shapelib,OpenEXR,armadillo,qhull,libz4,pcre2
    qhull,deflate are conditionnal(missing on Leap 15)
  + cmake force non use of internal, force use of external libs
    except lerc not packaged.
  + Exclude more tests (remote,out-of-memory)
  + keep opencl-headers as pkgconfig does'nt exist in Leap

OBS-URL: https://build.opensuse.org/request/show/1038614
OBS-URL: https://build.opensuse.org/package/show/Application:Geo/gdal?expand=0&rev=159
This commit is contained in:
Bruno Friedmann 2022-11-28 14:54:32 +00:00 committed by Git OBS Bridge
parent 43e34f8822
commit 33be439983
2 changed files with 59 additions and 11 deletions

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Sat Nov 26 19:19:19 UTC 2022 - Bruno Friedmann <bruno@ioda-net.ch>
- Improve packaging
+ add proj for datum presence for tests
+ add cmake-full with tests_support (ctest)
+ add bison, shapelib,OpenEXR,armadillo,qhull,libz4,pcre2
qhull,deflate are conditionnal(missing on Leap 15)
+ cmake force non use of internal, force use of external libs
except lerc not packaged.
+ Exclude more tests (remote,out-of-memory)
-------------------------------------------------------------------
Fri Nov 25 14:57:59 UTC 2022 - Guillaume GARDET <guillaume.gardet@opensuse.org>

View File

@ -27,6 +27,8 @@
%bcond_with sfcgal_support
%bcond_with hdf4_support
%bcond_with heif_support
%bcond_with qhull_support
%bcond_with deflate_support
%bcond_with tests_support
Name: gdal
Version: 3.6.0
@ -38,10 +40,14 @@ Source0: https://download.osgeo.org/%{name}/%{version}/%{sourcename}-%{ve
Source1: https://download.osgeo.org/%{name}/%{version}/%{sourcename}-%{version}.tar.xz.md5
Source2: https://download.osgeo.org/%{name}/%{version}/%{sourcename}autotest-%{version}.tar.gz
BuildRequires: KEALib-devel
BuildRequires: bash-completion
BuildRequires: bison
BuildRequires: blas-devel
BuildRequires: chrpath
%if %{with tests_support}
BuildRequires: cmake-full
%else
BuildRequires: cmake
%endif
BuildRequires: curl-devel
BuildRequires: dos2unix
BuildRequires: doxygen >= 1.4.2
@ -54,7 +60,7 @@ BuildRequires: lapack-devel
BuildRequires: libtool
BuildRequires: libzstd-devel
BuildRequires: mysql-devel
BuildRequires: opencl-headers
BuildRequires: pcre2-devel
BuildRequires: pkgconfig
BuildRequires: python3-numpy-devel
BuildRequires: python3-setuptools
@ -62,21 +68,28 @@ BuildRequires: python3-setuptools
BuildRequires: python-rpm-macros
%endif
%if %{with tests_support}
BuildRequires: proj
BuildRequires: python3-lxml
BuildRequires: python3-pytest
BuildRequires: python3-pytest-env
BuildRequires: python3-pytest-sugar
%endif
# This one is needed for Leap :-(
BuildRequires: opencl-headers
BuildRequires: shapelib
BuildRequires: swig
BuildRequires: unixODBC-devel
BuildRequires: pkgconfig(OpenCL)
BuildRequires: pkgconfig(OpenEXR)
BuildRequires: pkgconfig(armadillo)
BuildRequires: pkgconfig(bash-completion)
BuildRequires: pkgconfig(expat) >= 1.95.0
# BuildRequires: pkgconfig(armadillo)
BuildRequires: pkgconfig(freexl)
BuildRequires: pkgconfig(json)
BuildRequires: pkgconfig(json-c)
BuildRequires: pkgconfig(libgeotiff) >= 1.2.1
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(liblz4)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libopenjp2)
BuildRequires: pkgconfig(libpcrecpp)
@ -92,11 +105,14 @@ BuildRequires: pkgconfig(netcdf)
BuildRequires: pkgconfig(ocl-icd)
BuildRequires: pkgconfig(poppler)
BuildRequires: pkgconfig(proj)
#BuildRequires: pkgconfig(qhull_r)
BuildRequires: pkgconfig(shapelib)
BuildRequires: pkgconfig(spatialite)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(xerces-c)
BuildRequires: pkgconfig(zlib) >= 1.1.4
%if %{with deflate_support}
BuildRequires: libdeflate-devel
%endif
%if %{with fgdb_support}
BuildRequires: filegdb_api-devel
%endif
@ -112,6 +128,9 @@ BuildRequires: libheif-devel
%if %{with hdf4_support}
BuildRequires: hdf-devel
%endif
%if %{with qhull_support}
BuildRequires: pkgconfig(qhull_r)
%endif
%if %{with ecw5_support}
BuildRequires: ERDAS-ECW_JPEG_2000_SDK-devel
%else
@ -119,6 +138,7 @@ BuildRequires: ERDAS-ECW_JPEG_2000_SDK-devel
BuildRequires: libecwj2-devel
%endif
%endif
Requires: python3-GDAL = %{version}
%description
@ -195,11 +215,14 @@ find . -iname "*.py" -exec sed -i "s,^#!%{_bindir}/env python3,#!%{_bindir}/pyth
%build
%cmake \
-DGDAL_USE_INTERNAL_LIBS=OFF \
-DGDAL_USE_EXTERNAL_LIBS=ON \
-DSWIG_REGENERATE_PYTHON=OFF \
%if %{with ecw5_support}
-DECW_ROOT="../ECW/Desktop_Read-Only" \
%endif
-DCMAKE_INSTALL_INCLUDEDIR=include/gdal \
-DGDAL_USE_ARMADILLO=OFF \
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/gdal \
-DGDAL_USE_ARMADILLO=ON \
-DGDAL_USE_CFITSIO=OFF \
-DGDAL_USE_CURL=ON \
-DGDAL_USE_EXPAT=ON \
@ -217,8 +240,10 @@ find . -iname "*.py" -exec sed -i "s,^#!%{_bindir}/env python3,#!%{_bindir}/pyth
%else
-DGDAL_USE_HEIF=OFF \
%endif
-DGDAL_USE_LERC_INTERNAL=ON \
-DGDAL_USE_JPEG=ON \
-DGDAL_USE_JPEG12_INTERNAL=OFF \
-DGDAL_USE_JSONC=ON \
-DGDAL_USE_KEA=ON \
%if %{with kml_support}
-DGDAL_USE_LIBKML=ON \
@ -226,26 +251,37 @@ find . -iname "*.py" -exec sed -i "s,^#!%{_bindir}/env python3,#!%{_bindir}/pyth
-DGDAL_USE_LIBKML=OFF \
%endif
-DGDAL_USE_LIBLZMA=ON \
-DGDAL_USE_LIBXML2=ON \
-DGDAL_USE_MYSQL=ON \
-DGDAL_USE_NETCDF=ON \
-DGDAL_USE_ODBC=ON \
-DGDAL_USE_OGDI=OFF \
-DGDAL_USE_OPENCL=ON \
-DGDAL_USE_OPENJPEG=ON \
-DGDAL_USE_PCRE=ON \
-DGDAL_USE_PCRE2=OFF \
-DGDAL_USE_PCRE2=ON \
-DGDAL_USE_PNG=ON \
-DGDAL_USE_POPPLER=ON \
-DGDAL_USE_POSTGRESQL=ON \
%if %{with qhull_support}
-DGDAL_USE_QHULL=ON \
%else
-DGDAL_USE_QHULL=OFF \
%endif
%if %{with sfcgal_support}
-DGDAL_USE_SFCGAL=ON \
%else
-DGDAL_USE_SFCGAL=OFF \
%endif
-DGDAL_USE_SHAPELIB=OFF \
-DGDAL_USE_SPATIALITE=ON \
-DGDAL_USE_TIFF=ON \
-DGDAL_USE_WEBP=ON \
-DGDAL_USE_XERCESC=ON
-DGDAL_USE_XERCESC=ON \
-DGDAL_USE_ZLIB=ON \
-DGDAL_USE_ZSTD=ON \
-DOGR_BUILD_OPTIONAL_DRIVERS=ON
%cmake_build
%install
@ -254,13 +290,14 @@ find . -iname "*.py" -exec sed -i "s,^#!%{_bindir}/env python3,#!%{_bindir}/pyth
%if %{with tests_support}
%check
%ctest
pushd %{name}autotest-%{version}
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir}
export GDAL_DATA=%{buildroot}%{_datadir}/%{name}/
export PYTHONPATH=%{buildroot}%{python3_sitearch}/
export GDAL_DOWNLOAD_TEST_DATA=0
# Enable these tests on demand
#export GDAL_RUN_SLOW_TESTS=1
#export GDAL_DOWNLOAD_TEST_DATA=1
# Some tests are currently skipped:
# - `test_fits_vector` because it's crashing.
@ -279,8 +316,7 @@ pushd %{name}autotest-%{version}
# - `test_ndf_1` because it hangs on i686 and armv7hl
# FIXME: Tests hang on i686 and armv7hl
%ifnarch i686 armv7hl
pytest -k 'not test_fits_vector and not test_http and not test_jp2openjpeg_45 and not multithreaded_download and not multithreaded_upload and not test_vsis3_no_sign_request and not test_eedai_GOOGLE_APPLICATION_CREDENTIALS and not test_osr_erm_1 and not test_ers_4 and not test_ers_8 and not test_ers_10 and not test_jpeg2000_8 and not test_jpeg2000_11 and not test_osr_ct_options_area_of_interest and not test_ndf_1 and not test_cog_small_world_to_web_mercator and not test_bag'
#|| :
pytest -k 'not test_fits_vector and not test_http and not test_jp2openjpeg_45 and not multithreaded_download and not multithreaded_upload and not test_vsis3_no_sign_request and not test_eedai_GOOGLE_APPLICATION_CREDENTIALS and not test_osr_erm_1 and not test_ers_4 and not test_ers_8 and not test_ers_10 and not test_jpeg2000_8 and not test_jpeg2000_11 and not test_osr_ct_options_area_of_interest and not test_ndf_1 and not test_cog_small_world_to_web_mercator and not test_bag and not gpkg and not jp2openjpeg and not wms and not heif' || :
%endif
popd
%endif