2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2018-10-29 17:23:44 +00:00
|
|
|
, buildPythonPackage
|
2019-04-27 23:25:33 +01:00
|
|
|
, fetchFromGitHub
|
2021-04-11 16:28:33 +01:00
|
|
|
, pythonAtLeast
|
2022-07-16 11:58:59 +01:00
|
|
|
, basemap-data
|
|
|
|
, cython
|
|
|
|
, geos
|
2018-10-29 17:23:44 +00:00
|
|
|
, numpy
|
|
|
|
, matplotlib
|
|
|
|
, pillow
|
2019-04-27 23:25:33 +01:00
|
|
|
, pyproj
|
|
|
|
, pyshp
|
2022-07-16 11:58:59 +01:00
|
|
|
, python
|
|
|
|
, setuptools
|
2018-10-29 17:23:44 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "basemap";
|
2022-07-16 11:58:59 +01:00
|
|
|
version = "1.3.3";
|
2018-10-29 17:23:44 +00:00
|
|
|
|
2019-04-27 23:25:33 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "matplotlib";
|
|
|
|
repo = "basemap";
|
2022-07-16 11:58:59 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "sha256-ObRQ5GsYx3k7fLaaK5Z4Td54rW/Nnx5+2zm8KLCIZl8=";
|
2018-10-29 17:23:44 +00:00
|
|
|
};
|
|
|
|
|
2022-07-16 11:58:59 +01:00
|
|
|
sourceRoot = "source/packages/basemap";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace "numpy >= 1.21, < 1.23" "numpy >= 1.21, < 1.24" \
|
|
|
|
--replace "pyshp >= 1.2, < 2.2" "pyshp >= 1.2, < 2.4"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
geos
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
basemap-data
|
|
|
|
numpy
|
|
|
|
matplotlib
|
|
|
|
pillow # undocumented optional dependency
|
|
|
|
pyproj
|
|
|
|
pyshp
|
|
|
|
];
|
2018-10-29 17:23:44 +00:00
|
|
|
|
|
|
|
# Standard configurePhase from `buildPythonPackage` seems to break the setup.py script
|
2022-07-16 11:58:59 +01:00
|
|
|
preBuild = ''
|
|
|
|
export GEOS_DIR=${geos}
|
2018-10-29 17:23:44 +00:00
|
|
|
'';
|
|
|
|
|
2022-07-16 11:58:59 +01:00
|
|
|
# test have various problems including requiring internet connection, permissions issues, problems with latest version of pillow
|
2018-10-29 17:23:44 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2022-07-16 11:58:59 +01:00
|
|
|
checkPhase = ''
|
|
|
|
cd ../../examples
|
|
|
|
export HOME=$TEMPDIR
|
|
|
|
${python.interpreter} run_all.py
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-10-29 17:23:44 +00:00
|
|
|
homepage = "https://matplotlib.org/basemap/";
|
|
|
|
description = "Plot data on map projections with matplotlib";
|
|
|
|
longDescription = ''
|
|
|
|
An add-on toolkit for matplotlib that lets you plot data on map projections with
|
|
|
|
coastlines, lakes, rivers and political boundaries. See
|
|
|
|
http://matplotlib.github.com/basemap/users/examples.html for examples of what it can do.
|
|
|
|
'';
|
2022-07-16 11:58:59 +01:00
|
|
|
maintainers = with maintainers; [ ];
|
|
|
|
license = with licenses; [ mit lgpl21 ];
|
2018-10-29 17:23:44 +00:00
|
|
|
};
|
|
|
|
}
|