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

57 lines
1.7 KiB
Nix
Raw Normal View History

2020-08-02 03:25:55 +03:00
{ stdenv, lib, fetchFromGitHub, cmake, boost, gmp, mpfr, libedit, python
, texinfo, gnused, usePython ? true }:
2017-08-31 06:51:10 +03:00
stdenv.mkDerivation rec {
pname = "ledger";
2020-08-02 03:25:55 +03:00
version = "3.2.1";
2017-08-31 06:51:10 +03:00
src = fetchFromGitHub {
owner = "ledger";
repo = "ledger";
2019-03-31 19:39:41 +03:00
rev = "v${version}";
2020-08-02 03:25:55 +03:00
sha256 = "0x6jxwss3wwzbzlwmnwb8yzjk8f9wfawif4f1b74z2qg6hc4r7f6";
};
2020-08-02 03:25:55 +03:00
outputs = [ "out" "dev" ];
buildInputs = [
(boost.override { enablePython = usePython; })
2020-08-02 03:25:55 +03:00
gmp mpfr libedit python gnused
];
2017-08-31 06:51:10 +03:00
2020-08-02 03:25:55 +03:00
nativeBuildInputs = [ cmake texinfo ];
enableParallelBuilding = true;
2018-12-21 23:36:29 +03:00
cmakeFlags = [
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DBUILD_DOCS:BOOL=ON"
2020-08-02 03:25:55 +03:00
(lib.optionalString usePython "-DUSE_PYTHON=true")
];
2018-12-21 23:36:29 +03:00
2020-08-02 03:25:55 +03: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 \
--replace 'DESTINATION ''${Python_SITEARCH}' 'DESTINATION "${python.sitePackages}"'
2018-12-21 23:36:29 +03:00
'';
2016-09-08 01:03:50 +03:00
2020-08-02 03:25:55 +03:00
installTargets = [ "doc" "install" ];
meta = with lib; {
homepage = "https://ledger-cli.org/";
description = "A double-entry accounting system with a command-line reporting interface";
2017-08-31 06:51:10 +03: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 06:51:10 +03:00
platforms = platforms.all;
maintainers = with maintainers; [ jwiegley ];
};
}