diff --git a/graphics/Makefile b/graphics/Makefile index 9142e30aea30..8f8e64f33bfe 100644 --- a/graphics/Makefile +++ b/graphics/Makefile @@ -75,6 +75,7 @@ SUBDIR += crystalspace SUBDIR += crystalspace-devel SUBDIR += cthumb + SUBDIR += cuneiform SUBDIR += curator SUBDIR += cuttlefish SUBDIR += danpei diff --git a/graphics/cuneiform/Makefile b/graphics/cuneiform/Makefile new file mode 100644 index 000000000000..2c378fa20650 --- /dev/null +++ b/graphics/cuneiform/Makefile @@ -0,0 +1,48 @@ +# New ports collection makefile for: cuneiform +# Date created: 2008/08/23 +# Whom: samm +# +# $FreeBSD$ +# + +PORTNAME= cuneiform +PORTVERSION= 0.3.1 +CATEGORIES= graphics +MASTER_SITES= https://launchpad.net/cuneiform-linux/${PORTVERSION:R}/${PORTVERSION:R}/+download/ + +MAINTAINER= samm@os2.kiev.ua +COMMENT= OCR system developed and open sourced by Cognitive technologies + +LIB_DEPENDS= dlmalloc.2:${PORTSDIR}/devel/libdlmalloc + +USE_BZIP2= yes +USE_CMAKE= yes +CMAKE_ARGS= -DCMAKE_EXE_LINKER_FLAGS="-L${LOCALBASE}/lib -ldlmalloc" +USE_LDCONFIG= yes + +PATCH_WRKSRC= ${WRKDIR}/${DISTNAME} +WRKSRC= ${WRKDIR}/${DISTNAME}/build +CMAKE_SOURCE_PATH=.. + +CPPFLAGS+= -I${LOCALBASE}/include +CFLAGS+= -I${LOCALBASE}/include + +OPTIONS= IMAGEMAGICK "Enable support of different graphic formats" off + +.include + +.if defined(WITH_IMAGEMAGICK) +LIB_DEPENDS+= MagickWand.1:${PORTSDIR}/graphics/ImageMagick +.endif + +post-extract: + ${MKDIR} ${WRKSRC} + +post-patch: + @${REINPLACE_CMD} -e 's|lib64|lib|' ${WRKSRC}/../CMakeLists.txt +.if !defined(WITH_IMAGEMAGICK) + @${REINPLACE_CMD} -e '/pkg_check_modules.*ImageMagick/ d' \ + ${WRKSRC}/../cuneiform_src/Kern/CMakeLists.txt +.endif + +.include diff --git a/graphics/cuneiform/distinfo b/graphics/cuneiform/distinfo new file mode 100644 index 000000000000..4ceda334befb --- /dev/null +++ b/graphics/cuneiform/distinfo @@ -0,0 +1,3 @@ +MD5 (cuneiform-0.3.1.tar.bz2) = 4b819517200764a5423329dc45033c16 +SHA256 (cuneiform-0.3.1.tar.bz2) = 9a48da92489b44d86db06e3aa273afb2375d19161e94e293d74341dbdab92971 +SIZE (cuneiform-0.3.1.tar.bz2) = 30110799 diff --git a/graphics/cuneiform/files/patch-upstream b/graphics/cuneiform/files/patch-upstream new file mode 100644 index 000000000000..898df95c00d1 --- /dev/null +++ b/graphics/cuneiform/files/patch-upstream @@ -0,0 +1,213 @@ +=== modified file 'cuneiform_src/Kern/ccom/src/ccom_loc.c' +--- cuneiform_src/Kern/ccom/src/ccom_loc.c 2008-07-29 09:38:01 +0000 ++++ cuneiform_src/Kern/ccom/src/ccom_loc.c 2008-08-22 08:22:46 +0000 +@@ -87,7 +87,7 @@ + + if (bChangeSize) // one should change a size of raster + { +- for(line=linerep,wmax=len=0; lenlth; len+=line->lth,line=(CCOM_lnhead *)((int)line+line->lth)) ++ for(line=linerep,wmax=len=0; lenlth; len+=line->lth,line=(CCOM_lnhead *)((intptr_t)line+line->lth)) + { + for(inter = (CCOM_interval*)(line+1), i=0; ih; i++, inter++) + { +@@ -106,7 +106,7 @@ + } + else //bChangeSize==false one should not change a size of raster + { +- for(line=linerep,wmax=len=0; lenlth; len+=line->lth,line=(CCOM_lnhead *)((int)line+line->lth)) ++ for(line=linerep,wmax=len=0; lenlth; len+=line->lth,line=(CCOM_lnhead *)((intptr_t)line+line->lth)) + { + for(inter = (CCOM_interval*)(line+1), i=0; ih; i++, inter++) + { +@@ -133,7 +133,7 @@ + return FALSE; + ww = REC_GW_WORD8(rec->lnPixWidth); + +-for(line=linerep,len=0; lenlth; len+=line->lth,line=(CCOM_lnhead *)((int)line+line->lth)) ++for(line=linerep,len=0; lenlth; len+=line->lth,line=(CCOM_lnhead *)((intptr_t)line+line->lth)) + { + for(inter = (CCOM_interval*)(line+1), i=0; ih; i++, inter++) + { +@@ -175,7 +175,7 @@ + return FALSE; + ww = REC_GW_WORD8(rec->lnPixWidth); + +-for(line=linerep,len=0; lenlth; len+=line->lth,line=(CCOM_lnhead *)((int)line+line->lth)) ++for(line=linerep,len=0; lenlth; len+=line->lth,line=(CCOM_lnhead *)((intptr_t)line+line->lth)) + { + for(inter = (CCOM_interval*)(line+1), i=0; ih; i++, inter++) + { + +=== modified file 'cuneiform_src/Kern/cuneiform-cli.cpp' +--- cuneiform_src/Kern/cuneiform-cli.cpp 2008-08-05 09:29:31 +0000 ++++ cuneiform_src/Kern/cuneiform-cli.cpp 2008-08-22 13:58:24 +0000 +@@ -41,8 +41,7 @@ + const char *name; + }; + +-/* Language codes according to ISO 639-2. Most of these don't seem to have +- * corresponding data files. A bug? ++/* Language codes according to ISO 639-2. + */ + static const langlist langs[] = { + {PUMA_LANG_ENGLISH, "eng"}, +@@ -60,10 +59,10 @@ + {PUMA_LANG_DANISH, "dan"}, + {PUMA_LANG_PORTUGUESE,"por"}, + {PUMA_LANG_DUTCH, "dut"}, +- {PUMA_LANG_DIG, "dig"}, // What is this language? +- {PUMA_LANG_UZBEK, "uzb"}, +- {PUMA_LANG_KAZ, "kaz"}, +- {PUMA_LANG_KAZ_ENG, "kazeng"}, ++// {PUMA_LANG_DIG, "dig"}, // These four languages don't seem to have data files. ++// {PUMA_LANG_UZBEK, "uzb"}, // Thus they are disabled. ++// {PUMA_LANG_KAZ, "kaz"}, ++// {PUMA_LANG_KAZ_ENG, "kazeng"}, + {PUMA_LANG_CZECH, "cze"}, + {PUMA_LANG_ROMAN, "rum"}, + {PUMA_LANG_HUNGAR, "hun"}, +@@ -160,6 +159,8 @@ + char *dib; + const char *infilename = NULL; + Word32 langcode = PUMA_LANG_ENGLISH; // By default recognize plain english text. ++ Bool32 dotmatrix = FALSE; ++ Bool32 fax = FALSE; + const char *defaulttextname = "cuneiform-out.txt"; + const char *defaulthtmlname = "cuneiform-out.html"; + const char *outfilename = NULL; +@@ -170,6 +171,7 @@ + for(int i=1; i= argc) { + print_supported_languages(); + return 1; +@@ -193,6 +195,10 @@ + outfilename = argv[i]; + } else if(strcmp(argv[i], "--html") == 0) { + outputformat = PUMA_TOHTML; ++ } else if(strcmp(argv[i], "--dotmatrix") == 0) { ++ dotmatrix = TRUE; ++ } else if(strcmp(argv[i], "--fax") == 0) { ++ fax = TRUE; + } else { + /* No switches, so set input file. */ + infilename = argv[i]; +@@ -208,7 +214,7 @@ + } + + if(infilename == NULL) { +- printf("Usage: %s [-l languagename --html -o result_file] imagefile\n", argv[0]); ++ printf("Usage: %s [-l languagename --html --dotmatrix --fax -o result_file] imagefile\n", argv[0]); + return 0; + } + +@@ -224,6 +230,8 @@ + + // Set the language. + PUMA_SetImportData(PUMA_Word32_Language, &langcode); ++ PUMA_SetImportData(PUMA_Bool32_DotMatrix, &dotmatrix); ++ PUMA_SetImportData(PUMA_Bool32_Fax100, &fax); + + if(!PUMA_XOpen(dib, "none.txt")) { + printf("PUMA_Xopen failed.\n"); + +=== modified file 'cuneiform_src/Kern/rblock/sources/h/pic_n_table.h' +--- cuneiform_src/Kern/rblock/sources/h/pic_n_table.h 2008-07-29 09:38:01 +0000 ++++ cuneiform_src/Kern/rblock/sources/h/pic_n_table.h 2008-08-22 08:22:46 +0000 +@@ -58,4 +58,4 @@ + Bool32 DeleteRootsFromTables (void); + Bool32 DeleteRootsFromPictures (void); + Bool32 CarefulPicturesAllotment(Int32); +-Bool32 SearchPicturesSecond (Int32 hCCOM, Bool32 BLOCKS, CCOM_comp * comp); ++Bool32 SearchPicturesSecond (Handle hCCOM, Bool32 BLOCKS, CCOM_comp * comp); + +=== modified file 'cuneiform_src/Kern/rblock/sources/new_c/_loadroots.c' +--- cuneiform_src/Kern/rblock/sources/new_c/_loadroots.c 2008-07-29 09:38:01 +0000 ++++ cuneiform_src/Kern/rblock/sources/new_c/_loadroots.c 2008-08-22 08:22:46 +0000 +@@ -223,7 +223,7 @@ + //////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////////// +-Bool32 PicturesSecondStage(Int32 hCCOM,Handle hCPAGE) ++Bool32 PicturesSecondStage(Handle hCCOM,Handle hCPAGE) + { + /************** final union all crossed and included pictures ******************/ + +@@ -527,9 +527,9 @@ + return TRUE; + } + +-Bool32 FillBigLetters (Int32 hCCOM,Handle hCPAGE) ++Bool32 FillBigLetters (Handle hCCOM,Handle hCPAGE) + { +- Word32 BlockType; ++ Handle BlockType; + Handle pBlock; + RPIC_Comp_Rect CompRect; // типичный Rect16 + +@@ -557,7 +557,7 @@ + } + + +-Bool32 FillPicsInTables (Int32 hCCOM,Handle hCPAGE) ++Bool32 FillPicsInTables (Handle hCCOM,Handle hCPAGE) + { + //CCOM_comp common; + POLY_ block; +@@ -622,7 +622,7 @@ + + /************************************************************************/ + +-Bool32 ReadRoots(Int32 hCCOM, Bool32 BLOCKS) ++Bool32 ReadRoots(Handle hCCOM, Bool32 BLOCKS) + { + CCOM_comp * comp = NULL; + Handle pPage; + +=== modified file 'cuneiform_src/Kern/rblock/sources/new_c/_pic_n_table.c' +--- cuneiform_src/Kern/rblock/sources/new_c/_pic_n_table.c 2008-07-29 09:38:01 +0000 ++++ cuneiform_src/Kern/rblock/sources/new_c/_pic_n_table.c 2008-08-22 08:22:46 +0000 +@@ -202,7 +202,7 @@ + return TRUE; + } + +-Bool32 SearchPicturesSecond (Int32 hCCOM, Bool32 BLOCKS, CCOM_comp * comp) ++Bool32 SearchPicturesSecond (Handle hCCOM, Bool32 BLOCKS, CCOM_comp * comp) + { + return TRUE; + } + +=== modified file 'cuneiform_src/Kern/rstr/src/p2_bold.c' +--- cuneiform_src/Kern/rstr/src/p2_bold.c 2008-07-29 09:38:01 +0000 ++++ cuneiform_src/Kern/rstr/src/p2_bold.c 2008-08-22 08:22:46 +0000 +@@ -230,7 +230,7 @@ + CCOM_interval * inter; + int len,i,j; + +- for(line=linerep,len=0; lenlth; len+=line->lth,line=(CCOM_lnhead *)((int)line+line->lth)) ++ for(line=linerep,len=0; lenlth; len+=line->lth,line=(CCOM_lnhead *)((intptr_t)line+line->lth)) + { + // начало линии (line->row) - нам не важно + for(inter = (CCOM_interval*)(line+1), i=0; ih; i++, inter++) + +=== modified file 'readme.txt' +--- readme.txt 2008-08-21 12:09:05 +0000 ++++ readme.txt 2008-08-22 13:01:28 +0000 +@@ -54,7 +54,7 @@ + + After install you simply run. + +-cuneiform [-l language -o result_file --html] ++cuneiform [-l language -o result_file --html --dotmatrix --fax] + + Output is written to pumaout.txt. Cuneiform assumes that your image contains + only a single column of text. +@@ -74,4 +74,4 @@ + Contact information + + Project home page: https://launchpad.net/cuneiform-linux +-Email: jpakkane at gmail ++Mailing list: https://launchpad.net/~cuneiform + diff --git a/graphics/cuneiform/pkg-descr b/graphics/cuneiform/pkg-descr new file mode 100644 index 000000000000..065d6556a08e --- /dev/null +++ b/graphics/cuneiform/pkg-descr @@ -0,0 +1,5 @@ +Cuneiform is an multi-language OCR system originally developed and open sourced +by Cognitive Technologies. Cuneiform was originally a Windows program, which +was ported to Linux by Jussi Pakkanen. + +WWW: https://launchpad.net/cuneiform-linux diff --git a/graphics/cuneiform/pkg-plist b/graphics/cuneiform/pkg-plist new file mode 100644 index 000000000000..734a01c89a78 --- /dev/null +++ b/graphics/cuneiform/pkg-plist @@ -0,0 +1,192 @@ +bin/cuneiform +lib/libccom.so +lib/libced.so +lib/libcfio.so +lib/libcimage.so +lib/libcline.so +lib/libcpage.so +lib/libcpu.so +lib/libcstr.so +lib/libctb32.so +lib/libdif.so +lib/libevn32.so +lib/libexc.so +lib/libfon.so +lib/libleo.so +lib/liblns32.so +lib/libloc.so +lib/libmmx.so +lib/libmsk.so +lib/libpass2.so +lib/libpuma.so +lib/libr35.so +lib/librbal.so +lib/librblock.so +lib/librcorrkegl.so +lib/librcutp.so +lib/librdib.so +lib/librfrmt.so +lib/librimage.so +lib/librline.so +lib/librling.so +lib/librlings.so +lib/librmarker.so +lib/librneg.so +lib/librout.so +lib/librpic.so +lib/librpstr.so +lib/librreccom.so +lib/librsadd.so +lib/librselstr.so +lib/librshelllines.so +lib/librstr.so +lib/librstuff.so +lib/librverline.so +lib/libsmetric.so +lib/libstd32.so +lib/libwindummy.so +%%DATADIR%%/cube16pd.dat +%%DATADIR%%/cube16pl.dat +%%DATADIR%%/cube16pr.dat +%%DATADIR%%/cube16ps.dat +%%DATADIR%%/cube16pt.dat +%%DATADIR%%/cubeabde.dat +%%DATADIR%%/dc010101.dat +%%DATADIR%%/dc0201.dat +%%DATADIR%%/dc0202.dat +%%DATADIR%%/dc0203.dat +%%DATADIR%%/dc0204.dat +%%DATADIR%%/dc0205.dat +%%DATADIR%%/dc0206.dat +%%DATADIR%%/dc1201.dat +%%DATADIR%%/dc1203.dat +%%DATADIR%%/dc1204.dat +%%DATADIR%%/dc2201.dat +%%DATADIR%%/dc2203.dat +%%DATADIR%%/dc2204.dat +%%DATADIR%%/dc_agr.dat +%%DATADIR%%/dc_etrd.dat +%%DATADIR%%/dc_rtrd.dat +%%DATADIR%%/pln_hpd.dat +%%DATADIR%%/pln_prc.dat +%%DATADIR%%/rec1.dat +%%DATADIR%%/rec1blt.dat +%%DATADIR%%/rec1cen.dat +%%DATADIR%%/rec1n.dat +%%DATADIR%%/rec1r&e.dat +%%DATADIR%%/rec1rus.dat +%%DATADIR%%/rec1tur.dat +%%DATADIR%%/rec2.dat +%%DATADIR%%/rec2blt.dat +%%DATADIR%%/rec2cen.dat +%%DATADIR%%/rec2n.dat +%%DATADIR%%/rec2r&e.dat +%%DATADIR%%/rec2rus.dat +%%DATADIR%%/rec2tur.dat +%%DATADIR%%/rec3.dat +%%DATADIR%%/rec3blt.dat +%%DATADIR%%/rec3cen.dat +%%DATADIR%%/rec3n.dat +%%DATADIR%%/rec3r&e.dat +%%DATADIR%%/rec3rus.dat +%%DATADIR%%/rec3tur.dat +%%DATADIR%%/rec4cour.dat +%%DATADIR%%/rec4inc.dat +%%DATADIR%%/rec4mtr.dat +%%DATADIR%%/rec4r&e.dat +%%DATADIR%%/rec6.dat +%%DATADIR%%/rec6all.dat +%%DATADIR%%/rec6bul.dat +%%DATADIR%%/rec6cro.dat +%%DATADIR%%/rec6cze.dat +%%DATADIR%%/rec6dan.dat +%%DATADIR%%/rec6dut.dat +%%DATADIR%%/rec6est.dat +%%DATADIR%%/rec6frn.dat +%%DATADIR%%/rec6grm.dat +%%DATADIR%%/rec6hun.dat +%%DATADIR%%/rec6ita.dat +%%DATADIR%%/rec6lat.dat +%%DATADIR%%/rec6lit.dat +%%DATADIR%%/rec6pol.dat +%%DATADIR%%/rec6por.dat +%%DATADIR%%/rec6rom.dat +%%DATADIR%%/rec6rus.dat +%%DATADIR%%/rec6ser.dat +%%DATADIR%%/rec6slo.dat +%%DATADIR%%/rec6spa.dat +%%DATADIR%%/rec6swe.dat +%%DATADIR%%/rec6tur.dat +%%DATADIR%%/rec6ukr.dat +%%DATADIR%%/rec7.dat +%%DATADIR%%/rec7bul.dat +%%DATADIR%%/rec7cro.dat +%%DATADIR%%/rec7cze.dat +%%DATADIR%%/rec7dan.dat +%%DATADIR%%/rec7dut.dat +%%DATADIR%%/rec7est.dat +%%DATADIR%%/rec7frn.dat +%%DATADIR%%/rec7grm.dat +%%DATADIR%%/rec7hun.dat +%%DATADIR%%/rec7ita.dat +%%DATADIR%%/rec7lat.dat +%%DATADIR%%/rec7lit.dat +%%DATADIR%%/rec7pol.dat +%%DATADIR%%/rec7por.dat +%%DATADIR%%/rec7rom.dat +%%DATADIR%%/rec7rus.dat +%%DATADIR%%/rec7ser.dat +%%DATADIR%%/rec7slo.dat +%%DATADIR%%/rec7spa.dat +%%DATADIR%%/rec7swe.dat +%%DATADIR%%/rec7tur.dat +%%DATADIR%%/rec7ukr.dat +%%DATADIR%%/rec8.dat +%%DATADIR%%/rec8bul.dat +%%DATADIR%%/rec8cro.dat +%%DATADIR%%/rec8cze.dat +%%DATADIR%%/rec8dan.dat +%%DATADIR%%/rec8dut.dat +%%DATADIR%%/rec8est.dat +%%DATADIR%%/rec8frn.dat +%%DATADIR%%/rec8grm.dat +%%DATADIR%%/rec8hun.dat +%%DATADIR%%/rec8ita.dat +%%DATADIR%%/rec8lat.dat +%%DATADIR%%/rec8lit.dat +%%DATADIR%%/rec8pol.dat +%%DATADIR%%/rec8por.dat +%%DATADIR%%/rec8rom.dat +%%DATADIR%%/rec8rus.dat +%%DATADIR%%/rec8ser.dat +%%DATADIR%%/rec8slo.dat +%%DATADIR%%/rec8spa.dat +%%DATADIR%%/rec8swe.dat +%%DATADIR%%/rec8tur.dat +%%DATADIR%%/rec8ukr.dat +%%DATADIR%%/rec9.dat +%%DATADIR%%/rec9bul.dat +%%DATADIR%%/rec9cro.dat +%%DATADIR%%/rec9cze.dat +%%DATADIR%%/rec9dan.dat +%%DATADIR%%/rec9dut.dat +%%DATADIR%%/rec9est.dat +%%DATADIR%%/rec9frn.dat +%%DATADIR%%/rec9grm.dat +%%DATADIR%%/rec9hun.dat +%%DATADIR%%/rec9ita.dat +%%DATADIR%%/rec9lat.dat +%%DATADIR%%/rec9lit.dat +%%DATADIR%%/rec9pol.dat +%%DATADIR%%/rec9por.dat +%%DATADIR%%/rec9rom.dat +%%DATADIR%%/rec9rus.dat +%%DATADIR%%/rec9ser.dat +%%DATADIR%%/rec9slo.dat +%%DATADIR%%/rec9spa.dat +%%DATADIR%%/rec9swe.dat +%%DATADIR%%/rec9tur.dat +%%DATADIR%%/rec9ukr.dat +%%DATADIR%%/vital.dat +%%DATADIR%%/viteng.dat +@dirrmtry %%DATADIR%%