From 9a136768015c3a93bf0280e83607766984186a60 Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Tue, 2 Jun 2020 04:14:34 +0000 Subject: [PATCH] initial changes to suit linuxBrew --- buildScripts/buildInstallLocallyApt | 4 ++-- buildScripts/buildInstallLocallyBrew | 18 +++++++++++------- buildScripts/getBuildToolsBrew | 24 ++++++++++++------------ buildScripts/getDevLibrariesBrew | 19 ++++++++++--------- pdf2htmlEX/CMakeLists.txt | 20 ++++++++++++-------- 5 files changed, 47 insertions(+), 38 deletions(-) diff --git a/buildScripts/buildInstallLocallyApt b/buildScripts/buildInstallLocallyApt index 7aa5e70..63b7688 100755 --- a/buildScripts/buildInstallLocallyApt +++ b/buildScripts/buildInstallLocallyApt @@ -10,8 +10,8 @@ export MAKE_PARALLEL="-j $(nproc)" # choose one of the following... # -export PDF2HTMLEX_BRANCH=update-poppler -# export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)" +# export PDF2HTMLEX_BRANCH="<>" +export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)" # The following environment variable determines where the poppler, # poppler-data, fontforge and pdf2htmlEX packages are installed. diff --git a/buildScripts/buildInstallLocallyBrew b/buildScripts/buildInstallLocallyBrew index 1cb4849..23caa20 100755 --- a/buildScripts/buildInstallLocallyBrew +++ b/buildScripts/buildInstallLocallyBrew @@ -10,14 +10,22 @@ export MAKE_PARALLEL="-j $(nproc)" # choose one of the following... # -export PDF2HTMLEX_BRANCH=update-poppler -# export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)" +# export PDF2HTMLEX_BRANCH="<>" +export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)" -export PDF2HTMLEX_PREFIX=toBeDetermined +# The following environment variable determines where the poppler, +# poppler-data, fontforge and pdf2htmlEX packages are installed. +# CHANGE IT TO SUIT YOUR NEEDS: +# +export PDF2HTMLEX_PREFIX=/home/linuxbrew/.linuxbrew ################ # do the build +# The following is used by the pdf2htmlEX CMakeLists.txt file +# +export USING_BREW=1 + ./buildScripts/versionEnvs || { echo 'versionEnvs FAILED' ; exit 1 ; } ./buildScripts/reportEnvs || { echo 'reportEnvs FAILED' ; exit 1 ; } @@ -30,14 +38,10 @@ export PDF2HTMLEX_PREFIX=toBeDetermined ./buildScripts/buildPoppler || { echo 'buildPoppler FAILED' ; exit 1 ; } -./buildScripts/installPoppler || { echo 'installPoppler FAILED' ; exit 1 ; } - ./buildScripts/getFontforge || { echo 'getFontforge FAILED' ; exit 1 ; } ./buildScripts/buildFontforge || { echo 'buildFontforge FAILED' ; exit 1 ; } -./buildScripts/installFontforge || { echo 'installFontforge FAILED' ; exit 1 ; } - ./buildScripts/buildPdf2htmlEX || { echo 'buildPdf2htmlEX FAILED' ; exit 1 ; } ./buildScripts/installPdf2htmlEX || { echo 'installPdf2htmlEX FAILED' ; exit 1 ; } diff --git a/buildScripts/getBuildToolsBrew b/buildScripts/getBuildToolsBrew index 1ee11e1..b32069a 100755 --- a/buildScripts/getBuildToolsBrew +++ b/buildScripts/getBuildToolsBrew @@ -9,16 +9,16 @@ echo "-------------------------------------------------------------------" echo "" brew update -brew install \ - git \ - pkg-config \ - ruby \ - autoconf \ - libtool \ - cmake \ - make \ - gcc \ - gettext \ - openjdk \ - jq \ +brew install \ + git \ + pkg-config \ + ruby \ + autoconf \ + libtool \ + cmake \ + make \ + gcc \ + gettext \ + openjdk \ + jq \ tree diff --git a/buildScripts/getDevLibrariesBrew b/buildScripts/getDevLibrariesBrew index 0938300..6119573 100755 --- a/buildScripts/getDevLibrariesBrew +++ b/buildScripts/getDevLibrariesBrew @@ -10,12 +10,13 @@ echo "-------------------------------------------------------------------" echo "" brew update -brew install \ - cairo \ - libspiro \ - libpng \ - jpeg \ - pango \ - little-cms2 \ - libxml2 \ - libuninameslist \ +brew install \ + cairo \ + libpng \ + jpeg \ + libxml2 \ + +# libspiro \ +# pango \ +# little-cms2 \ +# libuninameslist \ diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index 6bc37b1..067ec71 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -39,6 +39,7 @@ set(POPPLER_LIBRARIES ${POPPLER_LIBRARIES} ${CMAKE_SOURCE_DIR}/../poppler/build/libpoppler.a ) + if(ENABLE_SVG) pkg_check_modules(CAIRO REQUIRED cairo>=1.10.0) message("-- Trying to locate cairo-svg...") @@ -46,8 +47,10 @@ if(ENABLE_SVG) if(CAIRO_SVG_INCLUDE_PATH) message("-- found cairo-svg...") include_directories(${CAIRO_INCLUDE_DIRS}) - link_directories(${CAIRO_LIBRARY_DIRS}) - set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${CAIRO_LIBRARIES}) + if(NOT DEFINED ENV{USING_BREW}) + link_directories(${CAIRO_LIBRARY_DIRS}) + set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${CAIRO_LIBRARIES}) + endif() set(ENABLE_SVG 1) else() message(FATAL_ERROR "Error: no SVG support found in Cairo") @@ -56,7 +59,7 @@ if(ENABLE_SVG) find_package(Freetype REQUIRED) include_directories(${FREETYPE_INCLUDE_DIRS}) link_directories(${FREETYPE_LIBRARY_DIRS}) - set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FREETYPE_LIBRARIES}) +# set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FREETYPE_LIBRARIES}) endif() # SINCE we have a very intimate relationship with a particular version of @@ -79,16 +82,17 @@ set(FONTFORGE_LIBRARIES ${FONTFORGE_LIBRARIES} set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${POPPLER_LIBRARIES} ${FONTFORGE_LIBRARIES} - -lfreetype - -lfontconfig + ${CAIRO_LIBRARIES} -ljpeg -lpng - -lz - -pthread - -lm + -lfontconfig + -lfreetype -lxml2 -lglib-2.0 -lgio-2.0 + -pthread + -lz + -lm ) # -llcms2