Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
Bohumír Zámečník edited this page Jun 19, 2018 · 1 revision

This is a way how to build source and binary packages for Python 2 and 3.

Unfortunately binary wheels cannot be published to public PyPI due to HTTPError: 400 Client Error: Binary wheel 'pdfparser_rossum-1.1.0-cp27-cp27mu-linux_x86_64.whl' has an unsupported platform tag 'linux_x86_64'. for url: https://upload.pypi.org/legacy/.

git clone --depth 1 https://github.com/rossumai/pdfparser.git
cd pdfparser/

git clone --depth 1 --branch poppler-0.61.1 https://anongit.freedesktop.org/git/poppler/poppler.git
cd poppler/
cmake -DCMAKE_BUILD_TYPE=release -DENABLE_CPP=OFF -DENABLE_GLIB=ON -DENABLE_QT4=OFF -DENABLE_QT5=OFF  -DBUILD_GTK_TESTS=OFF -DENABLE_SPLASH=OFF -DENABLE_UTILS=OFF
make
cd ..
cp poppler/libpoppler.so.?? pdfparser/
cp poppler/glib/libpoppler-glib.so.? pdfparser/

git clone --depth 1 --branch v1.15.4 https://github.com/pygobject/pycairo.git

mkvirtualenv pdfparser-build-py2
pip install cython twine

cd pycairo
python setup.py install
cd ..

rm -rf build dist pdfparser.egg-info
POPPLER_CAIRO_ROOT='.' python setup.py install
# build a source and binary package
POPPLER_CAIRO_ROOT='.' python setup.py sdist
POPPLER_CAIRO_ROOT='.' python setup.py bdist_wheel
twine upload -r rossum dist/*

mkvirtualenv pdfparser-build-py3 -p $(which python3)
pip install cython twine

cd pycairo
python setup.py install
cd ..

rm -rf build dist pdfparser.egg-info
POPPLER_CAIRO_ROOT='.' python setup.py install
POPPLER_CAIRO_ROOT='.' python setup.py bdist_wheel
twine upload -r rossum dist/*
Clone this wiki locally