From c88d3ed4bfd21f4ca4820d9815b1ec55f14dd414 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sun, 8 May 2022 04:20:00 +0000 Subject: [PATCH 1/3] ledger: add patch to xdg support --- pkgs/applications/office/ledger/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/office/ledger/default.nix b/pkgs/applications/office/ledger/default.nix index 0ea9b908ada..e0865d7c4d1 100644 --- a/pkgs/applications/office/ledger/default.nix +++ b/pkgs/applications/office/ledger/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, cmake, boost, gmp, mpfr, libedit, python3 -, texinfo, gnused, usePython ? true }: +, fetchpatch, texinfo, gnused, usePython ? true }: stdenv.mkDerivation rec { pname = "ledger"; @@ -34,6 +34,15 @@ stdenv.mkDerivation rec { --replace 'DESTINATION ''${Python_SITEARCH}' 'DESTINATION "${python3.sitePackages}"' ''; + patches = [ + # Add support for $XDG_CONFIG_HOME. Remove with the next release + (fetchpatch { + url = "https://github.com/ledger/ledger/commit/c79674649dee7577d6061e3d0776922257520fd0.patch"; + sha256 = "sha256-vwVQnY9EUCXPzhDJ4PSOmQStb9eF6H0yAOiEmL6sAlk="; + excludes = [ "doc/NEWS.md" ]; + }) + ]; + installTargets = [ "doc" "install" ]; meta = with lib; { From 1d5f520da8f01d147640e75b8c14ec3263bb7a42 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sun, 8 May 2022 04:20:00 +0000 Subject: [PATCH 2/3] ledger: install bash completion --- pkgs/applications/office/ledger/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/office/ledger/default.nix b/pkgs/applications/office/ledger/default.nix index e0865d7c4d1..17b0a69e04a 100644 --- a/pkgs/applications/office/ledger/default.nix +++ b/pkgs/applications/office/ledger/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, cmake, boost, gmp, mpfr, libedit, python3 -, fetchpatch, texinfo, gnused, usePython ? true }: +, fetchpatch, installShellFiles, texinfo, gnused, usePython ? true }: stdenv.mkDerivation rec { pname = "ledger"; @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { gmp mpfr libedit gnused ] ++ lib.optional usePython python3; - nativeBuildInputs = [ cmake texinfo ]; + nativeBuildInputs = [ cmake texinfo installShellFiles ]; cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" @@ -45,6 +45,10 @@ stdenv.mkDerivation rec { installTargets = [ "doc" "install" ]; + postInstall = '' + installShellCompletion --cmd ledger --bash $src/contrib/ledger-completion.bash + ''; + meta = with lib; { homepage = "https://ledger-cli.org/"; description = "A double-entry accounting system with a command-line reporting interface"; From 9d22c5a51a07463869c48dba88013b4bca62e9b7 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sun, 8 May 2022 04:20:00 +0000 Subject: [PATCH 3/3] ledger: add marsam to maintainers --- pkgs/applications/office/ledger/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/office/ledger/default.nix b/pkgs/applications/office/ledger/default.nix index 17b0a69e04a..83c47848bc4 100644 --- a/pkgs/applications/office/ledger/default.nix +++ b/pkgs/applications/office/ledger/default.nix @@ -62,6 +62,6 @@ stdenv.mkDerivation rec { ''; platforms = platforms.all; - maintainers = with maintainers; [ jwiegley ]; + maintainers = with maintainers; [ jwiegley marsam ]; }; }