Add libexttextcat (part of LibreOffice)
This commit is contained in:
parent
38d07f5018
commit
c5f9ee3325
18
pkgs/development/libraries/libexttextcat/default.nix
Normal file
18
pkgs/development/libraries/libexttextcat/default.nix
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{ stdenv, fetchurl }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "libexttextcat-3.3.1";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "http://dev-www.libreoffice.org/src/libexttextcat/${name}.tar.xz";
|
||||||
|
sha256 = "1a7ablpipfbiyhl6wsraj5z8pj3qkqgnrms73wzsqhpbyww334h4";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [ ./memory-leaks.patch ];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "An N-Gram-Based Text Categorization library primarily intended for language guessing";
|
||||||
|
homepage = http://www.freedesktop.org/wiki/Software/libexttextcat;
|
||||||
|
platforms = stdenv.lib.platforms.all;
|
||||||
|
};
|
||||||
|
}
|
37
pkgs/development/libraries/libexttextcat/memory-leaks.patch
Normal file
37
pkgs/development/libraries/libexttextcat/memory-leaks.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
Combined upstream commits 980592386f23db8b0dc84c434805cb167d0cc091 and
|
||||||
|
5ef4ad86ec934282cba891922ec2d13784da3354.
|
||||||
|
diff -u b/src/textcat.c b/src/textcat.c
|
||||||
|
--- b/src/textcat.c
|
||||||
|
+++ b/src/textcat.c
|
||||||
|
@@ -212,8 +212,6 @@
|
||||||
|
sizeof(char) * (tmp_size + 1));
|
||||||
|
if (tmp == NULL)
|
||||||
|
{
|
||||||
|
- free(finger_print_file_name);
|
||||||
|
- finger_print_file_name_size = 0;
|
||||||
|
goto BAILOUT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
@@ -226,10 +224,7 @@
|
||||||
|
strcat(finger_print_file_name, segment[0]);
|
||||||
|
|
||||||
|
if (fp_Read(h->fprint[h->size], finger_print_file_name, 400) == 0)
|
||||||
|
- {
|
||||||
|
- textcat_Done(h);
|
||||||
|
goto BAILOUT;
|
||||||
|
- }
|
||||||
|
h->fprint_disable[h->size] = 0xF0; /* 0xF0 is the code for enabled
|
||||||
|
languages, 0x0F is for disabled
|
||||||
|
*/
|
||||||
|
@@ -242,9 +237,10 @@
|
||||||
|
return h;
|
||||||
|
|
||||||
|
BAILOUT:
|
||||||
|
+ free(finger_print_file_name);
|
||||||
|
fclose(fp);
|
||||||
|
+ textcat_Done(h);
|
||||||
|
return NULL;
|
||||||
|
-
|
||||||
|
}
|
||||||
|
|
||||||
|
extern candidate_t *textcat_GetClassifyFullOutput(void *handle)
|
@ -4097,6 +4097,8 @@ let
|
|||||||
libmpeg2 = mpeg2dec;
|
libmpeg2 = mpeg2dec;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
libexttextcat = callPackage ../development/libraries/libexttextcat {};
|
||||||
|
|
||||||
libf2c = callPackage ../development/libraries/libf2c {};
|
libf2c = callPackage ../development/libraries/libf2c {};
|
||||||
|
|
||||||
libfixposix = callPackage ../development/libraries/libfixposix {};
|
libfixposix = callPackage ../development/libraries/libfixposix {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user