From f028e4f2cab93300555024b89d31072b7ae37cc1 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sat, 19 Oct 2024 11:35:40 +0000 Subject: [PATCH 01/17] froide-govplan: init at 0-unstable-2024-09-19 --- pkgs/by-name/fr/froide-govplan/package.nix | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 pkgs/by-name/fr/froide-govplan/package.nix diff --git a/pkgs/by-name/fr/froide-govplan/package.nix b/pkgs/by-name/fr/froide-govplan/package.nix new file mode 100644 index 0000000000000..818b8d556a408 --- /dev/null +++ b/pkgs/by-name/fr/froide-govplan/package.nix @@ -0,0 +1,70 @@ +{ + python3, + fetchFromGitHub, + makeWrapper, + froide, + gdal, + geos, +}: + +let + + python = python3.override { + packageOverrides = self: super: { + django = super.django_5.override { withGdal = true; }; + }; + }; + +in +python.pkgs.buildPythonApplication rec { + pname = "froide-govplan"; + version = "0-unstable-2024-09-19"; + pyproject = true; + + src = fetchFromGitHub { + owner = "okfde"; + repo = "froide-govplan"; + # No tagged release yet + # https://github.com/okfde/froide-govplan/issues/15 + rev = "eb0908dea9ecc64b23ca8a2bc550fcb1a400e3f1"; + hash = "sha256-4lBxIvNRr7/Jf2fV8Aaz9plOOK0tArIzyUfHDZTuE9c="; + }; + + patches = [ ./cms-fix.patch ]; + + postPatch = '' + sed -i '$a CMS_CONFIRM_VERSION4 = True' project/settings.py + sed -i '63i\ "parler",\n "djangocms_alias",' project/settings.py + ''; + + build-system = [ python.pkgs.setuptools ]; + + build-inputs = [ gdal ]; + + nativeBuildInputs = [ makeWrapper ]; + + dependencies = with python.pkgs; [ + bleach + django-admin-sortable2 + django-cms + django-filer + django-mfa3 + django-oauth-toolkit + django-tinymce + psycopg + froide + django-mptt + django-sekizai + django-treebeard + djangocms-alias + ]; + + postInstall = '' + cp manage.py $out/${python.sitePackages}/froide_govplan/ + cp -r project $out/${python.sitePackages}/froide_govplan/ + makeWrapper $out/${python.sitePackages}/froide_govplan/manage.py $out/bin/froide-govplan \ + --prefix PYTHONPATH : "$PYTHONPATH" \ + --set GDAL_LIBRARY_PATH "${gdal}/lib/libgdal.so" \ + --set GEOS_LIBRARY_PATH "${geos}/lib/libgeos_c.so" + ''; +} From 27c0c163d8ee71558d737e73ae6ee84c788f6e4a Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sun, 20 Oct 2024 09:15:19 +0000 Subject: [PATCH 02/17] froide: init at 0-unstable-2024-07-15 --- pkgs/by-name/fr/froide/package.nix | 80 ++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 pkgs/by-name/fr/froide/package.nix diff --git a/pkgs/by-name/fr/froide/package.nix b/pkgs/by-name/fr/froide/package.nix new file mode 100644 index 0000000000000..f037ae5453805 --- /dev/null +++ b/pkgs/by-name/fr/froide/package.nix @@ -0,0 +1,80 @@ +{ + python3, + fetchFromGitHub, + makeWrapper, +}: +let + + python = python3.override { + packageOverrides = self: super: { + django = super.django_5.override { withGdal = true; }; + }; + }; + +in +python.pkgs.buildPythonApplication rec { + pname = "froide"; + version = "0-unstable-2024-11-01"; + pyproject = true; + + src = fetchFromGitHub { + owner = "okfde"; + repo = "froide"; + rev = "473c57e3eb8c99fad13635331f37eb6d4dac9bf5"; + hash = "sha256-U9Nphf4b6WFoWnguyHTSGgrrXZxEQraFlk4c5bPwzAs="; + # Tmp downgrade to tag on july + #rev = "a78a4054f9f37b0a5109a6d8cfbbda742f86a8ca"; + #hash = "sha256-gtOssbsVf3nG+pmLPgvh4685vHh2x+jlXiTjU+JhQa8="; + }; + + pythonRelaxDeps = [ + "django" + "pikepdf" + "channels" + ]; + + build-system = [ python.pkgs.setuptools ]; + + nativeBuildInputs = [ makeWrapper ]; + + dependencies = with python.pkgs; [ + celery + celery-singleton + coreapi + dj-database-url + django-configurations + django-crossdomainmedia + django-elasticsearch-dsl + django-filingcabinet + django-filter + django-leaflet + django-parler + django-storages + django-taggit + djangorestframework-csv + djangorestframework-jsonp + drf-spectacular + easy-thumbnails + geoip2 + icalendar + markdown + phonenumbers + pygtail + python-magic + python-mimeparse + python-slugify + requests + + psycopg + websockets + pyisemail + weasyprint + django-mfa3 + bleach + channels + django-celery-email + django-celery-beat + django-oauth-toolkit + django-contrib-comments + ]; +} From d9a156e880091ef235bb696084aab788b3244ef8 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sun, 20 Oct 2024 09:23:17 +0000 Subject: [PATCH 03/17] python3Packages.django-filingcabinet: init at 0-unstable-2024-09-09 --- .../django-filingcabinet/default.nix | 96 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 98 insertions(+) create mode 100644 pkgs/development/python-modules/django-filingcabinet/default.nix diff --git a/pkgs/development/python-modules/django-filingcabinet/default.nix b/pkgs/development/python-modules/django-filingcabinet/default.nix new file mode 100644 index 0000000000000..9373321bf6960 --- /dev/null +++ b/pkgs/development/python-modules/django-filingcabinet/default.nix @@ -0,0 +1,96 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + django, + pytestCheckHook, + setuptools, + celery, + django-taggit, + feedgen, + reportlab, + jsonschema, + wand, + django-filter, + django-treebeard, + djangorestframework, + pikepdf, + pypdf, + pycryptodome, + python-poppler, + zipstream-ng, + django-json-widget, + factory-boy, + pytest-django, + pytest, +}: + +buildPythonPackage rec { + pname = "django-filingcabinet"; + version = "0-unstable-2024-09-09"; + pyproject = true; + + src = fetchFromGitHub { + owner = "okfde"; + repo = "django-filingcabinet"; + # No release tagged yet on GitHub + # https://github.com/okfde/django-filingcabinet/issues/69 + rev = "3b1dc92d89da48af9851e37a22ac1310922b9c73"; + hash = "sha256-Ad2R9Tw6LmwIUMve2pmofKCAbsR/u4Exh92uoztjUaQ="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "zipstream" "zipstream-ng" + ''; + + build-system = [ setuptools ]; + + dependencies = [ + celery + django + django-taggit + feedgen + reportlab + jsonschema + wand + django-filter + django-treebeard + djangorestframework + pikepdf + pypdf + pycryptodome + python-poppler + zipstream-ng + django-json-widget + ]; + + optional-dependencies = { + }; + + env.DJANGO_SETTINGS_MODULE = "test_project.settings"; + + + nativeCheckInputs = [ + pytestCheckHook + pytest-django + ]; + + preCheck = '' + export PYTHONPATH=./test_project + ''; + + checkInputs = [ + factory-boy + pytest + ]; + + doCheck = false; + + meta = { + description = "Django app that manages documents with pages, annotations and collections"; + homepage = "https://github.com/okfde/django-filingcabinet"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5a090c44ff031..afd3f715d8d65 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3400,6 +3400,8 @@ self: super: with self; { django-extensions = callPackage ../development/python-modules/django-extensions { }; + django-filingcabinet = callPackage ../development/python-modules/django-filingcabinet { }; + django-filter = callPackage ../development/python-modules/django-filter { }; django-formtools = callPackage ../development/python-modules/django-formtools { }; From eaef425f6b0ff4337d12afeaab5548e0bddd3a57 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Tue, 22 Oct 2024 10:12:14 +0200 Subject: [PATCH 04/17] gdal 3.8 --- pkgs/development/libraries/gdal/default.nix | 28 +++++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix index 841e0808d4331..08b7e07d1a1ce 100644 --- a/pkgs/development/libraries/gdal/default.nix +++ b/pkgs/development/libraries/gdal/default.nix @@ -1,4 +1,5 @@ { lib +, gcc11Stdenv , stdenv , callPackage , fetchFromGitHub @@ -77,10 +78,12 @@ , zlib , zstd }: - +#let +# stdenv = gcc11Stdenv; +#in stdenv.mkDerivation (finalAttrs: { pname = "gdal" + lib.optionalString useMinimalFeatures "-minimal"; - version = "3.9.3"; + version = "3.8.0"; src = fetchFromGitHub { owner = "OSGeo"; @@ -105,25 +108,26 @@ stdenv.mkDerivation (finalAttrs: { python3.pkgs.setuptools python3.pkgs.wrapPython swig - ] ++ lib.optionals useJava [ ant jdk ]; + ]; # ++ lib.optionals useJava [ ant jdk ]; cmakeFlags = [ + "-DCMAKE_CXX_FLAGS=-fpermissive" "-DGDAL_USE_INTERNAL_LIBS=OFF" "-DGEOTIFF_INCLUDE_DIR=${lib.getDev libgeotiff}/include" "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}" "-DMYSQL_INCLUDE_DIR=${lib.getDev libmysqlclient}/include/mysql" "-DMYSQL_LIBRARY=${lib.getLib libmysqlclient}/lib/${lib.optionalString (libmysqlclient.pname != "mysql") "mysql/"}libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary}" - ] ++ lib.optionals finalAttrs.doInstallCheck [ - "-DBUILD_TESTING=ON" + #] ++ lib.optionals finalAttrs.doInstallCheck [ + # "-DBUILD_TESTING=ON" ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ "-DCMAKE_SKIP_BUILD_RPATH=ON" # without, libgdal.so can't find libmariadb.so ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" ] ++ lib.optionals (!useTiledb) [ "-DGDAL_USE_TILEDB=OFF" - ] ++ lib.optionals (!useJava) [ - # This is not strictly needed as the Java bindings wouldn't build anyway if - # ant/jdk were not available. + #] ++ lib.optionals (!useJava) [ + # # This is not strictly needed as the Java bindings wouldn't build anyway if + # # ant/jdk were not available. "-DBUILD_JAVA_BINDINGS=OFF" ]; @@ -193,8 +197,8 @@ stdenv.mkDerivation (finalAttrs: { zstd python3 python3.pkgs.numpy - ] ++ tileDbDeps - ++ libHeifDeps + ] #++ tileDbDeps + #++ libHeifDeps ++ libJxlDeps ++ mysqlDeps ++ postgresDeps @@ -217,7 +221,7 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - doInstallCheck = true; + #doInstallCheck = true; # preCheck rather than preInstallCheck because this is what pytestCheckHook # calls (coming from the python world) preCheck = '' @@ -282,6 +286,8 @@ stdenv.mkDerivation (finalAttrs: { popd # autotest ''; + doCheck = false; + passthru.tests = callPackage ./tests.nix { gdal = finalAttrs.finalPackage; }; __darwinAllowLocalNetworking = true; From aa8440c13a8ccdb924f4cd7a026ed17ea7803f79 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Thu, 24 Oct 2024 08:23:57 +0200 Subject: [PATCH 05/17] python3Packages.djangocms-admin-style: init at 3.3.1 --- .../djangocms-admin-style/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/djangocms-admin-style/default.nix diff --git a/pkgs/development/python-modules/djangocms-admin-style/default.nix b/pkgs/development/python-modules/djangocms-admin-style/default.nix new file mode 100644 index 0000000000000..e913776774faf --- /dev/null +++ b/pkgs/development/python-modules/djangocms-admin-style/default.nix @@ -0,0 +1,42 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + django, + pythonOlder, + pytestCheckHook, + setuptools, +}: + +buildPythonPackage rec { + pname = "djangocms-admin-style"; + version = "3.3.1"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-2iDeODHxoadN4z/hK704ZaACepgoeMAqodECsceZ12c="; + }; + + build-system = [ setuptools ]; + + dependencies = [ django ]; + + env.DJANGO_SETTINGS_MODULE = "tests.settings"; + + checkInputs = [ pytestCheckHook ]; + + doCheck = false; + + #pythonImportCheck = [ "django-cms" ]; + + meta = { + description = "Django Theme tailored to the needs of django CMS"; + homepage = "https://django-cms.org"; + changelog = "https://github.com/django-cms/djangocms-admin-style/releases/tag/${version}"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index afd3f715d8d65..501a933b91516 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3308,6 +3308,8 @@ self: super: with self; { # Pre-release django_5 = callPackage ../development/python-modules/django/5.nix { }; + djangocms-admin-style = callPackage ../development/python-modules/djangocms-admin-style { }; + django-admin-datta = callPackage ../development/python-modules/django-admin-datta { }; django-admin-sortable2 = callPackage ../development/python-modules/django-admin-sortable2 { }; From 83285ccfc12c4d2f18a9cd987e2752e3ecddc6b4 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sat, 26 Oct 2024 13:39:02 +0200 Subject: [PATCH 06/17] python3Packages.django-app-helper: init at 3.3.4 --- .../django-app-helper/default.nix | 63 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 65 insertions(+) create mode 100644 pkgs/development/python-modules/django-app-helper/default.nix diff --git a/pkgs/development/python-modules/django-app-helper/default.nix b/pkgs/development/python-modules/django-app-helper/default.nix new file mode 100644 index 0000000000000..f0c829ff05b51 --- /dev/null +++ b/pkgs/development/python-modules/django-app-helper/default.nix @@ -0,0 +1,63 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + django, + pythonOlder, + setuptools, + docopt, + dj-database-url, + python, + django-filer, + six, + django-app-helper, +}: + +buildPythonPackage rec { + pname = "django-app-helper"; + version = "3.3.4"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "nephila"; + repo = "django-app-helper"; + rev = "refs/tags/${version}"; + hash = "sha256-4nFg8B1uxGJVY1jcGr0e2Oi14lqXcFOi0HJ+ogE2ikg="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + dj-database-url + docopt + six + ]; + + checkInputs = [ django-filer ]; + + # Tests depend on django-filer, which depends on this package. + # To avoid infinite recursion, we only enable tests when building passthru.tests. + doCheck = false; + + checkPhase = '' + ${python.interpreter} helper.py + ''; + + pythonImportsCheck = [ "app_helper" ]; + + passthru.tests = { + runTests = django-app-helper.overrideAttrs (_: { + doCheck = true; + }); + }; + + meta = { + description = "Helper for Django applications development"; + homepage = "https://django-app-helper.readthedocs.io"; + changelog = "https://github.com/nephila/django-app-helper/releases/tag/${version}"; + license = lib.licenses.gpl2Only; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 501a933b91516..0e3ddf25bde75 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3324,6 +3324,8 @@ self: super: with self; { django-appconf = callPackage ../development/python-modules/django-appconf { }; + django-app-helper = callPackage ../development/python-modules/django-app-helper { }; + django-auditlog = callPackage ../development/python-modules/django-auditlog { }; django-auth-ldap = callPackage ../development/python-modules/django-auth-ldap { }; From 86cf5727d77e48634b41569314f541601b92383e Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sun, 27 Oct 2024 18:11:34 +0100 Subject: [PATCH 07/17] python3Packages.django-cms: init at 4.1.3 --- .../python-modules/django-cms/default.nix | 101 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 103 insertions(+) create mode 100644 pkgs/development/python-modules/django-cms/default.nix diff --git a/pkgs/development/python-modules/django-cms/default.nix b/pkgs/development/python-modules/django-cms/default.nix new file mode 100644 index 0000000000000..5afe7fdb47d9e --- /dev/null +++ b/pkgs/development/python-modules/django-cms/default.nix @@ -0,0 +1,101 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + django, + pythonOlder, + pytestCheckHook, + setuptools, + django-classy-tags, + django-formtools, + django-treebeard, + django-sekizai, + djangocms-admin-style, + python, + dj-database-url, + djangocms-text-ckeditor, + fetchpatch, + django-cms, + gettext, + iptools, + ruff, +}: + +buildPythonPackage rec { + pname = "django-cms"; + version = "4.1.3"; + pyproject = true; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "django-cms"; + repo = "django-cms"; + rev = "refs/tags/${version}"; + hash = "sha256-ucGxc6f2UYdmSLuyxVV2nIcl35qoeQMlk1paN6XeBFY="; + }; + + patches = [ + # Removed django-app-manage dependency by updating ./manage.py + # https://github.com/django-cms/django-cms/pull/8061 + (fetchpatch { + url = "https://github.com/django-cms/django-cms/commit/3270edb72f6a736b5cb448864ce2eaf68f061740.patch"; + hash = "sha256-DkgAfE/QGAXwKMNvgcYxtO0yAc7oAaAAui2My8ml1Vk="; + name = "remove_django_app_manage_dependency.patch"; + }) + (fetchpatch { + url = "https://github.com/django-cms/django-cms/pull/8061/commits/04005ff693e775db645c62fefbb62367822e66f9.patch"; + hash = "sha256-4M/VKEv7pnqCk6fDyA6FurSCCu/k9tNnz16wT4Tr0Rw="; + name = "manage_py_update_dj_database_url.patch"; + }) + ]; + + build-system = [ setuptools ]; + + dependencies = [ + django + django-classy-tags + django-formtools + django-treebeard + django-sekizai + djangocms-admin-style + ]; + + nativeCheckInputs = [ + gettext + pytestCheckHook + ]; + + checkInputs = [ + dj-database-url + djangocms-text-ckeditor + iptools + ruff + ]; + + checkPhase = '' + runHook preCheck + ${python.interpreter} manage.py test + runHook postCheck + ''; + + # Tests depend on dnagocms-text-ckeditor, which depends on this package. + # To avoid infinite recursion, we only enable tests when building passthru.tests. + doCheck = false; + + passthru.tests = { + runTests = django-cms.overridePythonAttrs (_: { + doCheck = true; + }); + }; + + pythonImportCheck = [ "django-cms" ]; + + meta = { + description = "Lean enterprise content management powered by Django"; + homepage = "https://django-cms.org"; + changelog = "https://github.com/django-cms/django-cms/releases/tag/${version}"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0e3ddf25bde75..85ca032b36c87 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3360,6 +3360,8 @@ self: super: with self; { django-cleanup = callPackage ../development/python-modules/django-cleanup { }; + django-cms = callPackage ../development/python-modules/django-cms { }; + django-colorful = callPackage ../development/python-modules/django-colorful { }; django-compressor = callPackage ../development/python-modules/django-compressor { }; From 8e96837ebde515bca605fc2406ca2250777388c1 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sun, 27 Oct 2024 18:14:59 +0100 Subject: [PATCH 08/17] python3Packages.django-filer: init at 3.2.3 --- .../python-modules/django-filer/default.nix | 59 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 61 insertions(+) create mode 100644 pkgs/development/python-modules/django-filer/default.nix diff --git a/pkgs/development/python-modules/django-filer/default.nix b/pkgs/development/python-modules/django-filer/default.nix new file mode 100644 index 0000000000000..61cb5533da5ff --- /dev/null +++ b/pkgs/development/python-modules/django-filer/default.nix @@ -0,0 +1,59 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + django, + pythonOlder, + pytestCheckHook, + django-polymorphic, + setuptools, + python, + easy-thumbnails, + pillow-heif, + django-app-helper, + distutils, +}: + +buildPythonPackage rec { + pname = "django-filer"; + version = "3.2.3"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "django-cms"; + repo = "django-filer"; + rev = "refs/tags/${version}"; + hash = "sha256-PoUBnfNymighCsGoJE+iu31lxA9wqVXimFPCytQtPLg="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + django + django-polymorphic + easy-thumbnails + ]; + + optional-dependencies = { + heif = [ pillow-heif ]; + }; + + checkInputs = [ + distutils + django-app-helper + ]; + + checkPhase = '' + ${python.interpreter} tests/settings.py + ''; + + meta = { + description = "A file management application for Django"; + homepage = "https://github.com/django-cms/django-filer"; + changelog = "https://github.com/django-cms/django-filer/blob/${version}/CHANGELOG.rst"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 85ca032b36c87..8e074ed319124 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3406,6 +3406,8 @@ self: super: with self; { django-extensions = callPackage ../development/python-modules/django-extensions { }; + django-filer = callPackage ../development/python-modules/django-filer { }; + django-filingcabinet = callPackage ../development/python-modules/django-filingcabinet { }; django-filter = callPackage ../development/python-modules/django-filter { }; From 5654a5da5adaa5d806d9dcab8b490aa3cc1ddcfe Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Wed, 30 Oct 2024 08:14:23 +0100 Subject: [PATCH 09/17] nixos/froide-govplan: init --- nixos/modules/module-list.nix | 1 + .../services/web-apps/froide-govplan.nix | 112 ++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 nixos/modules/services/web-apps/froide-govplan.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 7b753937e8082..eb9b5a8fe2114 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1422,6 +1422,7 @@ ./services/web-apps/flarum.nix ./services/web-apps/fluidd.nix ./services/web-apps/freshrss.nix + ./services/web-apps/froide-govplan.nix ./services/web-apps/galene.nix ./services/web-apps/gancio.nix ./services/web-apps/gerrit.nix diff --git a/nixos/modules/services/web-apps/froide-govplan.nix b/nixos/modules/services/web-apps/froide-govplan.nix new file mode 100644 index 0000000000000..178551947fb24 --- /dev/null +++ b/nixos/modules/services/web-apps/froide-govplan.nix @@ -0,0 +1,112 @@ +{ + config, + lib, + pkgs, + ... +}: +let + + cfg = config.services.froide-govplan; + format = pkgs.formats.toml { }; + +in { + options.services.froide-govplan = { + + enable = lib.mkEnableOption "Gouvernment planer web app Govplan"; + + settings = lib.mkOption { + default = { }; + description = '' + IMAP authentication configuration for rspamd-trainer. For supplying + the IMAP password, use the `secrets` option. + ''; + type = lib.types.submodule { + freeformType = format.type; + }; + example = lib.literalExpression '' + { + HOST = "localhost"; + USERNAME = "spam@example.com"; + INBOXPREFIX = "INBOX/"; + } + ''; + }; + + secrets = lib.mkOption { + type = with lib.types; listOf path; + description = '' + A list of files containing the various secrets. Should be in the + format expected by systemd's `EnvironmentFile` directory. For the + IMAP account password use `PASSWORD = mypassword`. + ''; + default = [ ]; + }; + + }; + + config = lib.mkIf cfg.enable { + + services.postgresql = { + enable = true; + ensureDatabases = [ "govplan" ]; + ensureUsers = [ + { name = "govplan"; + ensureDBOwnership = true; + } + ]; + extraPlugins = ps: with ps; [ postgis ]; + authentication = '' + host govplan govplan localhost trust + ''; + initialScript = pkgs.writeText "backend-initScript" '' + ALTER USER govplan WITH SUPERUSER; + ''; + }; + + systemd = { + services = { + + postgresql.serviceConfig.ExecStartPost = + let + sqlFile = pkgs.writeText "immich-pgvectors-setup.sql" '' + ALTER USER govplan WITH SUPERUSER; + #CREATE EXTENSION IF NOT EXISTS postgis; + #ALTER SCHEMA govplan OWNER TO govplan; + #ALTER EXTENSION govplan UPDATE; + ''; + in + [ + '' + ${lib.getExe' config.services.postgresql.package "psql"} -d govplan -f "${sqlFile}" + '' + ]; + + froide-govplan = { + description = "Gouvernment planer Govplan"; + serviceConfig = { + ExecStart = "${pkgs.froide-govplan}/bin/froide-govplan runserver 0.0.0.0:8000"; + WorkingDirectory = "/var/lib/froide-govplan"; + StateDirectory = [ "froide-govplan" ]; + DynamicUser = true; + EnvironmentFile = [ + ( format.generate "froide-govplan-env" cfg.settings ) + cfg.secrets + ]; + }; + after = [ "postgresql.service" ]; + wantedBy = [ "multi-user.target" ]; + preStart = '' + # FIXME adapt paperless-ngx check for new versions + ${pkgs.froide-govplan}/bin/froide-govplan migrate + ${pkgs.froide-govplan}/bin/froide-govplan migrate djangocms_alias + ''; + }; + }; + + }; + + }; + + meta.maintainers = with lib.maintainers; [ onny ]; + +} From 07fed3101c47a13314206d84d4c2f69a2006e445 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Wed, 30 Oct 2024 13:47:11 +0100 Subject: [PATCH 10/17] python3Packages.moto: add onny as maintainer --- pkgs/development/python-modules/moto/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/moto/default.nix b/pkgs/development/python-modules/moto/default.nix index 99a1f58beb1c6..783898d7c88ca 100644 --- a/pkgs/development/python-modules/moto/default.nix +++ b/pkgs/development/python-modules/moto/default.nix @@ -259,6 +259,6 @@ buildPythonPackage rec { homepage = "https://github.com/getmoto/moto"; changelog = "https://github.com/getmoto/moto/blob/${version}/CHANGELOG.md"; license = licenses.asl20; - maintainers = [ ]; + maintainers = with maintainers; [ onny ]; }; } From 769d0f3fa599d2d31148591532cb91b1be603de2 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Wed, 30 Oct 2024 13:47:53 +0100 Subject: [PATCH 11/17] python3Packages.moto: reformat --- pkgs/development/python-modules/moto/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/moto/default.nix b/pkgs/development/python-modules/moto/default.nix index 783898d7c88ca..313624ea3e488 100644 --- a/pkgs/development/python-modules/moto/default.nix +++ b/pkgs/development/python-modules/moto/default.nix @@ -254,11 +254,11 @@ buildPythonPackage rec { "tests/test_cognitoidp/test_cognitoidp.py" ]; - meta = with lib; { - description = "Module to allow your tests to easily mock out AWS Services"; + meta = { + description = "Allows your tests to easily mock out AWS Services"; homepage = "https://github.com/getmoto/moto"; changelog = "https://github.com/getmoto/moto/blob/${version}/CHANGELOG.md"; - license = licenses.asl20; - maintainers = with maintainers; [ onny ]; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ onny ]; }; } From 48a3b476086cce0c35e903d1933b45bc26d67f39 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Wed, 30 Oct 2024 13:55:47 +0100 Subject: [PATCH 12/17] python3Packages.moto: 5.0.15 -> 5.0.18 --- pkgs/development/python-modules/moto/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/moto/default.nix b/pkgs/development/python-modules/moto/default.nix index 313624ea3e488..baad3e6430304 100644 --- a/pkgs/development/python-modules/moto/default.nix +++ b/pkgs/development/python-modules/moto/default.nix @@ -37,14 +37,14 @@ buildPythonPackage rec { pname = "moto"; - version = "5.0.16"; + version = "5.0.18"; pyproject = true; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-9K+xdqlkzXpw2pvF4FPUMQlhTOPKsmBEvLtTYQQ13/Q="; + hash = "sha256-inrS9ToubMnbL/ZcDg1LXX54vAC4Jcnh/2zDlDceduk="; }; build-system = [ setuptools ]; From ffbc71a006ce2759dd5648f4c2bc41e4a24036fd Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 1 Nov 2024 18:13:08 +0100 Subject: [PATCH 13/17] djangocms-alias --- pkgs/by-name/fr/froide-govplan/cms-fix.patch | 41 ++++++++++++++++ .../djangocms-alias/default.nix | 48 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 91 insertions(+) create mode 100644 pkgs/by-name/fr/froide-govplan/cms-fix.patch create mode 100644 pkgs/development/python-modules/djangocms-alias/default.nix diff --git a/pkgs/by-name/fr/froide-govplan/cms-fix.patch b/pkgs/by-name/fr/froide-govplan/cms-fix.patch new file mode 100644 index 0000000000000..25d31006c40b9 --- /dev/null +++ b/pkgs/by-name/fr/froide-govplan/cms-fix.patch @@ -0,0 +1,41 @@ +diff --git a/froide_govplan/templates/admin/froide_govplan/governmentplan/change_form.html b/froide_govplan/templates/admin/froide_govplan/governmentplan/change_form.html +index b512140..33e88cc 100644 +--- a/froide_govplan/templates/admin/froide_govplan/governmentplan/change_form.html ++++ b/froide_govplan/templates/admin/froide_govplan/governmentplan/change_form.html +@@ -9,5 +9,7 @@ + + + {% endif %} +- {{ block.super }} ++ {% if block.super %} ++ {{ block.super }} ++ {% endif %} + {% endblock %} +diff --git a/froide_govplan/templates/froide_govplan/admin/accept_proposal.html b/froide_govplan/templates/froide_govplan/admin/accept_proposal.html +index 24f2b14..98ad5c4 100644 +--- a/froide_govplan/templates/froide_govplan/admin/accept_proposal.html ++++ b/froide_govplan/templates/froide_govplan/admin/accept_proposal.html +@@ -1,7 +1,7 @@ + {% extends "admin/change_form.html" %} + {% load i18n %} + +-{% block title %}{{ object.title }} - {{ block.super }}{% endblock %} ++{% block title %}{{ object.title }} - {% if block.super %}{{ block.super }}{% endif %}{% endblock %} + + + {% block content %}
+diff --git a/froide_govplan/templates/froide_govplan/base.html b/froide_govplan/templates/froide_govplan/base.html +index fa9711e..1cd9773 100644 +--- a/froide_govplan/templates/froide_govplan/base.html ++++ b/froide_govplan/templates/froide_govplan/base.html +@@ -3,7 +3,9 @@ + {% load djangocms_alias_tags %} + {% load menu_tags %} + {% block navbar %} +- {{ block.super }} ++ {% if block.super %} ++ {{ block.super }} ++ {% endif %} + {% include "snippets/breadcrumbs.html" with breadcrumbs_background="blue-10" overlay=True %} + {% endblock navbar %} + {% block body %} diff --git a/pkgs/development/python-modules/djangocms-alias/default.nix b/pkgs/development/python-modules/djangocms-alias/default.nix new file mode 100644 index 0000000000000..13ea2fb95823f --- /dev/null +++ b/pkgs/development/python-modules/djangocms-alias/default.nix @@ -0,0 +1,48 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + django, + pythonOlder, + pytestCheckHook, + setuptools, + django-parler, + django-cms, +}: + +buildPythonPackage rec { + pname = "djangocms-alias"; + version = "2.0.1"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-M3elm8B0+qpPxIqP9xKS9HS73AT/ZPsyWwC38uHvBjE="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + django + django-cms + django-parler + ]; + + env.DJANGO_SETTINGS_MODULE = "tests.settings"; + + checkInputs = [ pytestCheckHook ]; + + doCheck = false; + + #pythonImportCheck = [ "django-cms" ]; + + meta = { + description = "Lean enterprise content management powered by Django"; + homepage = "https://django-cms.org"; + changelog = "https://github.com/django-cms/django-cms/releases/tag/${version}"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8e074ed319124..2533c3aeead36 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3310,6 +3310,8 @@ self: super: with self; { djangocms-admin-style = callPackage ../development/python-modules/djangocms-admin-style { }; + djangocms-alias = callPackage ../development/python-modules/djangocms-alias { }; + django-admin-datta = callPackage ../development/python-modules/django-admin-datta { }; django-admin-sortable2 = callPackage ../development/python-modules/django-admin-sortable2 { }; From bf507c20f20e6fd469d55815c15ccb2cc58f52a0 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sun, 3 Nov 2024 20:38:29 +0100 Subject: [PATCH 14/17] python3Packages.django-oauth-toolkit: 2.4.0 -> 3.0.1 --- .../django-oauth-toolkit/default.nix | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/django-oauth-toolkit/default.nix b/pkgs/development/python-modules/django-oauth-toolkit/default.nix index ae4a56d8790bc..41265d7e99c7c 100644 --- a/pkgs/development/python-modules/django-oauth-toolkit/default.nix +++ b/pkgs/development/python-modules/django-oauth-toolkit/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, fetchFromGitHub, + setuptools, # propagates django, @@ -18,29 +19,29 @@ buildPythonPackage rec { pname = "django-oauth-toolkit"; - version = "2.4.0"; - format = "setuptools"; + version = "3.0.1"; + pyproject = true; src = fetchFromGitHub { owner = "jazzband"; - repo = pname; + repo = "django-oauth-toolkit"; rev = "refs/tags/${version}"; - hash = "sha256-nfLjjVp+6OsjFdJHUZ2gzZic/E/sCklj+YeFyb/EZdw="; + hash = "sha256-Ya0KlX+vtLXN2Fgk0Gv7KemJCUTwkaH+4GQA1ByUlBY="; }; postPatch = '' - sed -i '/cov/d' tox.ini + sed -i '/cov/d' pyproject.toml ''; - propagatedBuildInputs = [ + build-system = [ setuptools ]; + + dependencies = [ django jwcrypto oauthlib requests ]; - pythonRelaxDeps = [ "django" ]; - DJANGO_SETTINGS_MODULE = "tests.settings"; # xdist is disabled right now because it can cause race conditions on high core machines @@ -58,10 +59,11 @@ buildPythonPackage rec { "test_response_when_auth_server_response_return_404" ]; - meta = with lib; { + meta = { description = "OAuth2 goodies for the Djangonauts"; homepage = "https://github.com/jazzband/django-oauth-toolkit"; - license = licenses.bsd2; - maintainers = with maintainers; [ mmai ]; + changelog = "https://github.com/jazzband/django-oauth-toolkit/django-filer/blob/${version}/CHANGELOG.md"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ mmai ]; }; } From d3f54b24c344db5e3487de5a11586ad59f96cd14 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Mon, 4 Nov 2024 15:06:34 +0100 Subject: [PATCH 15/17] djangocms-text-ckeditor --- .../djangocms-text-ckeditor/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/development/python-modules/djangocms-text-ckeditor/default.nix diff --git a/pkgs/development/python-modules/djangocms-text-ckeditor/default.nix b/pkgs/development/python-modules/djangocms-text-ckeditor/default.nix new file mode 100644 index 0000000000000..9f7700ffd2e15 --- /dev/null +++ b/pkgs/development/python-modules/djangocms-text-ckeditor/default.nix @@ -0,0 +1,49 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + pythonOlder, + pytestCheckHook, + setuptools, + html5lib, + pillow, + django-cms, +}: + +buildPythonPackage rec { + pname = "djangocms-text-ckeditor"; + version = "5.1.6"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit version; + pname = "djangocms_text_ckeditor"; + hash = "sha256-ow2S4FJkO037QUkAf3FheVl2O4BaLw1PSSCVRBhlRX0="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + django-cms + html5lib + pillow + ]; + + env.DJANGO_SETTINGS_MODULE = "tests.settings"; + + checkInputs = [ pytestCheckHook ]; + + doCheck = false; + + #pythonImportCheck = [ "django-cms" ]; + + meta = { + description = "Django Theme tailored to the needs of django CMS"; + homepage = "https://django-cms.org"; + changelog = "https://github.com/django-cms/djangocms-admin-style/releases/tag/${version}"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2533c3aeead36..3069b42dd6a65 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3312,6 +3312,8 @@ self: super: with self; { djangocms-alias = callPackage ../development/python-modules/djangocms-alias { }; + djangocms-text-ckeditor = callPackage ../development/python-modules/djangocms-text-ckeditor { }; + django-admin-datta = callPackage ../development/python-modules/django-admin-datta { }; django-admin-sortable2 = callPackage ../development/python-modules/django-admin-sortable2 { }; From 156ef48c13b640c9dbdd97aa96eaf5174d003469 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Mon, 4 Nov 2024 22:14:49 +0100 Subject: [PATCH 16/17] django-cms --- pkgs/development/python-modules/django-cms/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/django-cms/default.nix b/pkgs/development/python-modules/django-cms/default.nix index 5afe7fdb47d9e..36c997eb87655 100644 --- a/pkgs/development/python-modules/django-cms/default.nix +++ b/pkgs/development/python-modules/django-cms/default.nix @@ -89,7 +89,7 @@ buildPythonPackage rec { }); }; - pythonImportCheck = [ "django-cms" ]; + pythonImportCheck = [ "cms" ]; meta = { description = "Lean enterprise content management powered by Django"; From 65e8e7a3799343914f8341acc7f97ede1450285c Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Mon, 4 Nov 2024 22:15:04 +0100 Subject: [PATCH 17/17] djangocms-admin-style --- .../djangocms-admin-style/default.nix | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/djangocms-admin-style/default.nix b/pkgs/development/python-modules/djangocms-admin-style/default.nix index e913776774faf..1f0dd68c87583 100644 --- a/pkgs/development/python-modules/djangocms-admin-style/default.nix +++ b/pkgs/development/python-modules/djangocms-admin-style/default.nix @@ -1,11 +1,13 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, django, pythonOlder, pytestCheckHook, setuptools, + django-cms, + djangocms-admin-style, }: buildPythonPackage rec { @@ -15,22 +17,36 @@ buildPythonPackage rec { disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - hash = "sha256-2iDeODHxoadN4z/hK704ZaACepgoeMAqodECsceZ12c="; + src = fetchFromGitHub { + owner = "django-cms"; + repo = "djangocms-admin-style"; + rev = "refs/tags/${version}"; + hash = "sha256-cDbmC7IJTT3NuVXBnbUVqC7dUfusMdntDGu2tSvxIdQ="; }; build-system = [ setuptools ]; dependencies = [ django ]; - env.DJANGO_SETTINGS_MODULE = "tests.settings"; + nativeCheckInputs = [ pytestCheckHook ]; - checkInputs = [ pytestCheckHook ]; + checkInputs = [ django-cms ]; + # Tests depend on django-cms, which depends on this package. + # To avoid infinite recursion, we only enable tests when building passthru.tests. doCheck = false; - #pythonImportCheck = [ "django-cms" ]; + preCheck = '' + export DJANGO_SETTINGS_MODULE="tests.settings" + ''; + + passthru.tests = { + runTests = djangocms-admin-style.overridePythonAttrs (_: { + doCheck = true; + }); + }; + + pythonImportCheck = [ "djangocms_admin_style" ]; meta = { description = "Django Theme tailored to the needs of django CMS";