2015-09-15 06:27:19 +02:00
|
|
|
a @ { cmake, patchelf, imagemagick, ... } :
|
|
|
|
let
|
2009-02-09 21:37:11 +01:00
|
|
|
fetchurl = a.fetchurl;
|
|
|
|
|
2013-01-16 13:43:35 +01:00
|
|
|
version = "1.1.0";
|
2009-02-09 21:37:11 +01:00
|
|
|
buildInputs = with a; [
|
|
|
|
cmake imagemagick patchelf
|
|
|
|
];
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
src = fetchurl {
|
2013-01-17 08:21:04 +01:00
|
|
|
url = "https://launchpad.net/cuneiform-linux/1.1/1.1/+download/cuneiform-linux-1.1.0.tar.bz2";
|
2013-01-16 13:43:35 +01:00
|
|
|
sha256 = "1bdvppyfx2184zmzcylskd87cxv56d8f32jf7g1qc8779l2hszjp";
|
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(''
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $PWD/builddir
|
2009-02-09 21:37:11 +01:00
|
|
|
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"];
|
2015-09-15 06:27:19 +02:00
|
|
|
|
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(''
|
2015-01-15 05:25:26 +01:00
|
|
|
patchelf --set-rpath $out/lib${if needLib64 then "64" else ""}${if a.stdenv.cc.cc != null then ":${a.stdenv.cc.cc}/lib" else ""}${if a.stdenv.cc.cc != null && needLib64 then ":${a.stdenv.cc.cc}/lib64" else ""}:${a.imagemagick}/lib $out/bin/cuneiform
|
2009-02-09 21:37:11 +01:00
|
|
|
'') ["minInit" "addInputs" "doMakeInstall"];
|
|
|
|
|
|
|
|
name = "cuneiform-" + version;
|
|
|
|
meta = {
|
2013-10-20 19:10:49 +02:00
|
|
|
inherit version;
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "Multi-language OCR system";
|
2009-02-09 21:37:11 +01:00
|
|
|
};
|
|
|
|
}
|