| 1 |
**calibre** supports installation from source, only on Linux. If you want to |
| 2 |
create installers for Windows or macOS, instructions can be found at |
| 3 |
https://github.com/kovidgoyal/build-calibre |
| 4 |
|
| 5 |
Note that you *do not* need to install from source to hack on the calibre |
| 6 |
source code. To get started with calibre development, use a normal calibre |
| 7 |
install and follow the instructions at |
| 8 |
https://manual.calibre-ebook.com/develop.html |
| 9 |
|
| 10 |
On Linux, there are two kinds of installation from source possible. Note that |
| 11 |
both kinds require lots of dependencies as well as a full development |
| 12 |
environment (compilers, header files, etc.) |
| 13 |
|
| 14 |
All installation related functions are accessed by the command:: |
| 15 |
|
| 16 |
python setup.py |
| 17 |
|
| 18 |
For details on what functions are available, see:: |
| 19 |
|
| 20 |
python setup.py -h |
| 21 |
|
| 22 |
Or for help on any individual functions, see:: |
| 23 |
|
| 24 |
python setup.py <function> -h |
| 25 |
|
| 26 |
Note that many of these functions are only useful for creating official release |
| 27 |
compilations. |
| 28 |
|
| 29 |
Prerequisites |
| 30 |
============= |
| 31 |
|
| 32 |
In order to install calibre, you will need: |
| 33 |
|
| 34 |
- The system dependencies listed at the bottom of |
| 35 |
https://calibre-ebook.com/download_linux |
| 36 |
|
| 37 |
- Either the raw source code available from git, or the release source code |
| 38 |
available at https://download.calibre-ebook.com (preferred). There is a big |
| 39 |
difference between the two, as the raw sources do not include several |
| 40 |
pre-compiled resources, for example localizations and MathJax support. |
| 41 |
|
| 42 |
For anyone familiar with autotools builds, this is somewhat similar to the |
| 43 |
difference between configure.ac in git and the dist tarball after |
| 44 |
autoreconf is run, i.e., users are generally expected to use the latter. |
| 45 |
|
| 46 |
Build |
| 47 |
===== |
| 48 |
|
| 49 |
In order to bootstrap the raw git sources to a release-ready state, run the |
| 50 |
command:: |
| 51 |
|
| 52 |
python setup.py bootstrap |
| 53 |
|
| 54 |
In order to compile the C/C++ extensions etc. for a release-ready tarball |
| 55 |
(these functions are already included by the bootstrap function), run the |
| 56 |
commands:: |
| 57 |
|
| 58 |
python setup.py build |
| 59 |
python setup.py gui |
| 60 |
|
| 61 |
Install |
| 62 |
========== |
| 63 |
|
| 64 |
The first type of install will actually "install" calibre to your computer by |
| 65 |
putting its files into the system in the following locations: |
| 66 |
|
| 67 |
- Binaries (actually python wrapper scripts) in <prefix>/bin |
| 68 |
- Python and C modules in <prefix>/lib/calibre |
| 69 |
- Resources like icons, etc. in <prefix>/share/calibre |
| 70 |
|
| 71 |
This type of install can be run by the command:: |
| 72 |
|
| 73 |
sudo python setup.py install |
| 74 |
|
| 75 |
<prefix> is normally the installation prefix of python, usually /usr. It can |
| 76 |
be controlled by the --prefix option. |
| 77 |
|
| 78 |
For distro packagers, DESTDIR support is implemented via the --staging-root |
| 79 |
option, usually ${DESTDIR}/usr. |
| 80 |
|
| 81 |
Develop |
| 82 |
============= |
| 83 |
|
| 84 |
This type of install is designed to let you run calibre from your home |
| 85 |
directory, making it easy to hack on it. |
| 86 |
|
| 87 |
It will only install binaries into /usr/bin, but all the actual code and |
| 88 |
resource files will be read from the calibre source tree in your home directory |
| 89 |
(or wherever you choose to put it). |
| 90 |
|
| 91 |
This type of install can be run with the command:: |
| 92 |
|
| 93 |
sudo python setup.py develop |