Add package ledger
[nixpkgs-libre.git] / pkgs / applications / office / ledger / default.nix
blobc6c2fd4d1b1905ee1e22d806a6bcb05d064a5089
1 # TODO: fix a problem with patchelf(?)
3 {stdenv, fetchurl, emacs, gmp, pcre}:
5 let
7   pname = "ledger";
8   version = "2.6.1";
9   name = "${pname}-${version}";
13 stdenv.mkDerivation {
14   inherit name;
16   src = fetchurl {
17     url = "mirror://sourceforge/${pname}/${name}.tar.gz";
18     sha256 = "96830d77d3aa6bf6c5778f5dd52169f9b5203fb7daad0e12831abeb35b14f27a";
19   };
21   buildInputs = [ emacs gmp pcre ];
23   # Something goes wrong with pathelf...
24   # this is a small workaround: adds a small shell script for
25   # setting LD_LIBRARY_PATH
26   postInstall = ''
27     cd $out/bin
28     mv ledger ledger.bin
29     echo "#!/bin/sh" > ledger
30     echo "LD_LIBRARY_PATH=$out/lib $out/bin/ledger.bin "'"$@"' >> ledger
31     chmod +x ledger
32   '';
34   meta = {
35     description =
36      "A double-entry accounting system with a command-line reporting interface";
37     longDescription = ''
38       Ledger is a powerful, double-entry accounting system that is accessed
39       from the UNIX command-line. This may put off some users, as there is
40       no flashy UI, but for those who want unparalleled reporting access to
41       their data, there really is no alternative.
42     '';
43     homepage = http://wiki.github.com/jwiegley/ledger;
44     license = "BSD";
45   };