From 83d3dd1c4a62dec5d46349faec863b319e127eec Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 1 Aug 2024 05:08:06 +0200 Subject: [PATCH] pretix.plugins.zugferd: init at 2.2.0 Annotate pretix' invoices with ZUGFeRD data --- pkgs/by-name/pr/pretix/plugins/default.nix | 2 + pkgs/by-name/pr/pretix/plugins/zugferd.nix | 47 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 pkgs/by-name/pr/pretix/plugins/zugferd.nix diff --git a/pkgs/by-name/pr/pretix/plugins/default.nix b/pkgs/by-name/pr/pretix/plugins/default.nix index 70e643705c00..a60316e521e4 100644 --- a/pkgs/by-name/pr/pretix/plugins/default.nix +++ b/pkgs/by-name/pr/pretix/plugins/default.nix @@ -10,4 +10,6 @@ reluctant-stripe = callPackage ./reluctant-stripe.nix { }; stretchgoals = callPackage ./stretchgoals.nix { }; + + zugferd = callPackage ./zugferd.nix { }; } diff --git a/pkgs/by-name/pr/pretix/plugins/zugferd.nix b/pkgs/by-name/pr/pretix/plugins/zugferd.nix new file mode 100644 index 000000000000..3255eeb78bd3 --- /dev/null +++ b/pkgs/by-name/pr/pretix/plugins/zugferd.nix @@ -0,0 +1,47 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pretix-plugin-build, + setuptools, + drafthorse, + ghostscript_headless, +}: + +buildPythonPackage rec { + pname = "pretix-zugferd"; + version = "2.2.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "pretix"; + repo = "pretix-zugferd"; + rev = "v${version}"; + hash = "sha256-ozFDNIA+0feHrHHvxcf+6Jh4L83svmPEE/rerd4Yim8="; + }; + + postPatch = '' + substituteInPlace pretix_zugferd/invoice.py \ + --replace-fail 'fallback="gs"' 'fallback="${lib.getExe ghostscript_headless}"' + ''; + + pythonRelaxDeps = [ "drafthorse" ]; + + build-system = [ + pretix-plugin-build + setuptools + ]; + + dependencies = [ drafthorse ]; + + doCheck = false; # no tests + + pythonImportsCheck = [ "pretix_zugferd" ]; + + meta = with lib; { + description = "Annotate pretix' invoices with ZUGFeRD data"; + homepage = "https://github.com/pretix/pretix-zugferd"; + license = licenses.asl20; + maintainers = with maintainers; [ hexa ]; + }; +}