diff --git a/pkgs/applications/office/ledger-autosync/default.nix b/pkgs/applications/office/ledger-autosync/default.nix deleted file mode 100644 index 55b89f195e69380..000000000000000 --- a/pkgs/applications/office/ledger-autosync/default.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ lib -, python3Packages -, fetchFromGitHub -, ledger -, hledger -, useLedger ? true -, useHledger ? true -}: - -python3Packages.buildPythonApplication rec { - pname = "ledger-autosync"; - version = "1.0.3"; - format = "pyproject"; - - # no tests included in PyPI tarball - src = fetchFromGitHub { - owner = "egh"; - repo = "ledger-autosync"; - rev = "v${version}"; - sha256 = "0n3y4qxsv1cyvyap95h3rj4bj1sinyfgsajygm7s8di3j5aabqr2"; - }; - - nativeBuildInputs = with python3Packages; [ - poetry-core - ]; - - propagatedBuildInputs = with python3Packages; [ - asn1crypto - beautifulsoup4 - cffi - cryptography - entrypoints - fuzzywuzzy - idna - jeepney - keyring - lxml - mock - nose - ofxclient - ofxhome - ofxparse - pbr - pycparser - secretstorage - six - ] ++ lib.optional useLedger ledger - ++ lib.optional useHledger hledger; - - # Checks require ledger as a python package, - # ledger does not support python3 while ledger-autosync requires it. - nativeCheckInputs = with python3Packages; [ ledger hledger nose mock pytestCheckHook ]; - - # Disable some non-passing tests: - # https://github.com/egh/ledger-autosync/issues/127 - disabledTests = [ - "test_payee_match" - "test_args_only" - ]; - - meta = with lib; { - homepage = "https://github.com/egh/ledger-autosync"; - description = "OFX/CSV autosync for ledger and hledger"; - license = licenses.gpl3; - maintainers = with maintainers; [ eamsden ]; - }; -} diff --git a/pkgs/by-name/le/ledger-autosync/package.nix b/pkgs/by-name/le/ledger-autosync/package.nix new file mode 100644 index 000000000000000..d5aed4793dafb64 --- /dev/null +++ b/pkgs/by-name/le/ledger-autosync/package.nix @@ -0,0 +1,64 @@ +{ + lib, + python3Packages, + fetchFromGitHub, + fetchpatch2, + ledger, + hledger, +}: + +python3Packages.buildPythonApplication rec { + pname = "ledger-autosync"; + version = "1.0.3"; + pyproject = true; + + # no tests included in PyPI tarball + src = fetchFromGitHub { + owner = "egh"; + repo = "ledger-autosync"; + rev = "v${version}"; + hash = "sha256-IuOlVJEjNqRPfV4q/Zy3UQe5iMwDlnSV356FrTsmflg="; + }; + + patches = [ + (fetchpatch2 { + name = "drop-distutils.patch"; + url = "https://github.com/egh/ledger-autosync/commit/b7a2a185b9c3b17764322dcc80153410d12e6a5f.patch"; + hash = "sha256-qKuTpsNFuS00yRAH4VGpMA249ml0BGZsGVb75WrBWEo="; + }) + (fetchpatch2 { + name = "drop-imp.patch"; + url = "https://github.com/egh/ledger-autosync/commit/453d92ad279e6c90fadf835d1c39189a1179eb17.patch"; + hash = "sha256-mncMvdWldAnVDy1+bJ+oyDOrUb14v9LrBRz/CYrtYbc="; + }) + ]; + + build-system = with python3Packages; [ poetry-core ]; + + dependencies = with python3Packages; [ + ofxclient + ofxparse + ]; + + nativeCheckInputs = [ + hledger + ledger + python3Packages.ledger + python3Packages.pytestCheckHook + ]; + + # Disable some non-passing tests: + # https://github.com/egh/ledger-autosync/issues/127 + disabledTests = [ + "test_payee_match" + "test_args_only" + ]; + + meta = with lib; { + homepage = "https://github.com/egh/ledger-autosync"; + changelog = "https://github.com/egh/ledger-autosync/releases/tag/v${version}"; + description = "OFX/CSV autosync for ledger and hledger"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ eamsden ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5abbc65131f9390..731b8634acd66c2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31692,8 +31692,6 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Foundation; }; - ledger-autosync = callPackage ../applications/office/ledger-autosync { }; - ledger-web = callPackage ../applications/office/ledger-web { }; ledger2beancount = callPackage ../tools/text/ledger2beancount { };