diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 226768a24d..dc52993ec7 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -11,4 +11,5 @@ args: { copybara = import ./copybara.nix args; hg-git = import ./hg-git.nix args; erbium = import ./erbium args; + python-emv = import ./python-emv.nix args; } // (import ./heptapod-runner.nix args) diff --git a/nix/pkgs/python-emv.nix b/nix/pkgs/python-emv.nix new file mode 100644 index 0000000000..f1bc02ac22 --- /dev/null +++ b/nix/pkgs/python-emv.nix @@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ pkgs, ... }: +with pkgs; +with pkgs.python3Packages; +buildPythonPackage rec { + pname = "python-emv"; + version = "1.0.9"; + + src = fetchFromGitHub { + owner = "russss"; + repo = "python-emv"; + rev = "v${version}"; + hash = "sha256:1ldibcy1wgnaimf8ri79lg8im1mhfqajrigfflvizw0hb0ivh8al"; + }; + + checkInputs = [ pytestCheckHook unittest2 ]; + propagatedBuildInputs = [ + enum-compat + click + pyscard + pycountry + terminaltables + ]; + + # argparse is part of the standardlib + prePatch = '' + substituteInPlace setup.py --replace '"argparse",' "" + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/russss/python-emv"; + description = "A Python implementation of the EMV smartcard protocol, used for chip-and-PIN payments"; + license = licenses.mit; + maintainers = with maintainers; [ lukegb ]; + }; +}