From 3bb24b4453a9b7f37c960d959951daad372021d8 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 14 Jan 2020 12:09:35 -0500 Subject: [PATCH] Use bundled libtiff --- .gitmodules | 3 ++ CMakeLists.txt | 2 +- README.md | 2 +- lib/libtiff | 1 + scripts/get_static_libs.sh | 9 +++++ scripts/get_static_libs_freebsd.sh | 58 ------------------------------ 6 files changed, 15 insertions(+), 60 deletions(-) create mode 160000 lib/libtiff delete mode 100755 scripts/get_static_libs_freebsd.sh diff --git a/.gitmodules b/.gitmodules index 1fa332f..1addfbf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -37,3 +37,6 @@ [submodule "lib/leptonica"] path = lib/leptonica url = https://github.com/danbloomberg/leptonica +[submodule "lib/libtiff"] + path = lib/libtiff + url = https://gitlab.com/libtiff/libtiff diff --git a/CMakeLists.txt b/CMakeLists.txt index ec02491..944910e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,8 +127,8 @@ TARGET_LINK_LIBRARIES( ${PROJECT_SOURCE_DIR}/lib/libtesseract.a ${PROJECT_SOURCE_DIR}/lib/liblept.a + ${PROJECT_SOURCE_DIR}/lib/libtiff.a png - tiff stdc++ ) diff --git a/README.md b/README.md index 5066c50..f547870 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ binaries. apt install git cmake pkg-config libglib2.0-dev \ libssl-dev uuid-dev python3 libmagic-dev libfreetype6-dev \ libcurl-dev libbz2-dev yasm libharfbuzz-dev ragel \ - libarchive-dev libtiff5 libpng16-16 + libarchive-dev libtiff5 libpng16-16 libpango1.0-dev ``` 2. Build diff --git a/lib/libtiff b/lib/libtiff new file mode 160000 index 0000000..3db0ff9 --- /dev/null +++ b/lib/libtiff @@ -0,0 +1 @@ +Subproject commit 3db0ff91bc6db20fc4cb035be366a9bbb4e701cf diff --git a/scripts/get_static_libs.sh b/scripts/get_static_libs.sh index 40d7b6e..0a3cbc3 100755 --- a/scripts/get_static_libs.sh +++ b/scripts/get_static_libs.sh @@ -88,3 +88,12 @@ cd leptonica make -j $THREADS cd .. mv leptonica/src/.libs/liblept.a . + +# tiff +cd libtiff +./autogen.sh +./configure --enable-static --disable-shared --disable-lzw --disable-jpeg --disable-webp \ + --disable-lzma --disable-zstd --disable-jbig +make -j $THREADS +cd .. +mv libtiff/libtiff/.libs/libtiff.a . \ No newline at end of file diff --git a/scripts/get_static_libs_freebsd.sh b/scripts/get_static_libs_freebsd.sh deleted file mode 100755 index 83f236e..0000000 --- a/scripts/get_static_libs_freebsd.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash -cd lib - -# mupdf -cd mupdf -HAVE_X11=no HAVE_GLUT=no gmake -j 4 -cd .. - -mv mupdf/build/release/libmupdf.a . -mv mupdf/build/release/libmupdf-third.a . - -# openjp2 -cd openjpeg -#cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-O3 -march=native -DNDEBUG" -cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-O3" -gmake -j 4 -cd .. -mv openjpeg/bin/libopenjp2.a . - -# harfbuzz -cd harfbuzz -./autogen.sh -./configure --disable-shared --enable-static -gmake -j 4 -cd .. -mv harfbuzz/src/.libs/libharfbuzz.a . - -# ffmpeg -cd ffmpeg -./configure --disable-shared --enable-static --disable-ffmpeg --disable-ffplay \ - --disable-ffprobe --disable-doc\ - --disable-manpages --disable-postproc --disable-avfilter \ - --disable-alsa --disable-lzma --disable-xlib --disable-debug\ - --disable-vdpau --disable-vaapi --disable-sdl2 --disable-network -gmake -j 4 -cd .. - -mv ffmpeg/libavcodec/libavcodec.a . -mv ffmpeg/libavformat/libavformat.a . -mv ffmpeg/libavutil/libavutil.a . -mv ffmpeg/libswresample/libswresample.a . -mv ffmpeg/libswscale/libswscale.a . - -#bzip2 -cd bzip2-1.0.6 -make -j 4 -cd .. -mv bzip2-1.0.6/libbz2.a . - -# magic -cd libmagic -./autogen.sh -./configure --enable-static --disable-shared -make -j 4 -cd .. -mv libmagic/src/.libs/libmagic.a . - -cd ..