summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2011-07-07 22:48:36 +0000
committerPeter Simons <simons@cryp.to>2011-07-07 22:48:36 +0000
commit80713bcc75e265f7e5cd3c04cd4c05e829ca56ab (patch)
treedb5a4da50052bc5ffd2e2d5474b6f5c63a052c9d /pkgs/applications
parentebefce41aa4ffbd9facd5d3a06632a96676616ff (diff)
downloadnixpkgs-80713bcc75e265f7e5cd3c04cd4c05e829ca56ab.tar
nixpkgs-80713bcc75e265f7e5cd3c04cd4c05e829ca56ab.tar.gz
nixpkgs-80713bcc75e265f7e5cd3c04cd4c05e829ca56ab.tar.bz2
nixpkgs-80713bcc75e265f7e5cd3c04cd4c05e829ca56ab.tar.lz
nixpkgs-80713bcc75e265f7e5cd3c04cd4c05e829ca56ab.tar.xz
nixpkgs-80713bcc75e265f7e5cd3c04cd4c05e829ca56ab.tar.zst
nixpkgs-80713bcc75e265f7e5cd3c04cd4c05e829ca56ab.zip
ledger: fixed build
 * Patchelf doesn't work for this program. Fortunately, we don't need patchelf,
   because libtool takes care of hard-coding the proper rpaths.

 * Updated home page address.

 * Build with more aggressive optimization flags.

 * Drop the obsolete const-fix patch.

svn path=/nixpkgs/trunk/; revision=27657
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/office/ledger/default.nix52
1 files changed, 28 insertions, 24 deletions
diff --git a/pkgs/applications/office/ledger/default.nix b/pkgs/applications/office/ledger/default.nix
index 99b768c58e1..010e5c48c1f 100644
--- a/pkgs/applications/office/ledger/default.nix
+++ b/pkgs/applications/office/ledger/default.nix
@@ -1,48 +1,52 @@
-# TODO: fix a problem with patchelf(?)
+# Patchelf fails to hard-code the library paths to ledger's
+# libamounts.so and libledger-2.6.3 shared objects:
+#
+# $ ldd ~/.nix-profile/bin/ledger
+#         linux-vdso.so.1 =>  (0x00007fff513ff000)
+#         libamounts.so.0 => not found
+#         libledger-2.6.3.so => not found
+#         libstdc++.so.6 => /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib/../lib64/libstdc++.so.6 (0x00007f1f0feee000)
+#         libpcre.so.0 => /nix/store/kfhy189arpj3wrfzpgw8p9ac4g4hfgca-pcre-8.10/lib/libpcre.so.0 (0x00007f1f0fcd3000)
+#         libgmp.so.3 => /nix/store/ji6py9m9w2ray1bmpkmgig9llj1i2ggf-gmp-4.3.2/lib/libgmp.so.3 (0x00007f1f0fa7f000)
+#         libm.so.6 => /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libm.so.6 (0x00007f1f0f7fd000)
+#         libgcc_s.so.1 => /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib/../lib64/libgcc_s.so.1 (0x00007f1f0f5e8000)
+#         libc.so.6 => /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libc.so.6 (0x00007f1f0f27d000)
+#         /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/ld-linux-x86-64.so.2 (0x00007f1f101ef000)
+#
+# Fortunately, libtools builds the program with proper paths hard-coded
+# alread, so we don't need patchelf. Phew!
 
 {stdenv, fetchurl, emacs, gmp, pcre}:
 
 let
-
-  pname = "ledger";
-  version = "2.6.3";
-  name = "${pname}-${version}";
-
+  name = "ledger-2.6.3";
 in
-
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
-    url = "https://github.com/downloads/jwiegley/ledger/ledger-${version}.tar.gz";
+    url = "https://github.com/downloads/jwiegley/ledger/${name}.tar.gz";
     sha256 = "05zpnypcwgck7lwk00pbdlcwa347xsqifxh4zsbbn01m98bx1v5k";
   };
 
   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
-  '';
+  configureFlags = "CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3";
+  dontPatchELF = true;
 
   meta = {
-    description =
-     "A double-entry accounting system with a command-line reporting interface";
+    homepage = "http://ledger-cli.org/";
+    description = "A double-entry accounting system with a command-line reporting interface";
+    license = "BSD";
+
     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";
+
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.simons ];
   };
 }