1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
8 inherit check-reqs cmake-utils elisp-common python-single-r1
10 DESCRIPTION="A double-entry accounting system with a command-line reporting interface"
11 HOMEPAGE="https://www.ledger-cli.org/"
12 SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
15 KEYWORDS="~amd64 ~x86"
17 IUSE="doc emacs python"
18 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
21 SITEFILE=50${PN}-gentoo-${PV}.el
26 dev-libs/boost:=[python?]
29 emacs? ( virtual/emacs )
31 dev-libs/boost:=[${PYTHON_USEDEP}]
42 dev-texlive/texlive-fontsrecommended
47 "${FILESDIR}/${PN}-${PV}-boost.patch" # bug 609108
48 "${FILESDIR}/${PF}-boost-python.patch" # bug 654326
51 # Building with python integration seems to fail without 8G available
52 # RAM(!) Since the memory check in check-reqs doesn't count swap, it
53 # may be unfair to fail the build entirely on the memory test alone.
54 # Therefore check-reqs_pkg_pretend is deliberately omitted so that we
55 # ewarn but not eerror.
63 python-single-r1_pkg_setup
68 cmake-utils_src_prepare
70 # Want to type "info ledger" not "info ledger3"
71 sed -i -e 's/ledger3/ledger/g' \
74 test/CheckTexinfo.py \
77 tools/prepare-commit-msg \
79 || die "Failed to update info file name in file contents"
81 mv doc/ledger{3,}.texi || die "Failed to rename info file name"
88 -DBUILD_EMACSLISP="$(usex emacs)"
89 -DBUILD_DOCS="$(usex doc)"
90 -DBUILD_WEB_DOCS="$(usex doc)"
91 -DUSE_PYTHON="$(usex python)"
92 -DCMAKE_INSTALL_DOCDIR="/usr/share/doc/${PF}"
93 -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON
96 cmake-utils_src_configure
100 cmake-utils_src_compile
102 use doc && cmake-utils_src_make doc
106 cmake-utils_src_install
108 use emacs && elisp-site-file-install "${FILESDIR}/${SITEFILE}"
112 use emacs && elisp-site-regen
115 einfo "Since version 3, vim support is released separately."
116 einfo "See https://github.com/ledger/vim-ledger"
121 use emacs && elisp-site-regen