My thoughts on Slackware, life and everything

Tag: mobi

Calibre 5.x available for Slackware 15.0 and -current (finally)

Finally! I have a working package for Calibre 5.38.0, targeting Slackware 15.0 and -current.

As you surely know by now, Calibre is an e-book library management program, probably the best you can get and it surpasses its commercial rivals in terms of feature set and ease of use.

Calibre is not only a library manager, it can act as a content server to make your book library accessible online (on your phone and in web browsers for instance), and it also contains a Qt5-based e-book reader application, as well as a full-fledged e-book editor. If you have online magazine or newspaper subscriptions, Calibre can download these magazines automatically for you and add them to your library.

It is also quite the complex piece of software. It is written in Python, using several modules to enable its features. Calibre creates its graphical user interface using PyQt5 widget libraries. My calibre package for Slackware embeds all these modules, so that the package does not have any external dependencies. It does expect a full Slackware installation however, because that includes Qt5, PyQt5 and related packages. You could slim down your Slackware as long as you keep Qt5 related packages installed.

It took a long time to upgrade my Calibre 4.x package to 5.x, the first release in the 5.x series was on 25 September 2020. The reason is that the developer, Kovid Goyal, switched Calibre from Python 2 to Python3 and that influenced many of the Python modules that are used by the program. I had decided to wait for a Slackware 15.0 release to start working on the calibre.SlackBuild… but then that Slackware 15.0 release got delayed, and delayed, and… I could finally free up some of my time to actually do this, last week.

So here it is: Calibre 5.38.0, get it from my repository or any mirror (like my own US mirror)!

Note that you should either install my calibre4 package, or calibre (now at 5.x) but do not install both at the same time! Their files overlap.

Another note: on 32bit Slackware 15.0 and -current, all Chromium based programs will crash with a seccomp error. This is caused by the changes in glibc with regard to secure computing (seccomp), and the affected versions of glibc can be found in Slackware 15.0 and newer. The Chromium developers have been unable to update their sourcecode to make this work on 32bit Operating Systems. As a result, for instance Falkon on 32bit Slackware 15.0 and newer will crash immediately on startup.
The workaround is to disable the seccomp filter sandbox for your 32bit OS. This is achieved without much effort, you have to make an environment variable available after login: QTWEBENGINE_CHROMIUM_FLAGS needs to be set to “--disable-seccomp-filter-sandbox“.

For bash-compatible shells you would do as follows:

# echo "export QTWEBENGINE_CHROMIUM_FLAGS='--disable-seccomp-filter-sandbox'" > /etc/profile.d/chromium_seccomp.sh
# chmod +x /etc/profile.d/chromium_seccomp.sh

And after logging in again, you should find that calibre works also on 32bit Slackware.

Addendum: even the screenreader works. Right-click the current page in your open e-book text and then click “Read Aloud“. The text-to-speech is provided by an embedded speech-dispatcher program. Unfortunately the configuration button does not work there, but if you don’t like the default espeak voice you can manually pick one of the available alternatives by editing the file “/usr/lib64/calibre/etc/speech-dispatcher/speechd.conf” (on 32bit Slackware the libdir is ‘lib‘ of course).

Have fun! Eric

E-book management on Slackware

Managing your e-book collection

In an earlier post, I hinted about a Slackware package I was trying to create for Calibre. The reason being that I bought my wife an e-reader: a Sony PRS650 with a touch screen using infrared instead of a touch-sensitive layer and pearl e-ink technology. Both those features make for an extremely pleasant reading experience.

However, the Sony Reader software that accompanies the device, is a Windows-only application (of course…) and second, it is not all that much of an application either. Even for Windows, the usual advice you get it is to install Calibre for  managing your e-books – including uploading them to your device.

So, I needed to have Calibre available on my Slackware computers. In fact, I used to have a package for Calibre already! At some point in time the Calibre developer decided to increase the required version of the Python interpreter to 2.7.1. And since Slackware ships Python 2.6.6 to this day, I was no longer able to compile updated packages  (I got stuck at 0.7.23 but I guess it would have been possible to keep compiling Calibre as far as 0.7.45).

I still wanted a recent version of Calibre, the software has updates about once a week! So I spent quite a lot of time researching how I could add an embedded Python interpreter plus several supporting Python modules into the Calibre package.

And I think I succeeded. I have uploaded Slackware packages for calibre-0.8.6 to my repository yesterday (for Slackware 13.1 as well as Slackware 13.37). During the period where I did not actually have an e-reader at my disposition (it arrived at the house only a few days ago) I used the testing genius of my pal mrgoblin who happened to have an e-reader device in his possession. His beta tests made me realize that I was missing the dbus-python module which is needed for Calibre to recognize when a device is plugged into the computer.

I must say, using Calibre is a lot of fun! I have a small collection of e-books and after installing the Slackware package, I was able to transfer my books to the Sony device and read them there. Then, I managed to almost brick the device by ripping out the USB cable before selecting “Eject Device” in Calibre… let that be a warning for prospective users! It took a lot of reading about soft and hard resets before I had a working e-reader again. I had to reset the device to factory defaults – which means you lose all the books that were already present on the device. It was a good learning experience with only minor inconvenience (because I had transfered only two books to the e-reader at the time) but I kept feeling my wife’s prying eyes in the back of my neck… she was not too pleased with seeing her birthday present getting bricked only 15 minutes after unpacking it!

Calibre will also be very useful for everyone who owns a Kindle (Amazon’s own e-reader). The Kindle only accepts Amazon’s own MOBI format and refuses the “open” EPUB format (which is the most commonly used e-book format outside the US). Using Calibre, you can easily convert your EPUB collection to MOBI format – when you select an EPUB file and tell it to upload it to a Kindle, Calibre will show a dialog that prompts for the automatic conversion to the Kindle’s format. Perfect!

OK, enough talk. Get a package and/or SlackBuild script at:

and don’t forget to also install the icu4c and podofo packages; these two are the only dependencies now. If you want to build the package yourself, be warned if you are running Slackware-current. There is a bug in the “file” utility in Slackware-current which prevents it from recognizing a ZIP file as such, and this bug will cause the SlackBuild script to fail. Thanks to Francesco Allertsen who first ran into this issue and reported it to me, a quick fix is to change the line 235 in the calibre.SlackBuild script:

if $(file ${SOURCE[$i]} | grep -qi “: zip”); then

to:

if $(echo ${SOURCE[$i]} | grep -qi “.zip$”); then

I hope to see a fixed “file” soon. A bugfix has been applied to the file repository already, so file-5.08 should detect ZIP files correctly when it gets released.

Have fun! Eric

© 2024 Alien Pastures

Theme by Anders NorenUp ↑