From 751b64d656a9447584255ad1c0b04becb18087bf Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Wed, 8 Feb 2023 04:20:00 +0000 Subject: [PATCH 1/4] ledger: 3.2.1 -> 3.3.0 https://github.com/ledger/ledger/releases/tag/v3.3.0 --- pkgs/applications/office/ledger/default.nix | 22 +++------------------ 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/pkgs/applications/office/ledger/default.nix b/pkgs/applications/office/ledger/default.nix index e885e03c1cd2..2c0ecf21a2e3 100644 --- a/pkgs/applications/office/ledger/default.nix +++ b/pkgs/applications/office/ledger/default.nix @@ -1,15 +1,15 @@ { stdenv, lib, fetchFromGitHub, cmake, boost, gmp, mpfr, libedit, python3 -, fetchpatch, installShellFiles, texinfo, gnused, usePython ? true }: +, installShellFiles, texinfo, gnused, usePython ? true }: stdenv.mkDerivation rec { pname = "ledger"; - version = "3.2.1"; + version = "3.3.0"; src = fetchFromGitHub { owner = "ledger"; repo = "ledger"; rev = "v${version}"; - sha256 = "0x6jxwss3wwzbzlwmnwb8yzjk8f9wfawif4f1b74z2qg6hc4r7f6"; + hash = "sha256-0hN6Hpmgwb3naV2K1fxX0OyH0IyCQAh1nZ9TMNAutic="; }; outputs = [ "out" "dev" "py" ]; @@ -34,22 +34,6 @@ stdenv.mkDerivation rec { --replace 'DESTINATION ''${Python_SITEARCH}' 'DESTINATION "${placeholder "py"}/${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" ]; - }) - - # Fix included bug with boost >= 1.76. Remove with the next release - (fetchpatch { - url = "https://github.com/ledger/ledger/commit/1cb9b84fdecc5604bd1172cdd781859ff3871a52.patch"; - sha256 = "sha256-ipVkRcTmnEvpfyPgMzLVJ9Sz8QxHeCURQI5dX8xh758="; - excludes = [ "test/regress/*" ]; - }) - ]; - installTargets = [ "doc" "install" ]; postInstall = '' From 1d421778b7fd7fe5908b73c7e40efa0a98daf4a0 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Wed, 8 Feb 2023 04:20:00 +0000 Subject: [PATCH 2/4] ledger: do not build with python by default --- pkgs/applications/office/ledger/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/office/ledger/default.nix b/pkgs/applications/office/ledger/default.nix index 2c0ecf21a2e3..3ac52ce78784 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 -, installShellFiles, texinfo, gnused, usePython ? true }: +, installShellFiles, texinfo, gnused, usePython ? false }: stdenv.mkDerivation rec { pname = "ledger"; @@ -12,19 +12,20 @@ stdenv.mkDerivation rec { hash = "sha256-0hN6Hpmgwb3naV2K1fxX0OyH0IyCQAh1nZ9TMNAutic="; }; - outputs = [ "out" "dev" "py" ]; + outputs = [ "out" "dev" ] ++ lib.optionals usePython [ "py" ]; buildInputs = [ - (boost.override { enablePython = usePython; python = python3; }) gmp mpfr libedit gnused - ] ++ lib.optional usePython python3; + ] ++ (if usePython + then [ python3 (boost.override { enablePython = true; python = python3; }) ] + else [ boost ]); nativeBuildInputs = [ cmake texinfo installShellFiles ]; cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" "-DBUILD_DOCS:BOOL=ON" - (lib.optionalString usePython "-DUSE_PYTHON=true") + "-DUSE_PYTHON:BOOL=${if usePython then "ON" else "OFF"}" ]; # by default, it will query the python interpreter for it's sitepackages location From 253e69362e181fe1e03b7f37d4329be0c92ec51d Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Wed, 8 Feb 2023 04:20:00 +0000 Subject: [PATCH 3/4] ledger: update meta --- pkgs/applications/office/ledger/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/office/ledger/default.nix b/pkgs/applications/office/ledger/default.nix index 3ac52ce78784..4a7e66f660c9 100644 --- a/pkgs/applications/office/ledger/default.nix +++ b/pkgs/applications/office/ledger/default.nix @@ -42,17 +42,16 @@ stdenv.mkDerivation rec { ''; meta = with lib; { - homepage = "https://ledger-cli.org/"; description = "A double-entry accounting system with a command-line reporting interface"; + homepage = "https://www.ledger-cli.org/"; + changelog = "https://github.com/ledger/ledger/raw/v${version}/NEWS.md"; 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. ''; - platforms = platforms.all; maintainers = with maintainers; [ jwiegley marsam ]; }; From d1d75855afd0b7360f7c876db786d0035269aec0 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Wed, 8 Feb 2023 04:20:00 +0000 Subject: [PATCH 4/4] ledger: add option to build with gpgme support --- pkgs/applications/office/ledger/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/office/ledger/default.nix b/pkgs/applications/office/ledger/default.nix index 4a7e66f660c9..181c627f238c 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 -, installShellFiles, texinfo, gnused, usePython ? false }: +{ stdenv, lib, fetchFromGitHub, cmake, boost, gmp, mpfr, libedit, python3, gpgme +, installShellFiles, texinfo, gnused, usePython ? false, gpgmeSupport ? false }: stdenv.mkDerivation rec { pname = "ledger"; @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { buildInputs = [ gmp mpfr libedit gnused + ] ++ lib.optionals gpgmeSupport [ + gpgme ] ++ (if usePython then [ python3 (boost.override { enablePython = true; python = python3; }) ] else [ boost ]); @@ -26,6 +28,7 @@ stdenv.mkDerivation rec { "-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"}" ]; # by default, it will query the python interpreter for it's sitepackages location