nixpkgs/pkgs/applications/office/ledger/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
2.1 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitHub, cmake, boost, gmp, mpfr, libedit, python3, gpgme
, installShellFiles, texinfo, gnused, usePython ? false, gpgmeSupport ? false }:
2017-08-31 03:51:10 +00:00
stdenv.mkDerivation rec {
pname = "ledger";
version = "3.3.1";
2017-08-31 03:51:10 +00:00
src = fetchFromGitHub {
owner = "ledger";
repo = "ledger";
2019-03-31 16:39:41 +00:00
rev = "v${version}";
hash = "sha256-CnMzsFKBNiXmatgY7aiK8UCqIL6qifA4KbV6BJaza40=";
};
outputs = [ "out" "dev" ] ++ lib.optionals usePython [ "py" ];
2020-08-02 00:25:55 +00:00
buildInputs = [
gmp mpfr libedit gnused
] ++ lib.optionals gpgmeSupport [
gpgme
] ++ (if usePython
then [ python3 (boost.override { enablePython = true; python = python3; }) ]
else [ boost ]);
2017-08-31 03:51:10 +00:00
2022-05-08 04:20:00 +00:00
nativeBuildInputs = [ cmake texinfo installShellFiles ];
2018-12-21 20:36:29 +00:00
cmakeFlags = [
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DBUILD_DOCS:BOOL=ON"
"-DUSE_PYTHON:BOOL=${if usePython then "ON" else "OFF"}"
"-DUSE_GPGME:BOOL=${if gpgmeSupport then "ON" else "OFF"}"
2020-08-02 00:25:55 +00:00
];
2018-12-21 20:36:29 +00:00
2020-08-02 00:25:55 +00:00
# by default, it will query the python interpreter for it's sitepackages location
# however, that would write to a different nixstore path, pass our own sitePackages location
prePatch = lib.optionalString usePython ''
substituteInPlace src/CMakeLists.txt \
2022-05-19 04:20:00 +00:00
--replace 'DESTINATION ''${Python_SITEARCH}' 'DESTINATION "${placeholder "py"}/${python3.sitePackages}"'
2018-12-21 20:36:29 +00:00
'';
2016-09-07 22:03:50 +00:00
2020-08-02 00:25:55 +00:00
installTargets = [ "doc" "install" ];
2022-05-08 04:20:00 +00:00
postInstall = ''
installShellCompletion --cmd ledger --bash $src/contrib/ledger-completion.bash
'';
2020-08-02 00:25:55 +00:00
meta = with lib; {
description = "A double-entry accounting system with a command-line reporting interface";
2023-02-08 04:20:00 +00:00
homepage = "https://www.ledger-cli.org/";
changelog = "https://github.com/ledger/ledger/raw/v${version}/NEWS.md";
2017-08-31 03:51:10 +00:00
license = licenses.bsd3;
longDescription = ''
Ledger is a powerful, double-entry accounting system that is accessed
from the UNIX command-line. This may put off some users, as there is
no flashy UI, but for those who want unparalleled reporting access to
their data, there really is no alternative.
'';
2017-08-31 03:51:10 +00:00
platforms = platforms.all;
2022-05-08 04:20:00 +00:00
maintainers = with maintainers; [ jwiegley marsam ];
};
}