diff --git a/captcha/default.nix b/captcha/default.nix new file mode 100644 index 0000000..6395547 --- /dev/null +++ b/captcha/default.nix @@ -0,0 +1,18 @@ +{ lib, buildPythonPackage, fetchPypi, + pillow, nose }: + +buildPythonPackage rec { + pname = "captcha"; + version = "0.3"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256:1ql38qnrn43s9i3z4cq1ji2jcsz3g1cj4w2y8527r8z01l98mcm6"; + }; + propagatedBuildInputs = [ pillow ]; + checkInputs = [ nose ]; + meta = { + description = "A captcha library that generates audio and image CAPTCHAs."; + maintainers = with lib.maintainers; [ schmittlauch ]; + license = lib.licenses.bsd3; + }; +} diff --git a/default.nix b/default.nix index c223113..9deb288 100644 --- a/default.nix +++ b/default.nix @@ -1,13 +1,16 @@ self: super: rec { libevhtp = super.callPackage ./libevhtp/default.nix {}; libsearpc = super.callPackage ./libsearpc/default.nix {}; - seafile-server = super.callPackage ./seafile-server/default.nix { inherit libevhtp python27Packages libsearpc;}; - python27Packages = super.python27Packages // rec { - django-jsonfield = super.python27Packages.callPackage ./django-jsonfield/default.nix {}; - jsonfield = super.python27Packages.callPackage ./jsonfield/default.nix {}; - django-post_office = super.python27Packages.callPackage ./django-post_office/default.nix { inherit jsonfield; }; - django-statici18n = super.python27Packages.callPackage ./django-statici18n/default.nix {}; - seafile-bindings = super.python27Packages.toPythonModule seafile-server.seafile-server-core; - ccnet-bindings = super.python27Packages.toPythonModule seafile-server.ccnet-server; + seafile-server = super.callPackage ./seafile-server/default.nix { inherit libevhtp python3Packages libsearpc;}; + python3Packages = super.python3Packages // rec { + jsonfield = super.python3Packages.callPackage ./jsonfield {}; + django-simple-captcha = super.python3Packages.callPackage ./django-simple-captcha { inherit django-ranged-response; }; + django-ranged-response = super.python3Packages.callPackage ./django-ranged-response {}; + django-post_office = super.python3Packages.callPackage ./django-post_office { inherit jsonfield; }; + django-statici18n = super.python3Packages.callPackage ./django-statici18n {}; + captcha = super.python3Packages.callPackage ./captcha {}; + django-formtools = super.python3Packages.callPackage ./django-formtools {}; + seafile-bindings = super.python3Packages.toPythonModule seafile-server.seafile-server-core; + ccnet-bindings = super.python3Packages.toPythonModule seafile-server.ccnet-server; }; } diff --git a/django-formtools/default.nix b/django-formtools/default.nix new file mode 100644 index 0000000..93c1b8e --- /dev/null +++ b/django-formtools/default.nix @@ -0,0 +1,19 @@ +{ lib, buildPythonPackage, fetchPypi, + django }: + +buildPythonPackage rec { + pname = "django-formtools"; + version = "2.2"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256:1chkbl188yj6hvhh1wgjpfgql553k6hrfwxzb8vv4lfdq41jq9y5"; + }; + propagatedBuildInputs = [ django ]; + doCheck = false; # TODO: fix tests + checkInputs = [ django ]; + meta = { + description = "a collection of assorted utilities that are useful for specific form use cases."; + maintainers = with lib.maintainers; [ schmittlauch ]; + license = lib.licenses.bsd3; + }; +} diff --git a/django-ranged-response/default.nix b/django-ranged-response/default.nix new file mode 100644 index 0000000..f959016 --- /dev/null +++ b/django-ranged-response/default.nix @@ -0,0 +1,23 @@ +{ stdenv, fetchurl, fetchPypi, buildPythonPackage, django }: + +buildPythonPackage rec { + pname = "django-ranged-response"; + version = "0.2.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "11gr3jpmb5rvg3scv026kjwwkmnxwivgq5ypxadnnc9p58szy7zp"; + }; + + # tests not included in PyPi package, github source is not up to date with 0.2.0 + doCheck = false; + + propagatedBuildInputs = [ django ]; + + meta = with stdenv.lib; { + description = "A modified FileResponse that returns `Content-Range` headers with the HTTP response, so browsers (read Safari 9+) that request the file, can stream the response properly"; + homepage = "https://github.com/wearespindle/django-ranged-fileresponse"; + license = licenses.mit; + maintainers = with maintainers; [ mrmebelman schmittlauch ]; + }; +} diff --git a/django-simple-captcha/default.nix b/django-simple-captcha/default.nix new file mode 100644 index 0000000..618ebd5 --- /dev/null +++ b/django-simple-captcha/default.nix @@ -0,0 +1,30 @@ +{ lib, buildPythonPackage, fetchPypi, python, six, testfixtures, +django, django-ranged-response, pillow, +withTTS ? true, flite }: + +buildPythonPackage rec { + pname = "django-simple-captcha"; + version = "0.5.12"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256:1g92sdgcb81r3il34pg0z210cz6wm14k00b558nshai8br1g09gw"; + extension = "zip"; + }; + # ToDo: fix tests + doCheck = false; + checkInputs = [ testfixtures ]; + checkPhase = '' + cd testproject + ${python.interpreter} manage.py test captcha + ''; + + propagatedBuildInputs = [ django django-ranged-response six pillow ] + ++ lib.optional withTTS flite; + + meta = with lib; { + description = "An extremely simple, yet highly customizable Django application to add captcha images to any Django form"; + homepage = "https://github.com/mbi/django-simple-captcha"; + license = licenses.mit; + maintainers = with maintainers; [ mrmebelman schmittlauch ]; + }; +}