summary refs log tree commit diff
path: root/pkgs/applications/office/ledger/default.nix
blob: 14121e6281f4376b35493eeb9f325e751693810f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# TODO: fix a problem with patchelf(?)

{stdenv, fetchurl, emacs, gmp, pcre}:

let

  pname = "ledger";
  version = "2.6.1";
  name = "${pname}-${version}";

in

stdenv.mkDerivation {
  inherit name;

  src = fetchurl {
    url = "mirror://sourceforge/${pname}/${name}.tar.gz";
    sha256 = "96830d77d3aa6bf6c5778f5dd52169f9b5203fb7daad0e12831abeb35b14f27a";
  };

  buildInputs = [ emacs gmp pcre ];

  patches = [ ./const.patch ];

  # Something goes wrong with pathelf...
  # this is a small workaround: adds a small shell script for
  # setting LD_LIBRARY_PATH
  postInstall = ''
    cd $out/bin
    mv ledger ledger.bin
    echo "#!/bin/sh" > ledger
    echo "LD_LIBRARY_PATH=$out/lib $out/bin/ledger.bin "'"$@"' >> ledger
    chmod +x ledger
  '';

  meta = {
    description =
     "A double-entry accounting system with a command-line reporting interface";
    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.
    '';
    homepage = http://wiki.github.com/jwiegley/ledger;
    license = "BSD";
  };
}