1{ lib
2, buildPythonPackage
3, fetchPypi
4, python
5, nose2
6, proj ? null
7}:
8
9buildPythonPackage (rec {
10 pname = "pyproj";
11 version = "1.9.5.1";
12 name = "${pname}-${version}";
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "53fa54c8fa8a1dfcd6af4bf09ce1aae5d4d949da63b90570ac5ec849efaf3ea8";
17 };
18
19 buildInputs = [ nose2 ];
20
21 checkPhase = ''
22 runHook preCheck
23 pushd unittest # changing directory should ensure we're importing the global pyproj
24 ${python.interpreter} test.py && ${python.interpreter} -c "import doctest, pyproj, sys; sys.exit(doctest.testmod(pyproj)[0])"
25 popd
26 runHook postCheck
27 '';
28
29 meta = {
30 description = "Python interface to PROJ.4 library";
31 homepage = https://github.com/jswhit/pyproj;
32 license = with lib.licenses; [ isc ];
33 };
34} // (if proj == null then {} else { PROJ_DIR = proj; }))