-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs/: added page about packaging for Linux distributions.
- Loading branch information
1 parent
ed6a47d
commit a0d536b
Showing
2 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
.. include:: header.rst | ||
|
||
|
||
Packaging for Linux distributions | ||
================================= | ||
|
||
|
||
Requirements | ||
------------ | ||
|
||
* Python | ||
* MuPDF checkout (including submodules). | ||
* PyMuPDF checkout. | ||
* System packages listed in `scripts/sysinstall.py:g_sys_packages`. | ||
* Python packages listed in `pyproject.toml`. | ||
|
||
Extra requirements for running tests: | ||
|
||
* Python packages listed in `scripts/gh_release.py:test_packages`. | ||
|
||
|
||
General steps | ||
------------- | ||
|
||
* Build and install MuPDF: | ||
|
||
* Install required system packages. | ||
* Run `make install-shared-python` on MuPDF's `Makefile` with at least | ||
these make variables: | ||
|
||
* `DESTDIR` set to the install directory, e.g. `/`. | ||
* | ||
`prefix` set to location relative to DESTDIR, such as `/usr/local` or | ||
`/usr`. Must start with `/`. | ||
* `USE_SYSTEM_LIBS=yes`. | ||
* `HAVE_LEPTONICA=yes`. | ||
* `HAVE_TESSERACT=yes`. | ||
|
||
* Build and install PyMuPDF: | ||
|
||
* | ||
Run `pip install ./PyMuPDF` or `pip wheel ./PyMuPDF` with at least these | ||
environment variables: | ||
|
||
* | ||
`PYMUPDF_SETUP_MUPDF_BUILD=` (empty string) to prevent download and build | ||
of hard-coded MuPDF release. | ||
* | ||
`CFLAGS`, `CXXFLAGS` and `LDFLAGS` set to allow visibility of the | ||
installed MuPDF headers and shared libraries. | ||
* | ||
`PYMUPDF_SETUP_IMPLEMENTATIONS=b` to build only the rebased | ||
implementation. [This will become the default in a future release.] | ||
|
||
* Run PyMuPDF tests: | ||
|
||
* Ensure required Python packages are available. | ||
* | ||
Run `pytest -k "not test_color_count" PyMuPDF` (test `test_color_count` is | ||
known fail if MuPDF is not built with PyMuPDF's custom config.h). | ||
|
||
|
||
Use of scripts/sysinstall.py | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
`scripts/sysinstall.py` provides a useful example of build commands | ||
that are known to to work, because it does a build, install and test | ||
using a local fake root director and is run regularly by Github action | ||
`.github/workflows/test_sysinstall.yml`. | ||
|
||
* Run with `-h` or look at the doc-string to see detailed usage information. | ||
* It uses Debian-style `apt` commands to install system packages. | ||
* By default it assumes local git checkouts `mupdf/` and `PyMuPDF/`. | ||
* | ||
It currently installs only into a fake root directory because `pip` cannot do | ||
a system install; the commands will need to be modified to install into /usr | ||
or /usr/local. | ||
|
||
To run a full build, install and test in a local fake root: | ||
|
||
.. code-block:: shell | ||
./PyMuPDF/scripts/sysinstall.py | ||
To see what commands would be run without actually running them: | ||
|
||
.. code-block:: shell | ||
./PyMuPDF/scripts/sysinstall.py -m 0 -p 0 -t 0 | ||
See also | ||
-------- | ||
|
||
* | ||
`setup.py`'s initial doc-comment has detailed information about the | ||
environment variables used when building PyMuPDF. |