2022-02-10 20:34:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pythonOlder
|
|
|
|
, substituteAll
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
# build
|
|
|
|
, setuptools
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
# patched in
|
2022-08-12 12:06:08 +00:00
|
|
|
, fetchpatch
|
2022-02-10 20:34:41 +00:00
|
|
|
, geos
|
|
|
|
, gdal
|
|
|
|
, withGdal ? false
|
|
|
|
|
|
|
|
# propagated
|
|
|
|
, asgiref
|
|
|
|
, backports-zoneinfo
|
|
|
|
, sqlparse
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, aiosmtpd
|
2022-05-18 14:49:53 +00:00
|
|
|
, argon2-cffi
|
2022-02-10 20:34:41 +00:00
|
|
|
, bcrypt
|
|
|
|
, docutils
|
|
|
|
, geoip2
|
|
|
|
, jinja2
|
2022-05-18 14:49:53 +00:00
|
|
|
, python-memcached
|
2022-02-10 20:34:41 +00:00
|
|
|
, numpy
|
|
|
|
, pillow
|
|
|
|
, pylibmc
|
|
|
|
, pymemcache
|
|
|
|
, python
|
|
|
|
, pytz
|
|
|
|
, pywatchman
|
|
|
|
, pyyaml
|
|
|
|
, redis
|
|
|
|
, selenium
|
|
|
|
, tblib
|
|
|
|
, tzdata
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "Django";
|
2022-10-06 18:32:54 +00:00
|
|
|
version = "4.1.2";
|
2022-02-10 20:34:41 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-10-06 18:32:54 +00:00
|
|
|
hash = "sha256-uNhDcUgQq4jVk0RQfURHvoss8SpJAxNjtu7Z8bmyKA8=";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
patches = [
|
2022-08-21 13:32:41 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./django_4_set_zoneinfo_dir.patch;
|
|
|
|
zoneinfo = tzdata + "/share/zoneinfo";
|
|
|
|
})
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ lib.optionals withGdal [
|
2022-02-10 20:34:41 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./django_4_set_geos_gdal_lib.patch;
|
|
|
|
geos = geos;
|
|
|
|
gdal = gdal;
|
|
|
|
extension = stdenv.hostPlatform.extensions.sharedLibrary;
|
2022-08-12 12:06:08 +00:00
|
|
|
})
|
|
|
|
];
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
asgiref
|
|
|
|
sqlparse
|
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
|
|
|
backports-zoneinfo
|
|
|
|
];
|
|
|
|
|
|
|
|
# Fails to import asgiref in ~200 tests
|
|
|
|
# ModuleNotFoundError: No module named 'asgiref'
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
aiosmtpd
|
2022-05-18 14:49:53 +00:00
|
|
|
argon2-cffi
|
2022-02-10 20:34:41 +00:00
|
|
|
asgiref
|
|
|
|
bcrypt
|
|
|
|
docutils
|
|
|
|
geoip2
|
|
|
|
jinja2
|
2022-05-18 14:49:53 +00:00
|
|
|
python-memcached
|
2022-02-10 20:34:41 +00:00
|
|
|
numpy
|
|
|
|
pillow
|
|
|
|
pylibmc
|
|
|
|
pymemcache
|
|
|
|
pytz
|
|
|
|
pywatchman
|
|
|
|
pyyaml
|
|
|
|
redis
|
|
|
|
selenium
|
|
|
|
tblib
|
|
|
|
tzdata
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
${python.interpreter} tests/runtests.py
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design.";
|
|
|
|
homepage = "https://www.djangoproject.com";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|