Bundle proj7

This commit is contained in:
Sandro Mani 2021-03-23 01:43:39 +01:00
commit 6bc6965ca3
4 changed files with 211 additions and 4 deletions

View file

@ -7,7 +7,7 @@
Name: python-%{srcname}
Version: 0.19.0~rc1
%global Version 0.19.0rc1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Cartographic Python library with Matplotlib visualisations
License: LGPLv3
@ -15,12 +15,31 @@ URL: http://scitools.org.uk/cartopy/docs/latest/
Source0: %pypi_source %{Srcname} %{Version}
# Set location of Fedora-provided pre-existing data.
Source1: siteconfig.py
# Bundle proj 7, it does not build against proj-8 which dropped the deprecated API
%global proj_version 7.2.1
Source2: https://download.osgeo.org/proj/proj-%{proj_version}.tar.gz
Patch0: cartopy_bundle-proj.patch
# Might not go upstream in current form.
Patch0004: 0001-Increase-tolerance-for-new-FreeType.patch
BuildRequires: gcc-c++
BuildRequires: geos-devel >= 3.3.3
BuildRequires: proj-devel >= 4.9.0
#BuildRequires: proj-devel >= 4.9.0
# For bundled proj
BuildRequires: cmake
BuildRequires: curl-devel
BuildRequires: gmock-devel
BuildRequires: gtest-devel >= 1.8.0
BuildRequires: make
BuildRequires: libtiff-devel
BuildRequires: sqlite-devel
Provides: bundled(proj) = %{proj_version}
%global _description %{expand:
Cartopy is a Python package designed to make drawing maps for data analysis
@ -90,7 +109,7 @@ Data files for %{srcname}.
%prep
%autosetup -n %{Srcname}-%{Version} -p1
%autosetup -n %{Srcname}-%{Version} -p1 -a2
cp -a %SOURCE1 lib/cartopy/
# Remove bundled egg-info
@ -98,10 +117,27 @@ rm -rf %{srcname}.egg-info
%build
pushd proj-%{proj_version}
%cmake \
-DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF \
-DBUILD_PROJINFO=OFF -DBUILD_PROJSYNC=OFF \
-DBUILD_GIE=OFF -DBUILD_GEOD=OFF \
-DBUILD_CS2CS=OFF -DBUILD_CCT=OFF \
-DBUILD_PROJ=OFF
%cmake_build
make -C %{_vpath_builddir} DESTDIR=../dist install
popd
PROJ_VERSION="%{proj_version}" \
PROJ_INCLUDE_DIRS=$PWD/proj-%{proj_version}/dist/%{_includedir} \
PROJ_LIBRARIES=$PWD/proj-%{proj_version}/dist/%{_libdir}/libproj.a \
FORCE_CYTHON=1 %py3_build
%install
PROJ_VERSION="%{proj_version}" \
PROJ_INCLUDE_DIRS=$PWD/proj-%{proj_version}/dist/%{_includedir} \
PROJ_LIBRARIES=$PWD/proj-%{proj_version}/dist/%{_libdir}/libproj.a \
%py3_install
mkdir -p %{buildroot}%{_datadir}/cartopy/shapefiles/natural_earth/
@ -132,6 +168,9 @@ MPLBACKEND=Agg \
%changelog
* Tue Mar 23 2021 Sandro Mani <manisandro@gmail.com> - 0.19.0~rc1-2
- Bundle proj 7, as cartopy does not build against proj8
* Sat Mar 13 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.19.0~rc1-1
- Update to latest version (#1938248)