Skip to content

Commit

Permalink
Merge pull request #334202 from dotlambda/ledger-autosync
Browse files Browse the repository at this point in the history
ledger-autosync: fix build with Python 3.12 and don't propagate ledger and hledger
  • Loading branch information
dotlambda committed Aug 13, 2024
2 parents 9e023b0 + 9faf61f commit bd909c8
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 69 deletions.
67 changes: 0 additions & 67 deletions pkgs/applications/office/ledger-autosync/default.nix

This file was deleted.

64 changes: 64 additions & 0 deletions pkgs/by-name/le/ledger-autosync/package.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down

0 comments on commit bd909c8

Please sign in to comment.