diff --git a/recipe/bld-basemap.bat b/recipe/bld-basemap.bat new file mode 100644 index 0000000..ef5d393 --- /dev/null +++ b/recipe/bld-basemap.bat @@ -0,0 +1,33 @@ +ECHO "====================================================================================================" +ECHO "Building %PKG_NAME%" +ECHO "" + +:: Ensure our geos will be used. +set GEOS_DIR=%LIBRARY_PREFIX% + +:: Jump to the correct build section +if "%PKG_NAME%"=="basemap" GOTO CASE_basemap +if "%PKG_NAME%"=="basemap-data" GOTO CASE_basemap_data +if "%PKG_NAME%"=="basemap-data-hires" GOTO CASE_basemap_data_hires + +ECHO "Unknown package: %PKG_NAME%" +EXIT 1 + + +:CASE_basemap + "%PYTHON%" -m pip install packages\basemap --no-deps --ignore-installed -vvv + IF errorlevel 1 EXIT 1 + GOTO CASE_end + +:CASE_basemap_data + "%PYTHON%" -m pip install packages\basemap_data --no-deps --ignore-installed -vvv + IF errorlevel 1 EXIT 1 + GOTO CASE_end + +:CASE_basemap_data_hires + "%PYTHON%" -m pip install packages\basemap_data_hires --no-deps --ignore-installed -vvv + IF errorlevel 1 EXIT 1 + GOTO CASE_end + + +:CASE_END diff --git a/recipe/bld.bat b/recipe/bld.bat deleted file mode 100644 index f2b99ea..0000000 --- a/recipe/bld.bat +++ /dev/null @@ -1,30 +0,0 @@ -:: Ensure our geos will be used. -set GEOS_DIR=%LIBRARY_PREFIX% -rmdir %SRC_DIR%\geos-3.3.3 /s /q || exit 1 -del src/_geoslib.c -cythonize --force src/_geoslib.pyx - -:: Installing via pip has some issues, use setuptools -:: "%PYTHON%" -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv -%PYTHON% setup.py install --single-version-externally-managed --record=record.txt -if errorlevel 1 exit 1 - -:: Remove the data from the site-packages directory. -rmdir %SP_DIR%\mpl_toolkits\basemap\data /s /q || exit 1 - -:: Create the data directory. -set DATADIR="%LIBRARY_PREFIX%\share\basemap" -mkdir %DATADIR% || exit 1 - -:: Copy all the data. -xcopy %SRC_DIR%\lib\mpl_toolkits\basemap\data\* %DATADIR% /s /e || exit 1 - -:: But remove the high resolution data. (Packaged separately.) -del %DATADIR%\*_i.dat -del %DATADIR%\*_h.dat -del %DATADIR%\*_f.dat -del %DATADIR%\UScounties.* -del %DATADIR%\test27 -del %DATADIR%\test83 -del %DATADIR%\testntv2 -del %DATADIR%\testvarious diff --git a/recipe/build-basemap.sh b/recipe/build-basemap.sh new file mode 100644 index 0000000..9c0cebd --- /dev/null +++ b/recipe/build-basemap.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +echo "====================================================================================================" +echo "Building $PKG_NAME" +echo "" + +export GEOS_DIR=$PREFIX + +case $PKG_NAME in + + basemap) + $PYTHON -m pip install packages/basemap --no-deps --ignore-installed -vvv + ;; + + basemap-data) + $PYTHON -m pip install packages/basemap_data --no-deps --ignore-installed -vvv + ;; + + basemap-data-hires) + $PYTHON -m pip install packages/basemap_data_hires --no-deps --ignore-installed -vvv + ;; + + *) + echo "No build instructions for $PKG_NAME" + exit 1 + ;; + +esac diff --git a/recipe/build.sh b/recipe/build.sh deleted file mode 100644 index 2b47866..0000000 --- a/recipe/build.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Ensure our geos will be used. -rm -rf $SRC_DIR/geos-3.3.3 -rm src/_geoslib.c -cythonize --force src/_geoslib.pyx - -export GEOS_DIR=$PREFIX - -$PYTHON -m pip install . --no-deps --ignore-installed -vvv - -# Remove the data from the site-packages directory. -rm -rf $SP_DIR/mpl_toolkits/basemap/data - -# Create the data directory. -DATADIR="$PREFIX/share/basemap" - -# Copy all the data. -cp -a $SRC_DIR/lib/mpl_toolkits/basemap/data/ $DATADIR - -# But remove the high resolution data. (Packaged separately.) -rm -f $DATADIR/*_i.dat -rm -f $DATADIR/*_h.dat -rm -f $DATADIR/*_f.dat -rm -f $DATADIR/UScounties.* -rm -f $DATADIR/{test27,testvarious,test83,testntv2} diff --git a/recipe/data.patch b/recipe/data.patch deleted file mode 100644 index 194c09e..0000000 --- a/recipe/data.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- basemap-1.2.1rel.orig/lib/mpl_toolkits/basemap/__init__.py 2019-08-07 22:03:01.000000000 -0300 -+++ basemap-1.2.1rel/lib/mpl_toolkits/basemap/__init__.py 2019-08-08 11:15:02.145868394 -0300 -@@ -53,15 +53,10 @@ - import _geoslib - import functools - --# basemap data files now installed in lib/matplotlib/toolkits/basemap/data --# check to see if environment variable BASEMAPDATA set to a directory, --# and if so look for the data there. --if 'BASEMAPDATA' in os.environ: -- basemap_datadir = os.environ['BASEMAPDATA'] -- if not os.path.isdir(basemap_datadir): -- raise RuntimeError('Path in environment BASEMAPDATA not a directory') -+if os.name == 'nt': -+ basemap_datadir = os.path.join(sys.prefix, 'Library', 'share', 'basemap') - else: -- basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data']) -+ basemap_datadir = os.path.join(sys.prefix, 'share', 'basemap') - - __version__ = '1.2.1' - -@@ -154,7 +149,8 @@ - } - - # create dictionary that maps epsg codes to Basemap kwargs. --epsgf = open(os.path.join(basemap_datadir, 'epsg')) -+pyproj_datadir = os.environ['PROJ_LIB'] -+epsgf = open(os.path.join(basemap_datadir,'epsg')) - epsg_dict={} - for line in epsgf: - if line.startswith("#"): -@@ -1222,11 +1218,12 @@ - read boundary data, clip to map projection region. - """ - msg = dedent(""" -- Unable to open boundary dataset file. Only the 'crude', 'low', -- 'intermediate' and 'high' resolution datasets are installed by default. -- If you are requesting a 'full' resolution dataset, you may need to -- download and install those files separately -- (see the basemap README for details).""") -+ Unable to open boundary dataset file. Only the 'crude' and 'low', -+ resolution datasets are installed by default. -+ If you are requesting an, 'intermediate', 'high' or 'full' -+ resolution dataset, you may need to download and install those -+ files separately with -+ `conda install basemap-data-hires`.""") - # only gshhs coastlines can be polygons. - if name != 'gshhs': as_polygons=False - try: -@@ -1981,6 +1978,11 @@ - """ - ax = ax or self._check_ax() - gis_file = os.path.join(basemap_datadir,'UScounties') -+ if not os.path.isfile(gis_file + '.shp'): -+ msg = ('Cannot find {}.shp\nYou can install it with' -+ '`conda install basemap-data-hires`').format -+ raise IOError(msg(gis_file)) -+ ax = ax or self._check_ax() - county_info = self.readshapefile(gis_file,'counties',\ - default_encoding='latin-1',drawbounds=drawbounds) - counties = [coords for coords in self.counties] diff --git a/recipe/install_hires_instructions.patch b/recipe/install_hires_instructions.patch new file mode 100644 index 0000000..bccc824 --- /dev/null +++ b/recipe/install_hires_instructions.patch @@ -0,0 +1,13 @@ +diff -ru basemap-1.3.1.orig/packages/basemap/src/mpl_toolkits/basemap/__init__.py basemap-1.3.1/packages/basemap/src/mpl_toolkits/basemap/__init__.py +--- basemap-1.3.1.orig/packages/basemap/src/mpl_toolkits/basemap/__init__.py 2022-01-31 12:16:48.000000000 -0700 ++++ basemap-1.3.1/packages/basemap/src/mpl_toolkits/basemap/__init__.py 2022-02-08 11:22:55.000000000 -0700 +@@ -1226,7 +1226,8 @@ + Unable to open boundary dataset file. Only the 'crude', 'low' and + 'intermediate' resolution datasets are installed by default. If you + are requesting a 'high' or 'full' resolution dataset, you need to +- install the `basemap-data-hires` package.""") ++ install the `basemap-data-hires` package with ++ `conda install -c conda-forge basemap-data-hires`.""") + # only gshhs coastlines can be polygons. + if name != 'gshhs': as_polygons=False + try: diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8cf4df8..7abd6d3 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,71 +1,131 @@ -{% set version = "1.2.2" %} +{% set version = "1.3.1" %} +{% set build_number = "0" %} package: - name: basemap + name: basemap-split version: {{ version }} source: - url: https://github.com/matplotlib/basemap/archive/v{{ version }}rel.tar.gz - sha256: 7e6ee5d03b10168862cff82bfa819df8264c04f078eac4549a22dd2631696613 + url: https://github.com/matplotlib/basemap/archive/v{{ version }}.tar.gz + sha256: 8f4ed7d5736711ba2b413e5fe038d4349d35eb3f28cba836094b6cca5f0a634f patches: - - data.patch + # Update messages regarding installation of `basemap-data-hires`. + - install_hires_instructions.patch build: - number: 2 - # This package isn't included to the SOW Packages list - skip: True # [linux and s390x] - skip: True # [win and py2k] - ignore_run_exports: - - proj + number: {{ build_number }} + skip: True # [s390x] Missing dependencies. + skip: True # [win32] Missing dependencies in win32 arch and not expecting they will be updated. + skip: True # [py<38] Dependencies require 3.8+ requirements: build: - - {{ compiler('c') }} - - {{ compiler('cxx') }} - m2-patch # [win] - patch # [not win] - host: - - python - - cython - - geos - - numpy - - pip - - proj - - pyproj - - setuptools - - wheel - run: - - python - - {{ pin_compatible('numpy') }} - - geos - - matplotlib-base >=1.0.0,!=3.0.1 - - proj - - pyproj >=1.9.3 - - pyshp >=1.2.0 - - six -test: - imports: - - mpl_toolkits.basemap - requires: - - pip - commands: - - pip check - - python -c "from mpl_toolkits.basemap import Basemap" -about: - home: http://matplotlib.org/basemap - license: MIT - license_family: MIT - license_file: README.md - summary: 'Plot on map projections using matplotlib' - description: | - Basemap toolkit is a library for plotting 2D data on maps in Python. - It is similar in functionality to the matlab mapping toolbox, the IDL mapping facilities, GrADS, or the Generic Mapping Tools. - dev_url: https://github.com/matplotlib/basemap - doc_url: http://matplotlib.org/basemap/ - doc_source_url: https://github.com/matplotlib/basemap/blob/master/doc/index.rst +outputs: + + - name: basemap + script: build-basemap.sh # [not win] + script: bld-basemap.bat # [win] + build: + requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + host: + - python + - pip + - cython >=0.29,<3.1 + - numpy >=1.21 # [not ppc64le] + - numpy >=1.19 # [ppc64le] + - geos + - pyproj + - setuptools + - wheel + run: + - {{ pin_subpackage('basemap-data') }} + - python + - {{ pin_compatible('numpy') }} + - {{ pin_compatible('geos') }} + - matplotlib-base >=1.5,!=3.0.1 + - pyproj >=1.9.3,<3.4 + - pyshp >=1.2.0,<2.2 + - six >=1.10,<1.16 + test: + imports: + - mpl_toolkits.basemap + requires: + - pip + - {{ pin_subpackage('basemap-data') }} + commands: + - pip check + - python -c "from mpl_toolkits.basemap import Basemap" + about: + home: https://matplotlib.org/basemap + license: MIT + license_family: MIT + license_file: + - packages/basemap/LICENSE + summary: 'Plot on map projections using matplotlib' + description: | + Basemap toolkit is a library for plotting 2D data on maps in Python. + It is similar in functionality to the matlab mapping toolbox, the IDL mapping facilities, GrADS, or the Generic Mapping Tools. + dev_url: https://github.com/matplotlib/basemap + doc_url: https://matplotlib.org/basemap/ + doc_source_url: https://github.com/matplotlib/basemap/blob/v{{ version }}/packages/basemap/doc/index.rst + + - name: basemap-data + script: build-basemap.sh # [not win] + script: bld-basemap.bat # [win] + build: + noarch: python + requirements: + host: + - python + - pip + - setuptools + - wheel + run: + - python >=3.6 + about: + home: https://matplotlib.org/basemap + license: LGPL-3.0-or-later + license_family: LGPL + license_file: packages/basemap_data_hires/COPYING.LESSER + summary: Plot on map projections (with coastlines and political boundaries) using matplotlib. + dev_url: https://github.com/matplotlib/basemap + doc_url: https://matplotlib.org/basemap/ + doc_source_url: https://github.com/matplotlib/basemap/blob/v{{ version }}/packages/basemap/doc/index.rst + + - name: basemap-data-hires + script: build-basemap.sh # [not win] + script: bld-basemap.bat # [win] + build: + noarch: python + requirements: + host: + - python + - pip + - setuptools + - wheel + run: + - {{ pin_subpackage('basemap-data') }} + - python >=3.6 + about: + home: https://matplotlib.org/basemap + license: LGPL-3.0-or-later + license_family: LGPL + license_file: packages/basemap_data_hires/COPYING.LESSER + summary: Plot on map projections (with coastlines and political boundaries) using matplotlib. + dev_url: https://github.com/matplotlib/basemap + doc_url: https://matplotlib.org/basemap/ + doc_source_url: https://github.com/matplotlib/basemap/blob/v{{ version }}/packages/basemap/doc/index.rst + + extra: recipe-maintainers: + - molinav - ocefpaf diff --git a/recipe/use_proj_data.patch b/recipe/use_proj_data.patch deleted file mode 100644 index f919292..0000000 --- a/recipe/use_proj_data.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- basemap-1.1.0.orig/lib/mpl_toolkits/basemap/__init__.py 2017-05-04 17:53:42.000000000 -0300 -+++ basemap-1.1.0/lib/mpl_toolkits/basemap/__init__.py 2018-08-31 13:09:10.768728089 -0300 -@@ -154,7 +154,8 @@ - } - - # create dictionary that maps epsg codes to Basemap kwargs. --epsgf = open(os.path.join(basemap_datadir,'epsg')) -+pyproj_datadir = os.environ['PROJ_LIB'] -+epsgf = open(os.path.join(pyproj_datadir,'epsg')) - epsg_dict={} - for line in epsgf: - if line.startswith("#"):