1{
2 lib,
3 bison,
4 buildPythonPackage,
5 click,
6 fetchFromGitHub,
7 flex,
8 gnupg,
9 meson,
10 meson-python,
11 pytestCheckHook,
12 python-dateutil,
13 regex,
14}:
15
16buildPythonPackage rec {
17 version = "3.2.0";
18 pname = "beancount";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "beancount";
23 repo = "beancount";
24 tag = version;
25 hash = "sha256-XWTgaBvB4/SONL44afvprZwJUVrkoda5XLGNxad0kec=";
26 };
27
28 build-system = [
29 meson
30 meson-python
31 ];
32
33 dependencies = [
34 click
35 python-dateutil
36 regex
37 ];
38
39 nativeBuildInputs = [
40 bison
41 flex
42 ];
43
44 nativeCheckInputs = [
45 gnupg
46 pytestCheckHook
47 ];
48
49 preCheck = ''
50 # avoid local paths, relative imports wont resolve correctly
51 mv beancount tests
52 '';
53
54 pythonImportsCheck = [ "beancount" ];
55
56 meta = {
57 homepage = "https://github.com/beancount/beancount";
58 changelog = "https://github.com/beancount/beancount/releases/tag/${src.tag}";
59 description = "Double-entry bookkeeping computer language";
60 longDescription = ''
61 A double-entry bookkeeping computer language that lets you define
62 financial transaction records in a text file, read them in memory,
63 generate a variety of reports from them, and provides a web interface.
64 '';
65 license = lib.licenses.gpl2Only;
66 maintainers = with lib.maintainers; [ alapshin ];
67 };
68}