2023-12-06 15:19:48 +00:00
|
|
|
{ lib, stdenv, fetchurl, cmake, imagemagick, testers }:
|
2009-02-09 20:37:11 +00:00
|
|
|
|
2023-12-06 15:19:48 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "cuneiform";
|
2013-01-16 12:43:35 +00:00
|
|
|
version = "1.1.0";
|
2016-01-24 15:50:54 +00:00
|
|
|
|
2017-09-02 16:53:06 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://launchpad.net/cuneiform-linux/1.1/1.1/+download/cuneiform-linux-1.1.0.tar.bz2";
|
|
|
|
sha256 = "1bdvppyfx2184zmzcylskd87cxv56d8f32jf7g1qc8779l2hszjp";
|
2009-02-09 20:37:11 +00:00
|
|
|
};
|
|
|
|
|
2017-09-02 16:53:06 +00:00
|
|
|
patches = [
|
|
|
|
(fetchurl {
|
2021-07-14 00:41:39 +00:00
|
|
|
url = "https://raw.githubusercontent.com/archlinux/svntogit-community/a2ec92f05de006b56d16ac6a6c370d54a554861a/cuneiform/trunk/build-fix.patch";
|
2017-09-02 16:53:06 +00:00
|
|
|
sha256 = "19cmrlx4khn30qqrpyayn7bicg8yi0wpz1x1bvqqrbvr3kwldxyj";
|
|
|
|
})
|
2022-04-18 14:01:28 +00:00
|
|
|
(fetchurl {
|
|
|
|
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-text/cuneiform/files/cuneiform-1.1.0-gcc11.patch";
|
|
|
|
sha256 = "14bp2f4dvlgxnpdza1rgszhkbxhp6p7lhgnb1s7c1x7vwdrx0ri7";
|
|
|
|
})
|
2016-01-24 15:50:54 +00:00
|
|
|
];
|
2009-02-09 20:37:11 +00:00
|
|
|
|
2022-05-12 21:33:10 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains like upstream
|
|
|
|
# gcc-10. Otherwise build fails as:
|
|
|
|
# ld: CMakeFiles/rbal.dir/src/statsearchbl.cpp.o:(.bss+0x0):
|
|
|
|
# multiple definition of `minrow'; CMakeFiles/rbal.dir/src/linban.c.o:(.bss+0xa3a): first defined here
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-05-12 21:33:10 +00:00
|
|
|
|
2017-11-09 05:01:37 +00:00
|
|
|
postPatch = ''
|
|
|
|
rm cuneiform_src/Kern/hhh/tigerh/h/strings.h
|
|
|
|
'';
|
|
|
|
|
2023-12-06 15:19:48 +00:00
|
|
|
# make the install path match the rpath
|
|
|
|
postInstall = ''
|
|
|
|
if [[ -d ''${!outputLib}/lib64 ]]; then
|
|
|
|
mv ''${!outputLib}/lib64 ''${!outputLib}/lib
|
|
|
|
ln -s lib ''${!outputLib}/lib64
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2017-09-02 16:53:06 +00:00
|
|
|
buildInputs = [ imagemagick ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2023-12-06 15:19:48 +00:00
|
|
|
passthru.tests = testers.testVersion {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
command = "cuneiform";
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-08-24 14:21:08 +00:00
|
|
|
description = "Multi-language OCR system";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://launchpad.net/cuneiform-linux";
|
2018-09-11 21:22:22 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.raskin ];
|
2023-11-23 02:51:17 +00:00
|
|
|
mainProgram = "cuneiform";
|
2009-02-09 20:37:11 +00:00
|
|
|
};
|
2023-12-06 15:19:48 +00:00
|
|
|
})
|