1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, fetchpatch 5, cmake 6, libosmium 7, protozero 8, boost 9, expat 10, bzip2 11, zlib 12, pybind11 13, shapely 14, pythonOlder 15, isPyPy 16, lz4 17, requests 18, pytestCheckHook 19}: 20 21buildPythonPackage rec { 22 pname = "pyosmium"; 23 version = "3.6.0"; 24 format = "setuptools"; 25 26 disabled = pythonOlder "3.6" || isPyPy; 27 28 src = fetchFromGitHub { 29 owner = "osmcode"; 30 repo = pname; 31 rev = "refs/tags/v${version}"; 32 hash = "sha256-+YJQGPQm2FGOPhNzlXX2GM+ad4QdipJhwViOKGHtqBk="; 33 }; 34 35 patches = [ 36 # Compatibility with recent pybind versions 37 (fetchpatch { 38 url = "https://github.com/osmcode/pyosmium/commit/31b1363389b423f49e14140ce868ecac83e92f69.patch"; 39 hash = "sha256-maBuwzyZ4/wVLLGVr4gZFZDKvJckUXiBluxZRPGETag="; 40 }) 41 ]; 42 43 nativeBuildInputs = [ 44 cmake 45 ]; 46 47 buildInputs = [ 48 libosmium 49 protozero 50 boost 51 expat 52 bzip2 53 zlib 54 pybind11 55 lz4 56 ]; 57 58 propagatedBuildInputs = [ 59 requests 60 ]; 61 62 preBuild = "cd .."; 63 64 nativeCheckInputs = [ 65 pytestCheckHook 66 shapely 67 ]; 68 69 meta = with lib; { 70 description = "Python bindings for libosmium"; 71 homepage = "https://osmcode.org/pyosmium"; 72 changelog = "https://github.com/osmcode/pyosmium/blob/v${version}/CHANGELOG.md"; 73 license = licenses.bsd2; 74 maintainers = with maintainers; [ sikmir ]; 75 }; 76}