Skip to content

Commit

Permalink
pretalx: Add plugins
Browse files Browse the repository at this point in the history
Co-authored-by: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Co-authored-by: kubaneko <kubanek0ondrej@gmail.com>
Co-authored-by: Ivan Mincik <ivan.mincik@gmail.com>
Co-authored-by: Auguste Baum <auguste.apple@gmail.com>
  • Loading branch information
5 people committed Sep 11, 2023
1 parent 29c2114 commit ca1dcd5
Show file tree
Hide file tree
Showing 8 changed files with 273 additions and 6 deletions.
3 changes: 3 additions & 0 deletions all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@
libgnunetchat = callPackage ./pkgs/libgnunetchat {};
librecast = callPackage ./pkgs/librecast {inherit lcrq;};
pretalx-mysql = callPackage ./pkgs/pretalx {
withPlugins = true;
withMysql = true;
withRedis = true;
};
pretalx-postgresql = callPackage ./pkgs/pretalx {
withPlugins = true;
withPostgresql = true;
withRedis = true;
};
pretalx = callPackage ./pkgs/pretalx {
withPlugins = true;
withMysql = true;
withPostgresql = true;
withRedis = true;
Expand Down
6 changes: 6 additions & 0 deletions pkgs/pretalx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ In order to enable HTTPS, you can obtain the TLS certificates via ACME. See the

## Packaging

### Plugins

See [`pyproject.toml`](./pyproject.toml) for the list of included plugins.

Note that the plugin `prtx-faq` is broken as of 2023-08-24 and therefore not included in the package definition.

### Pretalx Version Update

* Update the version of `pretalx` in `tool.poetry.dependencies` section of `/pkgs/pretalx/pyproject.toml` file.
Expand Down
38 changes: 34 additions & 4 deletions pkgs/pretalx/default.nix
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
{
lib,
fetchpatch,
gettext,
pkg-config,
poetry,
poetry2nix,
libmysqlclient,
withPlugins ? false,
withMysql ? false,
withPostgresql ? false,
withRedis ? false,
withTest ? false,
}: let
pname = "pretalx";
version = "2.3.2";
in (poetry2nix.mkPoetryApplication {
projectDir = ./.;
propagatedBuildInputs = [gettext];
groups =
[]
++ lib.optional withPlugins "plugins"
++ lib.optional withMysql "mysql"
++ lib.optional withPostgresql "postgresql"
++ lib.optional withRedis "redis"
++ lib.optional withTest "test";

nativeBuildInputs = [
poetry
];

overrides = poetry2nix.overrides.withDefaults (self: super: let
addSetupTools = old: {
propagatedBuildInputs =
(old.propagatedBuildInputs or [])
++ [self.setuptools];
};

pluginOverrides = old: (addSetupTools old) // {patches = [./patches/pretalx-plugin.patch];};
in {
defusedcsv = super.defusedcsv.overridePythonAttrs addSetupTools;
django-context-decorator =
Expand All @@ -39,10 +48,10 @@ in (poetry2nix.mkPoetryApplication {
urlman = super.urlman.overridePythonAttrs addSetupTools;
kombu =
super.kombu.overridePythonAttrs
(old: (addSetupTools old) // {patches = [./kombu.patch];});
(old: (addSetupTools old) // {patches = [./patches/kombu.patch];});
celery =
super.celery.overridePythonAttrs
(old: {patches = [./celery.patch];});
(old: {patches = [./patches/celery.patch];});
django-hierarkey =
super.django-hierarkey.overridePythonAttrs addSetupTools;
django-jquery-js =
Expand All @@ -58,6 +67,24 @@ in (poetry2nix.mkPoetryApplication {
++ [libmysqlclient pkg-config];
buildInputs = (old.buildInputs or []) ++ [libmysqlclient];
});

# Plugins
pretalx-youtube =
super.pretalx-youtube.overridePythonAttrs pluginOverrides;
pretalx-pages =
super.pretalx-pages.overridePythonAttrs pluginOverrides;
pretalx-venueless =
super.pretalx-venueless.overridePythonAttrs pluginOverrides;
pretalx-orcid =
super.pretalx-orcid.overridePythonAttrs pluginOverrides;
pretalx-media-ccc-de =
super.pretalx-media-ccc-de.overridePythonAttrs pluginOverrides;
pretalx-downstream =
super.pretalx-downstream.overridePythonAttrs pluginOverrides;
pretalx-vimeo =
super.pretalx-vimeo.overridePythonAttrs pluginOverrides;
pretalx-public-voting =
super.pretalx-public-voting.overridePythonAttrs pluginOverrides;
});

meta = with lib; {
Expand All @@ -72,6 +99,9 @@ in (poetry2nix.mkPoetryApplication {
imincik
lorenzleutgeb
]
++ (with (import ../../maintainers/maintainers-list.nix); [augustebaum kubaneko]);
++ (with (import ../../maintainers/maintainers-list.nix); [
augustebaum
kubaneko
]);
};
})
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions pkgs/pretalx/patches/pretalx-plugin.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/setup.py b/setup.py
index 6c851e5..b7b834c 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,6 @@
import os
from distutils.command.build import build

-from django.core import management
from setuptools import find_packages, setup

try:
@@ -15,8 +14,13 @@ except FileNotFoundError:

class CustomBuild(build):
def run(self):
- management.call_command("compilemessages", verbosity=1)
- build.run(self)
+ try:
+ from django.core import management
+
+ management.call_command("compilemessages", verbosity=1)
+ build.run(self)
+ except ModuleNotFoundError:
+ return


cmdclass = {"build": CustomBuild}
@@ -31,3 +35,4 @@ setup(
author="Tobias Kunze",
author_email="r@rixx.de",
+ python_requires=">=3.7",
license="Apache Software License",
Loading

0 comments on commit ca1dcd5

Please sign in to comment.