nixpkgs/pkgs/development/python-modules/python-mapnik/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

67 lines
1.3 KiB
Nix

{ lib, stdenv
, buildPythonPackage
, isPyPy
, python
, pkgs
, pillow
, pycairo
}:
let
boost = pkgs.boost.override {
enablePython = true;
inherit python;
};
mapnik = pkgs.mapnik.override {
inherit python boost;
};
in buildPythonPackage rec {
pname = "python-mapnik";
version = "unstable-2020-02-24";
src = pkgs.fetchFromGitHub {
owner = "mapnik";
repo = "python-mapnik";
rev = "7da019cf9eb12af8f8aa88b7d75789dfcd1e901b";
sha256 = "0snn7q7w1ab90311q8wgd1z64kw1svm5w831q0xd6glqhah86qc8";
};
disabled = isPyPy;
doCheck = false; # doesn't find needed test data files
preBuild = let
pythonVersion = with stdenv.lib.versions; "${major python.version}${minor python.version}";
in ''
export BOOST_PYTHON_LIB="boost_python${pythonVersion}"
export BOOST_THREAD_LIB="boost_thread"
export BOOST_SYSTEM_LIB="boost_system"
'';
nativeBuildInputs = [
mapnik # for mapnik_config
];
buildInputs = [
mapnik
boost
] ++ (with pkgs; [
cairo
harfbuzz
icu
libjpeg
libpng
libtiff
libwebp
proj
zlib
]);
propagatedBuildInputs = [ pillow pycairo ];
meta = with lib; {
description = "Python bindings for Mapnik";
homepage = "https://mapnik.org";
license = licenses.lgpl21;
};
}