2009-02-09 20:37:11 +00:00
|
|
|
a :
|
|
|
|
let
|
|
|
|
fetchurl = a.fetchurl;
|
|
|
|
|
2010-07-06 12:12:33 +01:00
|
|
|
version = a.lib.attrByPath ["version"] "1.0" a;
|
2009-02-09 20:37:11 +00:00
|
|
|
buildInputs = with a; [
|
|
|
|
cmake imagemagick patchelf
|
|
|
|
];
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
src = fetchurl {
|
2010-07-06 12:12:33 +01:00
|
|
|
url = "http://launchpad.net/cuneiform-linux/${version}/${version}/+download/cuneiform-linux-${version}.0.tar.bz2";
|
|
|
|
sha256 = "bfa7acc6aade966ab62bc0f19e0ac1a843b659a70202229570c087ca8b15f39e";
|
2009-02-09 20:37:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
inherit buildInputs;
|
|
|
|
configureFlags = [];
|
|
|
|
|
|
|
|
/* doConfigure should be removed if not needed */
|
|
|
|
phaseNames = ["doCmake" "doMakeInstall" "postInstall"];
|
|
|
|
|
2009-02-10 13:54:05 +00:00
|
|
|
libc = if a.stdenv ? glibc then a.stdenv.glibc else "";
|
2009-02-09 20:37:11 +00:00
|
|
|
|
2009-05-20 00:25:58 +01:00
|
|
|
doCmake = a.fullDepEntry(''
|
2009-02-09 20:37:11 +00: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"];
|
|
|
|
|
2009-05-20 00:25:58 +01:00
|
|
|
postInstall = a.fullDepEntry(''
|
2009-02-10 16:09:43 +00:00
|
|
|
patchelf --set-rpath $out/lib${if a.stdenv.gcc.gcc != null then ":${a.stdenv.gcc.gcc}/lib" else ""} $out/bin/cuneiform
|
2009-02-09 20:37:11 +00:00
|
|
|
'') ["minInit" "addInputs" "doMakeInstall"];
|
|
|
|
|
|
|
|
name = "cuneiform-" + version;
|
|
|
|
meta = {
|
|
|
|
description = "Cuneiform OCR";
|
|
|
|
};
|
|
|
|
}
|