2009-02-09 21:37:11 +01:00
|
|
|
a :
|
|
|
|
let
|
|
|
|
fetchurl = a.fetchurl;
|
|
|
|
|
2010-07-06 13:12:33 +02:00
|
|
|
version = a.lib.attrByPath ["version"] "1.0" a;
|
2009-02-09 21:37:11 +01:00
|
|
|
buildInputs = with a; [
|
|
|
|
cmake imagemagick patchelf
|
|
|
|
];
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
src = fetchurl {
|
2010-07-06 13:12:33 +02:00
|
|
|
url = "http://launchpad.net/cuneiform-linux/${version}/${version}/+download/cuneiform-linux-${version}.0.tar.bz2";
|
|
|
|
sha256 = "bfa7acc6aade966ab62bc0f19e0ac1a843b659a70202229570c087ca8b15f39e";
|
2009-02-09 21:37:11 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
inherit buildInputs;
|
|
|
|
configureFlags = [];
|
|
|
|
|
|
|
|
/* doConfigure should be removed if not needed */
|
|
|
|
phaseNames = ["doCmake" "doMakeInstall" "postInstall"];
|
|
|
|
|
2009-02-10 14:54:05 +01:00
|
|
|
libc = if a.stdenv ? glibc then a.stdenv.glibc else "";
|
2009-02-09 21:37:11 +01:00
|
|
|
|
2009-05-20 01:25:58 +02:00
|
|
|
doCmake = a.fullDepEntry(''
|
2009-02-09 21:37:11 +01:00
|
|
|
ensureDir $PWD/builddir
|
|
|
|
cd builddir
|
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -ldl -L$out/lib"
|
|
|
|
cmake .. -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=$out -DDL_LIB=${libc}/lib
|
|
|
|
'') ["minInit" "addInputs" "doUnpack" "defEnsureDir"];
|
|
|
|
|
2011-06-09 10:23:58 +02:00
|
|
|
needLib64 = a.stdenv.system == "x86_64-linux";
|
|
|
|
|
2009-05-20 01:25:58 +02:00
|
|
|
postInstall = a.fullDepEntry(''
|
2011-06-09 10:23:58 +02:00
|
|
|
patchelf --set-rpath $out/lib${if needLib64 then "64" else ""}${if a.stdenv.gcc.gcc != null then ":${a.stdenv.gcc.gcc}/lib" else ""}${if a.stdenv.gcc.gcc != null && needLib64 then ":${a.stdenv.gcc.gcc}/lib64" else ""}:${a.imagemagick}/lib $out/bin/cuneiform
|
2009-02-09 21:37:11 +01:00
|
|
|
'') ["minInit" "addInputs" "doMakeInstall"];
|
|
|
|
|
|
|
|
name = "cuneiform-" + version;
|
|
|
|
meta = {
|
|
|
|
description = "Cuneiform OCR";
|
|
|
|
};
|
|
|
|
}
|