ccextractor/linux/build

89 lines
3.5 KiB
Plaintext
Raw Normal View History

2014-04-12 10:41:27 +00:00
#!/bin/bash
2018-01-11 07:01:02 +00:00
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP"
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc -I../src/freetype/include"
2015-08-27 10:50:55 +00:00
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
2015-08-27 10:50:55 +00:00
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
2016-08-25 22:57:33 +00:00
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
2016-09-28 20:05:09 +00:00
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
SRC_FREETYPE="../src/freetype/autofit/autofit.c
../src/freetype/base/ftbase.c
../src/freetype/base/ftbbox.c
../src/freetype/base/ftbdf.c
../src/freetype/base/ftbitmap.c
../src/freetype/base/ftcid.c
../src/freetype/base/ftfntfmt.c
../src/freetype/base/ftfstype.c
../src/freetype/base/ftgasp.c
../src/freetype/base/ftglyph.c
../src/freetype/base/ftgxval.c
../src/freetype/base/ftinit.c
../src/freetype/base/ftlcdfil.c
../src/freetype/base/ftmm.c
../src/freetype/base/ftotval.c
../src/freetype/base/ftpatent.c
../src/freetype/base/ftpfr.c
../src/freetype/base/ftstroke.c
../src/freetype/base/ftsynth.c
../src/freetype/base/ftsystem.c
../src/freetype/base/fttype1.c
../src/freetype/base/ftwinfnt.c
../src/freetype/bdf/bdf.c
../src/freetype/bzip2/ftbzip2.c
../src/freetype/cache/ftcache.c
../src/freetype/cff/cff.c
../src/freetype/cid/type1cid.c
../src/freetype/gzip/ftgzip.c
../src/freetype/lzw/ftlzw.c
../src/freetype/pcf/pcf.c
../src/freetype/pfr/pfr.c
../src/freetype/psaux/psaux.c
../src/freetype/pshinter/pshinter.c
../src/freetype/psnames/psnames.c
../src/freetype/raster/raster.c
../src/freetype/sfnt/sfnt.c
../src/freetype/smooth/smooth.c
../src/freetype/truetype/truetype.c
../src/freetype/type1/type1.c
../src/freetype/type42/type42.c
../src/freetype/winfonts/winfnt.c"
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS $SRC_FREETYPE"
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
2015-08-27 10:50:55 +00:00
2016-05-22 07:44:55 +00:00
./pre-build.sh
2016-12-15 17:07:29 +00:00
Cleaning up the codebase and additional changes in Python SRT generator. (#771) * Removed all extractors except the grid extractor. Removed the call to transcript extractor in ccx_encoders_transcript.c * Removed unnecessary array appening statements in python_grid_extractor. WIP: switch in extractor. * Added switch in g608 grid extractor. * Deleted comments from wrappers. * Refactored code in ccextractor.c and .h files. Removed all the commented part. Made proper changes according to the coding conventions. * Removed calls to extractor from all the encoders. The only call made to extractor is from ccx_encoders_python.c. * Removed a comment from wrapper.c. In init_write function of output.c added a call to free the output string returned by asprintf in case of sending filename to callback function. * Added calls to free the char* which is malloced by asprintf in extractor.c WIP: Free the global variable elements. * Sample testing correctly for italics tag. Also added a hack to print only 32 characters when unicode fails. WIP: Font tag. * Added support for handling font and italics in Python SRT generator. * modified the font generator. Also, added count method for checking blank strings in python_srt_generator. * Added free statements for avoiding memory leaks. * added return code for failure of asprintf calls. * Removing unnecessary code from api_testing.py * Made modifications to Makefile and build script. * Added recursive_tester.py Autoconf builds successfully. * BUG: Made change to get_line_encoded to encode the last \0 character in a line. Otherwise the EOL characted is absent causing garbage value to be present in SRT. * Exporting the encoding of the captions from CCExtractor to Python so that the python SRT generator can generate proper SRT files. * Modified the include statement in extractor.h
2017-08-25 18:03:00 +00:00
out=$((LC_ALL=C gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER)2>&1)
2016-12-15 17:07:29 +00:00
res=$?
if [[ $out == *"gcc: command not found"* ]]
then
echo "Error: please install gcc";
exit 1
fi
if [[ $out == *"curl.h: No such file or directory"* ]]
then
echo "Error: please install curl development library (libcurl4-gnutls-dev for Debian/Ubuntu)";
exit 2
fi
if [[ $out == *"capi.h: No such file or directory"* ]]
then
echo "Error: please install tesseract development library (tesseract-ocr-dev for Debian/Ubuntu)";
exit 3
fi
if [[ $out == *"allheaders.h: No such file or directory"* ]]
then
echo "Error: please install leptonica development library (libleptonica-dev for Debian/Ubuntu)";
exit 4
fi
if [[ $res -ne 0 ]] # Unknown error
then
echo "Compiled with errors"
>&2 echo "$out"
exit 5
fi
2016-12-15 19:32:17 +00:00
echo "Compilation successful";