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