mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-09-07 17:37:04 +00:00
Merge pull request #17 from jgoldfar/fix-travis-linux
Fix travis build on linux
This commit is contained in:
commit
3aef1634bd
171
.travis.yml
171
.travis.yml
@ -1,101 +1,130 @@
|
|||||||
language: cpp
|
language: cpp
|
||||||
|
|
||||||
#sudo: true
|
sudo: true
|
||||||
|
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
# - osx
|
- osx
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- POPPLER_NAME="poppler-0.63.0"
|
||||||
|
- POPPLER_SOURCE="https://gitlab.freedesktop.org/poppler/poppler.git"
|
||||||
|
- FONTFORGE_SOURCE="https://github.com/fontforge/fontforge.git"
|
||||||
|
- LIBUNINAMESLIST_SOURCE="https://github.com/fontforge/libuninameslist.git"
|
||||||
|
|
||||||
|
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
|
|
||||||
env:
|
|
||||||
- POPPLER_NAME="poppler-0.63.0" POPPLER_SOURCE="https://ftp.osuosl.org/pub/blfs/conglomeration/poppler/poppler-0.63.0.tar.xz" FONTFORGE_SOURCE="https://github.com/fontforge/fontforge.git" PDF2HTMLEX_SOURCE="https://github.com/Rockstar04/pdf2htmlEX.git"
|
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
|
||||||
- sourceline: 'ppa:fontforge/fontforge'
|
|
||||||
- sourceline: 'ppa:coolwanglu/pdf2htmlex'
|
|
||||||
update: true
|
update: true
|
||||||
packages:
|
packages:
|
||||||
- ttfautohint
|
|
||||||
- build-essential
|
- build-essential
|
||||||
- libtool
|
|
||||||
- autoconf
|
- autoconf
|
||||||
- python-pip
|
- gcc
|
||||||
- libgetopt++-dev
|
|
||||||
- pkg-config
|
- pkg-config
|
||||||
- git
|
- git
|
||||||
- default-jre
|
- cmake
|
||||||
- libnss3-dev
|
- ca-certificates
|
||||||
- libopenjpeg-dev
|
- libfreetype6-dev
|
||||||
- libjpeg-turbo8-dev
|
# Poppler-specific packages
|
||||||
- libfontconfig1-dev
|
- libfontconfig1-dev
|
||||||
- poppler-data
|
- libjpeg-dev
|
||||||
# - poppler-utils
|
- libnss3-dev
|
||||||
# - poppler-dbg
|
# libuninameslist-specific packages
|
||||||
- packaging-dev
|
- automake
|
||||||
|
- libtool
|
||||||
|
# fontforge-specific packages
|
||||||
|
- libltdl-dev
|
||||||
|
- python-dev
|
||||||
- libglib2.0-dev
|
- libglib2.0-dev
|
||||||
- libxml2-dev
|
- libxml2-dev
|
||||||
- giflib-dbg
|
|
||||||
- libjpeg-dev
|
|
||||||
- libtiff-dev
|
|
||||||
- uthash-dev
|
|
||||||
- libcairo-dev
|
|
||||||
# - libpoppler-dev
|
|
||||||
- libspiro-dev
|
- libspiro-dev
|
||||||
- libcairo-dev
|
- gettext
|
||||||
|
# pdf2htmlEX-specific packages
|
||||||
|
- default-jre
|
||||||
|
- libcairo2-dev
|
||||||
- libpango1.0-dev
|
- libpango1.0-dev
|
||||||
- libfreetype6-dev
|
|
||||||
- libltdl-dev
|
|
||||||
- libfontforge-dev
|
|
||||||
- python-dev
|
|
||||||
- python-imaging
|
|
||||||
- python-pip
|
|
||||||
- firefox
|
|
||||||
- xvfb
|
|
||||||
- cmake
|
|
||||||
homebrew:
|
homebrew:
|
||||||
packages:
|
packages:
|
||||||
- fontforge
|
- autoconf
|
||||||
- poppler
|
- pkg-config
|
||||||
|
- git
|
||||||
|
- cmake
|
||||||
|
- freetype
|
||||||
|
# Poppler-specific packages
|
||||||
|
- fontconfig
|
||||||
|
- jpeg
|
||||||
|
- nss
|
||||||
|
# libuninameslist-specific packages
|
||||||
|
- automake
|
||||||
|
- libtool
|
||||||
|
# fontforge-specific packages
|
||||||
|
- python
|
||||||
|
- glib
|
||||||
|
- xml2
|
||||||
|
- libspiro
|
||||||
|
- gettext
|
||||||
|
# pdf2htmlEX-specific packages
|
||||||
- cairo
|
- cairo
|
||||||
|
- pango
|
||||||
sauce_connect: true
|
sauce_connect: true
|
||||||
|
|
||||||
before_install:
|
matrix:
|
||||||
# Install poppler
|
fast_finish: true
|
||||||
- wget "${POPPLER_SOURCE}"
|
allow_failures:
|
||||||
- tar -xvf "${POPPLER_NAME}.tar.xz"
|
- os: osx # Until the build passes, then re-enable.
|
||||||
- cd "${POPPLER_NAME}/"
|
|
||||||
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/../usr -DENABLE_XPDF_HEADERS=ON -DENABLE_LIBOPENJPEG=none
|
|
||||||
- make && make install
|
|
||||||
- cd ..
|
|
||||||
# Install fontforge libuninameslist via source ...
|
|
||||||
- git clone https://github.com/fontforge/libuninameslist.git
|
|
||||||
- cd libuninameslist
|
|
||||||
- autoreconf -i && automake
|
|
||||||
- ./configure --prefix=`pwd`/../usr
|
|
||||||
- make && make install
|
|
||||||
# Install fontforge via source
|
|
||||||
- git clone --depth 1 --single-branch --branch 20170731 "$FONTFORGE_SOURCE"
|
|
||||||
- cd fontforge/ && git checkout tags/20170731
|
|
||||||
- ./bootstrap
|
|
||||||
- ./configure --prefix=`pwd`/../usr
|
|
||||||
- make && make install && ldconfig
|
|
||||||
# - pip install --user selenium sauceclient
|
|
||||||
# - export DISPLAY=:99.0
|
|
||||||
# - test/start_xvfb.sh
|
|
||||||
# - pushd /
|
|
||||||
# - python -m SimpleHTTPServer 8000 >/dev/null 2>&1 &
|
|
||||||
# - popd
|
|
||||||
# - sleep 5
|
|
||||||
|
|
||||||
before_script:
|
before_install:
|
||||||
- cmake -DENABLE_SVG=ON -DCMAKE_INSTALL_PREFIX=`pwd`/usr .
|
# Clone and build poppler
|
||||||
- export LD_LIBRARY_PATH=`pwd`/usr/lib:$LD_LIBRARY_PATH
|
- git clone ${POPPLER_SOURCE}
|
||||||
|
- cd poppler;
|
||||||
|
git checkout tags/${POPPLER_NAME} -b poppler-local;
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/usr -DENABLE_XPDF_HEADERS=ON -DENABLE_LIBOPENJPEG=none .;
|
||||||
|
make;
|
||||||
|
make install
|
||||||
|
- cd ${TRAVIS_BUILD_DIR}
|
||||||
|
|
||||||
|
# Install libuninameslist
|
||||||
|
- git clone ${LIBUNINAMESLIST_SOURCE}
|
||||||
|
- cd libuninameslist;
|
||||||
|
git checkout tags/20180701 -b libuninameslist-local;
|
||||||
|
autoreconf -i;
|
||||||
|
automake;
|
||||||
|
./configure --prefix=${TRAVIS_BUILD_DIR}/usr;
|
||||||
|
make;
|
||||||
|
make install
|
||||||
|
- cd ${TRAVIS_BUILD_DIR}
|
||||||
|
|
||||||
|
# Install fontforge
|
||||||
|
- git clone ${FONTFORGE_SOURCE}
|
||||||
|
- cd fontforge;
|
||||||
|
git checkout tags/20170731 -b fontforge-local;
|
||||||
|
./bootstrap;
|
||||||
|
./configure --disable-programs --disable-python-extension --disable-python-scripting --prefix=${TRAVIS_BUILD_DIR}/usr;
|
||||||
|
make;
|
||||||
|
make install;
|
||||||
|
sudo ldconfig
|
||||||
|
- cd ${TRAVIS_BUILD_DIR}
|
||||||
|
|
||||||
|
# Test setup
|
||||||
|
- pip install --user Pillow selenium sauceclient
|
||||||
|
- export DISPLAY=:99.0
|
||||||
|
- test/start_xvfb.sh
|
||||||
|
- pushd /
|
||||||
|
- python -m SimpleHTTPServer 8000 >/dev/null 2>&1 &
|
||||||
|
- popd
|
||||||
|
- sleep 5
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- export LD_LIBRARY_PATH=${TRAVIS_BUILD_DIR}/usr/lib:$LD_LIBRARY_PATH
|
||||||
|
- export PKG_CONFIG_PATH=${TRAVIS_BUILD_DIR}/usr/lib/pkgconfig:$PKG_CONFIG_PATH
|
||||||
|
- patch < CMakeLists.txt.patch
|
||||||
|
- mkdir build && cd build && cmake -DENABLE_SVG=ON -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/usr ..
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make
|
- make
|
||||||
# - P2H_TEST_REMOTE=1 ctest --output-on-failure --verbose
|
- P2H_TEST_REMOTE=1 ctest --output-on-failure --verbose
|
||||||
- make install
|
- make install
|
||||||
- /usr/local/bin/pdf2htmlEX -v
|
- ${TRAVIS_BUILD_DIR}/usr/bin/pdf2htmlEX -v
|
||||||
|
12
CMakeLists.txt.patch
Normal file
12
CMakeLists.txt.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index 135e02f..97c7035 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -7,6 +7,7 @@ cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
|
||||||
|
|
||||||
|
option(ENABLE_SVG "Enable SVG support, for generating SVG background images and converting Type 3 fonts" ON)
|
||||||
|
|
||||||
|
+include_directories(${CMAKE_INSTALL_PREFIX}/include)
|
||||||
|
include_directories(${CMAKE_SOURCE_DIR}/src)
|
||||||
|
|
||||||
|
set(PDF2HTMLEX_VERSION "0.15.0")
|
@ -1,6 +1,6 @@
|
|||||||
# ![](https://pdf2htmlEX.github.io/pdf2htmlEX/images/pdf2htmlEX-64x64.png) pdf2htmlEX
|
# ![](https://pdf2htmlEX.github.io/pdf2htmlEX/images/pdf2htmlEX-64x64.png) pdf2htmlEX
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/jgoldfar/pdf2htmlEX.svg?branch=add-build-status)](https://travis-ci.org/jgoldfar/pdf2htmlEX)
|
[![Build Status](https://travis-ci.org/pdf2htmlEX/pdf2htmlEX.svg?branch=master)](https://travis-ci.org/pdf2htmlEX/pdf2htmlEX)
|
||||||
|
|
||||||
# Differences from upstream pdf2htmlEX:
|
# Differences from upstream pdf2htmlEX:
|
||||||
|
|
||||||
|
@ -10,31 +10,31 @@ from selenium.webdriver.support.ui import WebDriverWait
|
|||||||
from selenium.webdriver.support import expected_conditions
|
from selenium.webdriver.support import expected_conditions
|
||||||
from browser_tests import BrowserTests
|
from browser_tests import BrowserTests
|
||||||
|
|
||||||
class test_local_browser(BrowserTests, unittest.TestCase):
|
# class test_local_browser(BrowserTests, unittest.TestCase):
|
||||||
@classmethod
|
# @classmethod
|
||||||
def setUpClass(cls):
|
# def setUpClass(cls):
|
||||||
super(test_local_browser, cls).setUpClass()
|
# super(test_local_browser, cls).setUpClass()
|
||||||
if not cls.GENERATING_MODE:
|
# if not cls.GENERATING_MODE:
|
||||||
cls.browser = webdriver.Firefox()
|
# cls.browser = webdriver.Firefox()
|
||||||
cls.browser.maximize_window()
|
# cls.browser.maximize_window()
|
||||||
size = cls.browser.get_window_size()
|
# size = cls.browser.get_window_size()
|
||||||
assert ((size['width'] >= cls.BROWSER_WIDTH) and (size['height'] >= cls.BROWSER_HEIGHT)), 'Screen is not large enough'
|
# assert ((size['width'] >= cls.BROWSER_WIDTH) and (size['height'] >= cls.BROWSER_HEIGHT)), 'Screen is not large enough'
|
||||||
cls.browser.set_window_size(cls.BROWSER_WIDTH, cls.BROWSER_HEIGHT)
|
# cls.browser.set_window_size(cls.BROWSER_WIDTH, cls.BROWSER_HEIGHT)
|
||||||
|
#
|
||||||
@classmethod
|
# @classmethod
|
||||||
def tearDownClass(cls):
|
# def tearDownClass(cls):
|
||||||
if not cls.GENERATING_MODE:
|
# if not cls.GENERATING_MODE:
|
||||||
cls.browser.quit()
|
# cls.browser.quit()
|
||||||
super(test_local_browser, cls).tearDownClass()
|
# super(test_local_browser, cls).tearDownClass()
|
||||||
|
#
|
||||||
def generate_image(self, html_file, png_file, page_must_load=True):
|
# def generate_image(self, html_file, png_file, page_must_load=True):
|
||||||
self.browser.get('file://' + html_file)
|
# self.browser.get('file://' + html_file)
|
||||||
try:
|
# try:
|
||||||
WebDriverWait(self.browser, 5).until(expected_conditions.presence_of_element_located((By.ID, 'page-container')))
|
# WebDriverWait(self.browser, 5).until(expected_conditions.presence_of_element_located((By.ID, 'page-container')))
|
||||||
except:
|
# except:
|
||||||
if page_must_load:
|
# if page_must_load:
|
||||||
raise
|
# raise
|
||||||
self.browser.save_screenshot(png_file)
|
# self.browser.save_screenshot(png_file)
|
||||||
|
#
|
||||||
if __name__ == '__main__':
|
# if __name__ == '__main__':
|
||||||
unittest.main()
|
# unittest.main()
|
||||||
|
Loading…
Reference in New Issue
Block a user