Skip to content

Commit

Permalink
Added dependencies preparation scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
OneMoreGres committed Sep 29, 2015
1 parent 9e85af0 commit 3109444
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -5,4 +5,6 @@
*.user

*.exe
distr/content/
distr/content/

*.tar.gz
6 changes: 6 additions & 0 deletions 3rd-party/deps/get_deps.sh
@@ -0,0 +1,6 @@
#!/bin/bash

wget -O leptonica.tar.gz http://www.leptonica.com/source/leptonica-1.72.tar.gz
wget -O tesseract.tar.gz https://github.com/tesseract-ocr/tesseract/archive/3.04.00.tar.gz
wget -O tessdata.tar.gz https://github.com/tesseract-ocr/tessdata/archive/3.04.00.tar.gz

38 changes: 38 additions & 0 deletions 3rd-party/deps/make_deps.sh
@@ -0,0 +1,38 @@
#!/bin/bash

WORK_DIR=linux

#WORK_DIR=mingw
#HOST=i686-w64-mingw32
#export PATH="/opt/mingw-4.9.3/mingw-w64-i686/bin:$PATH"

#rm -rf $WORK_DIR
mkdir $WORK_DIR 2> /dev/null
set -e

WORK_DIR=`realpath $WORK_DIR`
if [ ! -z "$HOST" ]; then HOST_ATTR="--host=$HOST"; fi

echo "Building Leptonica"
tar zxf leptonica.tar.gz -C $WORK_DIR
LEPT_DIR=`ls $WORK_DIR | grep lept`
cd $WORK_DIR/$LEPT_DIR
./configure --prefix=$WORK_DIR --disable-programs $HOST_ATTR
make -j4
make install
cd ../..

echo "Building Tesseract"
tar zxf tesseract.tar.gz -C $WORK_DIR
TESS_DIR=`ls $WORK_DIR | grep tess`
cd $WORK_DIR/$TESS_DIR
sed 's/vs2008/vs2010/g' -i ccutil/Makefile.in
sed 's/Windows\.h/windows\.h/g' -i opencl/openclwrapper.cpp
LIBLEPT_HEADERSDIR=$WORK_DIR/include LIBS=-L$WORK_DIR/lib ./configure --prefix=$WORK_DIR --disable-tessdata-prefix $HOST_ATTR
make -j4
make install
cd ../..

find -name '*.dll' -exec cp {} $WORK_DIR/lib \;

echo "Done"

0 comments on commit 3109444

Please sign in to comment.