1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 django,
6 pythonOlder,
7 setuptools,
8 django-classy-tags,
9 django-formtools,
10 django-treebeard,
11 django-sekizai,
12 djangocms-admin-style,
13 python,
14 dj-database-url,
15 djangocms-text-ckeditor,
16 fetchpatch,
17 django-cms,
18 gettext,
19 iptools,
20}:
21
22buildPythonPackage rec {
23 pname = "django-cms";
24 version = "4.1.6";
25 pyproject = true;
26
27 disabled = pythonOlder "3.9";
28
29 src = fetchFromGitHub {
30 owner = "django-cms";
31 repo = "django-cms";
32 tag = version;
33 hash = "sha256-KowhiJz84hR5VqW+WNIBEhC+X9zPE1opDWygFfsFfPE=";
34 };
35
36 patches = [
37 # Removed django-app-manage dependency by updating ./manage.py
38 # https://github.com/django-cms/django-cms/pull/8061
39 (fetchpatch {
40 url = "https://github.com/django-cms/django-cms/commit/3270edb72f6a736b5cb448864ce2eaf68f061740.patch";
41 hash = "sha256-DkgAfE/QGAXwKMNvgcYxtO0yAc7oAaAAui2My8ml1Vk=";
42 name = "remove_django_app_manage_dependency.patch";
43 })
44 (fetchpatch {
45 url = "https://github.com/django-cms/django-cms/pull/8061/commits/04005ff693e775db645c62fefbb62367822e66f9.patch";
46 hash = "sha256-4M/VKEv7pnqCk6fDyA6FurSCCu/k9tNnz16wT4Tr0Rw=";
47 name = "manage_py_update_dj_database_url.patch";
48 })
49 ];
50
51 build-system = [ setuptools ];
52
53 dependencies = [
54 django
55 django-classy-tags
56 django-formtools
57 django-treebeard
58 django-sekizai
59 djangocms-admin-style
60 ];
61
62 nativeCheckInputs = [ gettext ];
63
64 checkInputs = [
65 dj-database-url
66 djangocms-text-ckeditor
67 iptools
68 ];
69
70 preCheck = ''
71 # Disable ruff formatter test
72 rm cms/tests/test_static_analysis.py
73 '';
74
75 checkPhase = ''
76 runHook preCheck
77 ${python.interpreter} manage.py test
78 runHook postCheck
79 '';
80
81 # Tests depend on djangocms-text-ckeditor and djangocms-admin-style,
82 # which depends on this package.
83 # To avoid infinite recursion, we only enable tests when building passthru.tests.
84 doCheck = false;
85
86 passthru.tests = {
87 runTests = django-cms.overridePythonAttrs (_: {
88 doCheck = true;
89 });
90 };
91
92 pythonImportsCheck = [ "cms" ];
93
94 meta = {
95 description = "Lean enterprise content management powered by Django";
96 homepage = "https://django-cms.org";
97 changelog = "https://github.com/django-cms/django-cms/releases/tag/${src.tag}";
98 license = lib.licenses.bsd3;
99 maintainers = [ lib.maintainers.onny ];
100 };
101}