Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.05 72 lines 1.4 kB view raw
1{ lib 2, buildPythonPackage 3, isPyPy 4, python 5, pkgs 6, pillow 7, pycairo 8}: 9 10let 11 boost = pkgs.boost.override { 12 enablePython = true; 13 inherit python; 14 }; 15 mapnik = pkgs.mapnik.override { 16 inherit python boost; 17 }; 18 19in buildPythonPackage rec { 20 pname = "python-mapnik"; 21 version = "unstable-2020-02-24"; 22 23 src = pkgs.fetchFromGitHub { 24 owner = "mapnik"; 25 repo = "python-mapnik"; 26 rev = "7da019cf9eb12af8f8aa88b7d75789dfcd1e901b"; 27 sha256 = "0snn7q7w1ab90311q8wgd1z64kw1svm5w831q0xd6glqhah86qc8"; 28 }; 29 30 disabled = isPyPy; 31 doCheck = false; # doesn't find needed test data files 32 preBuild = let 33 pythonVersion = with lib.versions; "${major python.version}${minor python.version}"; 34 in '' 35 export BOOST_PYTHON_LIB="boost_python${pythonVersion}" 36 export BOOST_THREAD_LIB="boost_thread" 37 export BOOST_SYSTEM_LIB="boost_system" 38 export PYCAIRO=true 39 ''; 40 41 nativeBuildInputs = [ 42 mapnik # for mapnik_config 43 pkgs.pkgconfig 44 ]; 45 46 patches = [ 47 ./find-pycairo-with-pkg-config.patch 48 ]; 49 50 buildInputs = [ 51 mapnik 52 boost 53 ] ++ (with pkgs; [ 54 cairo 55 harfbuzz 56 icu 57 libjpeg 58 libpng 59 libtiff 60 libwebp 61 proj 62 zlib 63 ]); 64 propagatedBuildInputs = [ pillow pycairo ]; 65 66 meta = with lib; { 67 description = "Python bindings for Mapnik"; 68 homepage = "https://mapnik.org"; 69 license = licenses.lgpl21; 70 }; 71 72}