Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.03 66 lines 1.3 kB view raw
1{ stdenv 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 = "3.0.16"; 22 23 src = pkgs.fetchFromGitHub { 24 owner = "mapnik"; 25 repo = "python-mapnik"; 26 rev = "v${version}"; 27 sha256 = "1gqs4kvmjawdgl80j0ab5r8y0va9kw0rvwix3093xsv4hwd00lcc"; 28 }; 29 30 disabled = isPyPy; 31 doCheck = false; # doesn't find needed test data files 32 preBuild = let 33 pythonVersion = with stdenv.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 ''; 39 40 nativeBuildInputs = [ 41 mapnik # for mapnik_config 42 ]; 43 44 buildInputs = [ 45 mapnik 46 boost 47 ] ++ (with pkgs; [ 48 cairo 49 harfbuzz 50 icu 51 libjpeg 52 libpng 53 libtiff 54 libwebp 55 proj 56 zlib 57 ]); 58 propagatedBuildInputs = [ pillow pycairo ]; 59 60 meta = with stdenv.lib; { 61 description = "Python bindings for Mapnik"; 62 homepage = https://mapnik.org; 63 license = licenses.lgpl21; 64 }; 65 66}