1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 00:21:15 +03:00
The awesome document factory
Go to file
Konstantin Alekseev 1571528da3 dlopen shared library symlink using major version name.
cffi.dlopen should use .so.N symlinks instead of .so to
make sure we load ABI compatible version of the library and
the same library used by the rest of the system.

cffi uses `ctypes.util.find_library` to search for libraries
and the docs for `find_library` states that
"The exact functionality is system dependent."
so different system may expect different names for the same library.

To overcome that problem we try to load several names until success
among these names exact file name with `.so` suffix
eg. `libcairo.so` but .so symlink is not always safe to use.

Shared library usually consist of two of three files:
- libcairo.so.N.M - N.M exact version number
- libcairo.so.N - symlink to library.so.N.M with major ABI version
- libcairo.so - symlink to library.so.N

When -lcairo flag is used linker search for libcairo.so,
but when the programm loaded it loads libcairo.so.N where N
is the version that it was linked with.

Some downsides of .so usage:
- .so may point to the wrong ABI version, e.g. we expect libcairo
  version 2 but libcairo.so points at libcairo.so.1
- usually .so files are shipped with development packages `-dev`
  in debian and `-devel` in centos and they are just symlinks
  to the .so.N files. So it safer to search for .so.N files they
  will exist even if dev package is not installed.
- hard symlink .so -> .so.N not always preserved, eg. if we zip
  them we get two copies of the library and while the rest of the
  system will use .so.N file we will load .so files that may lead
  to crash
2020-05-03 22:01:41 +03:00
docs Merge pull request #1061 from mPyth/patch-1 2020-04-02 10:12:20 +02:00
weasyprint dlopen shared library symlink using major version name. 2020-05-03 22:01:41 +03:00
.gitignore Merge branch 'master' into test 2018-03-20 10:45:46 +01:00
.travis.yml Revert "Try not to use DejaVu fonts for Windows tests" 2020-04-05 23:10:14 +02:00
AUTHORS Version 51 2019-12-23 17:41:50 +01:00
CODE_OF_CONDUCT.rst Add a code of conduct 2019-02-08 14:42:16 +01:00
COPYRIGHT Remove repeated copyright assignments in files 2020-01-02 14:10:09 +01:00
LICENSE Remove repeated copyright assignments in files 2020-01-02 14:10:09 +01:00
NEWS.rst Version 51 2019-12-23 17:41:50 +01:00
README.rst Update description in README 2019-02-21 17:32:26 +01:00
setup.cfg Explicitely list included packages 2020-03-16 17:56:57 +01:00
setup.py Remove repeated copyright assignments in files 2020-01-02 14:10:09 +01:00

==========
WeasyPrint
==========

**The Awesome Document Factory**

WeasyPrint is a smart solution helping web developers to create PDF
documents. It turns simple HTML pages into gorgeous statistical reports,
invoices, tickets…

From a technical point of view, WeasyPrint is a visual rendering engine for
HTML and CSS that can export to PDF and PNG. It aims to support web standards
for printing. WeasyPrint is free software made available under a BSD license.

It is based on various libraries but *not* on a full rendering engine like
WebKit or Gecko. The CSS layout engine is written in Python, designed for
pagination, and meant to be easy to hack on.

* Free software: BSD licensed
* Python 3.5+
* Website: https://weasyprint.org/
* Documentation: https://weasyprint.readthedocs.io/
* Source code and issue tracker: https://github.com/Kozea/WeasyPrint
* Tests: https://travis-ci.org/Kozea/WeasyPrint
* Support: https://www.patreon.com/kozea