1{ stdenv, buildPythonPackage, fetchPypi, substituteAll,
2 isPy3k,
3 geos, gdal, pytz,
4 withGdal ? false
5}:
6
7buildPythonPackage rec {
8 pname = "Django";
9 version = "2.1";
10
11 disabled = !isPy3k;
12
13 src = fetchPypi {
14 inherit pname version;
15 sha256 = "0dv184lgp7scq8cr4422rrvkd8npyiqww0zw50ygcim5smw6093z";
16 };
17
18 patches = stdenv.lib.optionals withGdal [
19 (substituteAll {
20 src = ./1.10-gis-libs.template.patch;
21 geos = geos;
22 gdal = gdal;
23 extension = stdenv.hostPlatform.extensions.sharedLibrary;
24 })
25 ];
26
27 # patch only $out/bin to avoid problems with starter templates (see #3134)
28 postFixup = ''
29 wrapPythonProgramsIn $out/bin "$out $pythonPath"
30 '';
31
32 propagatedBuildInputs = [ pytz ];
33
34 # too complicated to setup
35 doCheck = false;
36
37 meta = with stdenv.lib; {
38 description = "A high-level Python Web framework";
39 homepage = https://www.djangoproject.com/;
40 license = licenses.bsd3;
41 maintainers = with maintainers; [ georgewhewell ];
42 };
43}