My thoughts on Slackware, life and everything

New calibre packages – finally

calibreicoIt’s been nearly ten months since my last package for Calibre. What’s Calibre again I hear you ask? It is the highly popular E-book library management program with support for any E-Reader you can think of. I doubt that anyone who tried Calibre will ever switch back to one of the proprietary library management programs that commonly ship with E-Reader devices because Calibre transfers your E-books to and from your E-Reader device with ease. Calibre also contains an excellent E-book reader program for your desktop – even an EPUB editor comparable to Sigil. It will let you convert E-books from one format to another and allows you to subscribe to lots of news sites.

Last year august, the Calibre software switched from Qt4 to Qt5 for its user interface, and I was not yet prepared to follow suit. Running up to that month I had been working long and hard on the new KDE 5 preview and that was my first encounter with Qt5 – I decided to wait a bit for the new Calibre to mature and also I wanted to wait with adding Qt5 to my slackbuilds repository (the qt5 in ‘ktown_testing’ was just that, for testing KDE 5 and nothing production-ready).

During the previous couple of weeks I enjoyed several long weekends due to national holidays, and so it happened that I could spend some time re-visiting the calibre.SlackBuild and updating it so that it was able to compile a package for Calibre 2.x.

I wanted as few external dependencies as possible. The exception would be Qt5 which should be a proper package in its own right – it is too big to become a mere part of a calibre package. I ended up with just “podofo” and “qt5” as dependencies and I am now in the process of uploading the qt5 packages for slackware-current… something I forgot earlier this week. I borrowed them from my ktown_testing repository in order to compile Calibre.

But I also want to keep the older Qt4 version of Calibre (the 1.x releases) around for those who like that better or do not want the big Qt5 on their computer. So I renamed my SlackBuild for the 1.x version to “calibre1.SlackBuild“. I then recompiled calibre-1.48.0 for Slackware-current because the previous build of the package was broken after the recent big update and I still needed to address that issue. That is why you will find a “calibre” as well as a “calibre1” package in the repositories for Slackware 14.1 and -current. Take your pick.

Enjoy a shiny new Calibre 2.28.0 on Slackware (14.1 and -current)!



  1. gauchao

    Awesome job Eric! I can’t thank you enough. Although Calibre 1-48 was running smoothly, it is really nice to get a fresh update from the best ebook manager around. I use it daily and can’t get along with my Kobo without Calibre. And this version is running really fine here, Slack64 14.1.

  2. Alan Aversa

    Calibre is the only open source program I’ve ever donated Bitcoin to. It’s that good. ?

  3. Deny Dias

    calibre indeed is one of the most useful piece of code for ebook and ereader lovers. My damn proprietary Kindle runs free as in speech after calibre.

    Thank you Eric for this long time waited update, even I’m no going to your packages as I already using it from the standard install. It have worked just fine for me.

    Anyway, I’m sure it’s going to be useful for many out there as calibre 2.x is a really good improvement in the UI/UX side compared to 1.x

  4. Janis

    Great work! Thank you, Eric!

  5. D.L.C. Burggraaff

    One hour ago I installed Calibre 2.29 on Slackware64 14.1 multilib (so qt 4.8.6) via the wget statement from their website. No problems, no questions asked.

    root@riposo:~/works# ldd /opt/calibre/calibre (0x00007fff20bf2000) => /lib64/ (0x00007f1f6b862000)
    /lib64/ (0x00007f1f6bc2c000)

    So why go through all this trouble?
    Regards, Dick

    PS: I am not allergic to static builds.

  6. alienbob

    D.L.C. Burggraaff, if you need to ask “why go through all this trouble” then I did not make this package for you.

    I want to install pre-compiled binaries on my Slackware computer only if there is no other choice. That is why I provide a Chromium package – I assume you are just running Chrome because that is easier?

    The installer from Calibre’s web site works OK for those who use it, so by all means, keep using it.
    FYI, that online installation contains all Qt5 libraries so it is quite a big install (every dependency is statically compile into it actually) and if you already have Qt5 installed, it wastes a lot of your disk space.
    But that’s a choice you can make. I am not limiting your options, I am expanding them.

    For all those other people who want to learn how to compile calibre natively (that includes me) there’s the calibre.SlackBuild , and a package which you can easily install and de-install or upgrade.

  7. Jen

    Thanks! And my in-laws thank you, since they won’t need to carry around boxes of books next time we move with my (new) ebook habit. 🙂

  8. D.L.C. Burggraaff

    Dear Eric,
    It was never my intention to offend you or belittle your work. If you took it that way then please accept my apologies.
    Kind regards, Dick

  9. alienbob

    Hi Dick,

    I was not offended. But I needed to respond the “why bother” attitude displayed in your post. It very much matters to me that I bother about things when other people don’t.

  10. dimm0k

    attempting to compile the new version of Calibre under 14.1 and am getting some issues… I’ve installed, not compiled, your Qt5 package for 14.1 and already had podofo installed. I get this during Calibre compilation:

    Traceback (most recent call last):
    File “”, line 13, in
    import setup.commands as commands
    File “/tmp/build/tmp-calibre/calibre-2.28.0/setup/”, line 28, in
    from setup.translations import POT, GetTranslations, Translations, ISO639, ISO3166
    File “/tmp/build/tmp-calibre/calibre-2.28.0/setup/”, line 14, in
    from setup.parallel_build import parallel_check_output
    File “/tmp/build/tmp-calibre/calibre-2.28.0/setup/”, line 14, in
    from setup.build_environment import cpu_count
    File “/tmp/build/tmp-calibre/calibre-2.28.0/setup/”, line 96, in
    from PyQt5.QtCore import PYQT_CONFIGURATION
    ImportError: No module named PyQt5.QtCore
    Traceback (most recent call last):
    File “”, line 13, in
    import setup.commands as commands
    File “/tmp/build/tmp-calibre/calibre-2.28.0/setup/”, line 28, in
    from setup.translations import POT, GetTranslations, Translations, ISO639, ISO3166
    File “/tmp/build/tmp-calibre/calibre-2.28.0/setup/”, line 14, in
    from setup.parallel_build import parallel_check_output
    File “/tmp/build/tmp-calibre/calibre-2.28.0/setup/”, line 14, in
    from setup.build_environment import cpu_count
    File “/tmp/build/tmp-calibre/calibre-2.28.0/setup/”, line 96, in
    from PyQt5.QtCore import PYQT_CONFIGURATION
    ImportError: No module named PyQt5.QtCore
    ./calibre.SlackBuild: line 1078: cd: /tmp/build/package-calibre/usr/share/calibre/fonts/liberation/: No such file or directory

  11. alienbob

    > ImportError: No module named PyQt5.QtCore

    Did you logout and log back in after installing the qt5 package? It installs a profile script under /etc/profile.d/

  12. dimm0k

    Eric – I’ve verified that there are qt5 scripts in /etc/profile.d and have tried logging out/in, as well as a reboot, but still getting the same message. Should I have removed qt4 after installing qt5?

  13. alienbob

    dimm0k, no you should not remove Qt4.
    But after looking better at the error, I know what is wrong.
    The error is about the missing PyQt5 package. And that is correct, if you run the calibre.SlackBuild as-is.
    What I did not write in the article, was that the script needs to be told explicitly to compile the python interpreter plus supporting modules into the package. Because the package checks for the existence of a suitable Python on your computer… and if it finds one (like in Slackware 14.0 and higher) then the script will use that. And then you need the python support modules like PyQt5 and others, in the form of external packages that have already been installed before you compile Calibre.

    In order to depend on just Qt5 and podofo and add the rest as static libraries to the calibre package, run the script like this:

    # BUILD_PYTHON=YES calibre.SlackBuild

  14. dimm0k

    Eric – looks like the inclusion of the “BUILD_PYTHON=YES” did it! thank you!

  15. gegechris99

    Hello Eric,

    I don’t use Calibre but I saw in your Changelog that you referred to calibre1 dependencies as Perl libraries. Aren’t they Python libraries?
    Sorry for nitpicking

  16. alienbob

    Yeah… it should have been “Python” indeed…

  17. slodki

    After adding qt5 and calibre to -current:
    Traceback (most recent call last):
    File “/usr/bin/calibre”, line 20, in
    File “/usr/lib/calibre/calibre/”, line 62, in calibre
    from calibre.gui2.main import main
    File “/usr/lib/calibre/calibre/gui2/”, line 8, in
    from PyQt5.Qt import (
    ImportError: cannot import name QFileInfo

    ldd /usr/lib/calibre/lib/python2.7/site-packages/PyQt5/ gives: => not found => not found => not found
    icu4c-54.1-i486-1 installed from -current (upgraded Tue Apr 21 23:44:00 UTC 2015). Should your Calibre package be updated?

  18. alienbob

    Could be that the 32bit package needs a rebuild. The 64bit package is OK, it links against libicu*.so.54 libraries.

  19. slodki

    calibre-2.31.0-i486-1alien for -current is still linked to libicu*.so.51 libraries. I think it’s compiled on 14.1, not on latest current (which uses libicu*.so.54 since April).

  20. alienbob

    Hi slodki

    I’ll check tonight what happened. I know I made sure that I compiled the calibre package for slackware-current on an up-to-date virtual machine. I’ll boot that VM tonight and install the calibre package on it. Perhaps I missed something.
    Can you check the MD5SUM of the package you installed? It should be:

    ac95ec217529156e1c6a299ae67cee61 calibre/pkg/current/calibre-2.31.0-i486-1alien.txz

  21. alienbob

    I could check remotely and this is what my calibre package tells me:

    $ ldd /usr/lib/calibre/lib/python2.7/site-packages/PyQt5/ |grep icu => /usr/lib/ (0xb6ae5000) => /usr/lib/ (0xb6977000) => /usr/lib/ (0xb514b000)

    I.e. the package links correctly to icu4c-54.1.
    The package you installed is most likely the one compiled for Slackware 14.1 so my next question is: what is the URL of the package you downloaded?

  22. slodki

    installed via gslapt, I’ve 2 packages in /var/slapt-get/calibre/pkg/current only:
    21929c00650fa7af416131372f717ddf calibre-2.30.0-i486-1alien.txz
    ac95ec217529156e1c6a299ae67cee61 calibre-2.31.0-i486-1alien.txz
    Both files extracted from your txz packages:
    7a0b8b510e00ffbe3f234808e9fe70bb /tmp/new/
    4b56006a1e67d552e9b9cd2687531fd1 /tmp/old/
    are linked to .51 version. 54.1 version is available in standard /usr/lib, from official package.

  23. alienbob

    The icu4c linking does not happen in calibre. You have a qt5 package which has been compiled for Slackware 14.1 and that links against the wrong icu4c libraries if used on slackware-current:

    Before installing qt5-5.4.1-i486-1alien :

    # ldd /usr/lib/calibre/lib/python2.7/site-packages/PyQt5/ (0xb7780000) => not found => /lib/ (0xb74b6000) => /usr/lib/ (0xb73c4000) => /lib/ (0xb737a000) => /usr/lib/ (0xb735c000) => /lib/ (0xb71c4000)
    /lib/ (0xb7781000)

    After installing qt5-5.4.1-i486-1alien

    # ldd /usr/lib/calibre/lib/python2.7/site-packages/PyQt5/ => /usr/lib/ (0xb7064000) => /usr/lib/ (0xb6abe000) => /usr/lib/ (0xb6950000) => /usr/lib/ (0xb5124000)

    # ldd /usr/lib/ => /usr/lib/ (0xb701a000) => /usr/lib/ (0xb6eac000) => /usr/lib/ (0xb5680000)

  24. slodki

    bingo! qt5 was autoselected from dependency, but from wrong dir…

  25. Janis

    I have the same problem with building of calibre (unfortunately – I have newer imagemagick so you package does not run due to the deps) lacking PyQT5 – it seems something is not building well: I get
    Error: This version of PyQt5 requires sip 4.16.6 or later.
    despite sip 4.16.7 being built successfully in previous step

  26. Janis

    actually – the process dies sooner at building dbus-python:

    checking for python extension module directory… ${exec_prefix}/lib64/python2.7/site-packages
    configure: PYTHON_INCLUDES overridden to: -I/usr/lib64/calibre/include/python2.7 /usr/include/python2.7
    checking whether those headers are sufficient… no
    configure: error: could not find Python headers

  27. alienbob

    Without more detail I can not even start helping you.
    What version of Slackware? What commandline to build the calibre package? What other packages did you install already that the SlackBuild might be building as well?

  28. Janis

    Slack64-14.1, for building just run your script.
    sip 4.1.7 and dbus-python are already installed as separate packages.
    During build of PyQT at installation I get such error:
    install -m 755 -p /tmp/build/tmp-calibre/PyQt-gpl-5.4.1/pyuic5 /tmp/build/package-calibre/usr/bin/
    strip /tmp/build/package-calibre/usr/bin/pyuic5
    strip:/tmp/build/package-calibre/usr/bin/pyuic5: File format not recognized
    make: [install_pyuic5] Error 1 (ignored)

    which eventually leads to lackig lib as mentioned in mu=y first comment

  29. Janis

    the essential event in building:
    ** calibre **

    Hmm… Looks like a unified diff to me…
    The text leading up to this was:
    |— calibre-2.28.0/setup/ 2015-05-15 05:29:00.000000000 +0200
    |+++ calibre-2.28.0/setup/ 2015-05-27 10:20:43.236708204 +0200
    patching file setup/
    Using Plan A…
    Hunk #1 succeeded at 548 (offset 16 lines).
    Traceback (most recent call last):
    File “”, line 13, in
    import setup.commands as commands
    File “/tmp/build/tmp-calibre/calibre-2.32.1/setup/”, line 28, in
    from setup.translations import POT, GetTranslations, Translations, ISO639, ISO3166
    File “/tmp/build/tmp-calibre/calibre-2.32.1/setup/”, line 14, in
    from setup.parallel_build import parallel_check_output
    File “/tmp/build/tmp-calibre/calibre-2.32.1/setup/”, line 14, in
    from setup.build_environment import cpu_count
    File “/tmp/build/tmp-calibre/calibre-2.32.1/setup/”, line 96, in
    from PyQt5.QtCore import PYQT_CONFIGURATION
    ImportError: No module named PyQt5.QtCore

  30. Janis

    it’s ridiculous, but I am not able to build 1.48 also:
    ####### Building extension libmtp #######

    * Running gui

    Traceback (most recent call last):
    File “”, line 99, in
    File “”, line 85, in main
    File “/tmp/build/tmp-calibre1/calibre/setup/”, line 181, in run_all
    self.run_cmd(self, opts)
    File “/tmp/build/tmp-calibre1/calibre/setup/”, line 175, in run_cmd
    self.run_cmd(scmd, opts)
    File “/tmp/build/tmp-calibre1/calibre/setup/”, line 178, in run_cmd
    File “/tmp/build/tmp-calibre1/calibre/setup/”, line 41, in run
    File “/tmp/build/tmp-calibre1/calibre/setup/”, line 63, in build_forms
    from calibre.gui2 import build_forms
    File “/tmp/build/tmp-calibre1/calibre/src/calibre/gui2/”, line 7, in
    from PyQt4.Qt import (QVariant, QFileInfo, QObject, QBuffer, Qt,
    ImportError: cannot import name QVariant

    (the same system, KDE 4.14.3/Qt 4.8.6)

  31. Janis

    I solved the mystery with calibre1 – the compilation does not work if the sip is v.4.16.7, with v.4.14.2 i can be compiled and runs fine.
    Calibre2 still waits for ideas. even on fresh slack64-14.1 VM it dies at the same stage – ImportError: No module named PyQt5.QtCore

  32. alienbob

    Mind you, I build my calibre packages with the following commandline to prevent from having to build and install every dependency separately:

    # BUILD_PYTHON=YES ./calibre.SlackBuild

    Because Slackware already contains python 2.7, the calibre script won’t compile its own private python. The consequence of that is, that it _also_ does not compile the other python dependencies. You can override this behaviour by using the above commandline.

  33. Janis

    Thank you very much, Eric!

  34. Janis

    Hi, Eric!
    I think, its not package related, but may be you have idea:
    all metatdata request ends with
    calibre, version 2.32.1
    K??DA: Lejupiel?de neizdev?s: Neizdev?s lejupiel?d?t metadatus. Uzklikš?iniet “R?d?t vair?k”plaš?kai inform?cijai

    Traceback (most recent call last):
    File “/usr/lib64/calibre/calibre/utils/ipc/”, line 274, in main
    res = {‘result’:func(*args, **kwargs)}
    File “/usr/lib64/calibre/calibre/ebooks/metadata/sources/”, line 103, in single_identify
    File “/usr/lib64/calibre/calibre/ebooks/metadata/sources/”, line 452, in identify
    log(‘Request extra headers:’, plugin.browser.addheaders)
    File “/usr/lib64/calibre/calibre/ebooks/metadata/sources/”, line 285, in browser
    self._browser = browser(user_agent=self.user_agent)
    File “/usr/lib64/calibre/calibre/”, line 403, in browser
    opener = Browser(verify_ssl=verify_ssl_certificates)
    File “/usr/lib64/calibre/calibre/utils/”, line 44, in __init__
    sc = ssl.create_default_context() if kwargs.pop(‘verify_ssl’, True) else ssl._create_unverified_context(cert_reqs=ssl.CERT_NONE)
    AttributeError: ‘module’ object has no attribute ‘create_default_context’

    It seems smth is wrong with ssl. At first i thought it has anything to do with openssh 7, but reverting to the original package did not improve the situation. May be it is a bug to be reported?

  35. alienbob

    Hi Janis

    Calibre developer has increased the minimum required version of Python to 2.7.9 (it used to be 2.7.1). The reason for that is the use of “SSLContext”. This attribute was introduced in python-2.7.9.

    My guess is that you have built Calibre yourself on Slackware 14.1 which has Python 2.7.5.
    I have updated the calibre.SlackBuild script for my next release, to check for python 2.7.9 and if your python is older, the script will compile 2.7.10 into the package.

    For now you can recompile using my SlackBuild and add a working Python using the following command:
    # BUILD_PYTHON=YES ./calibre.SlackBuild

  36. Janis

    Thank you for clarification!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2024 Alien Pastures

Theme by Anders NorenUp ↑