My thoughts on Slackware, life and everything

Tag: library

Calibre 6.14.1 – I finally made it past 6.11…

News for people who no longer read paper books!
Well 😉 I guess everyone needs paper from time to time, but in all honesty, my eyes are getting worse and an E-reader is the optimal device for me when I want to read books – I can enlarge the font and it has a night light.

Calibre 6.x is a really cool-looking and versatile graphical Python3 application, using PyQt to build the graphical interface based on Qt6 widgets. It is the application to use if you have a collection of E-books and an E-reader, and want a decent library management program to move these E-books onto your E-reader. In addition, it offers a good ebook-viewer application for your computer and even an impressively powerful E-book editor.

As you may know, I have been creating native Slackware packages for Calibre for many years. However I had some issues with the compilation of any Calibre release past version 6.11.0. Kovid Goyal, the developer of this e-book management software, removed some of the content from his release tarballs and since version 6.12.0 requires that the build process generates these required files instead.

This meant that I had to study the changes in the Python files which are used to build Calibre to discover how the missing pieces where getting downloaded and compiled during a ‘bootstrap’ build. That took a while but I found a way to get these sources in place before starting the build.
So now again, Calibre packages for Slackware 15.0 and -current will be getting refreshes in my repository.

Download the new Calibre 6.14.1 packages from my repository or any mirror (like my own US mirror). No external dependencies, works out of the box on Slackware 15.0 or -current.

 

Have fun! Eric

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

Calibre 5.x – I can’t create a working package

Calibre is my favorite e-book library management program. My repository contains a package for Calibre 4.x which works well, but it is using Python2 and has been superseded since September 2020 by the new 5.x releases which are based on Python3.
I have been postponing the Slackware package migration from 4.x to 5.x until Slackware 15.0 would be released, since the move from Python 2 to 3 promised to be a significant effort in terms of changing the calibre.SlackBuild script.

Now that Slackware 15.0 is available, I decided to pick up this chore and re-write the build script to support Calibre 5.x. The re-write took several days because of all the new Python modules that are now required by Calibre 5.
I have dropped support for embedding a copy of the Qt5 libraries and compiling an embedded Python interpreter is no longer optional. It simplified the script and reduced the compile-time a lot (no more Qt5 compilation).

Now the bad part. I have been trying to compile Calibre 5.38 on Slackware 15.0 now for the past week. Well, compiling is OK, and the ebook viewer and editor work properly. But the main calibre program crashes with an error “free(): invalid pointer” as soon as it tries to create a new (or read an existing) Calibre database (metadata.db). As a consequence, the Calibre library maintenance program is completely useless.
I have not found a cause for that, and unfortunately the Calibre developer refuses to discuss any bug that is not in his own pre-built binaries.

So I am between a rock and a hard place. I have no idea how to proceed from here, and I am not willing to add a non-functional package to my repository. So I have uploaded my work here:

If anyone wants to try this out and finds the cause of the crash bug, please share your thoughts here.

Thanks, Eric

Calibre 4.2.0 for Slackware with no external dependencies

One of the programs I use a lot on all my computers is Calibre, the E-book library management system. My wife and I both have Kobo e-readers, and on my Android phone I use FBReader to read my books on the road whenever I have some free time.

Having Calibre on a computer still requires a USB cable to transfer e-books from the computer to your ereader/phone, but networked alternatives exist. Calibre comes with a content server which can make your e-book library accessible online (on your LAN or on the Internet). Earlier versions of the Calibre content server were too resource-intensive and therefore I have chosen another solution for online access to my books. That’s COPS. which is short for “Calibre OPDS PHP Server“. OPDS (Open Publication Distribution System) Is the protocol through which E-readers can access online libraries. COPS allows me to download new books to read from my Calibre library over the wireless network to both my Kobo e-reader and to FBReader on my phone. No more cables needed!

FBReader on Android

FBReader accesses e-book library via COPS

Calibre is of course more than a library manager and a content server – the software comes bundled with its own e-book reader, a format converter, and an e-book editor!
Calibre is written in Python. For its graphical interface it heavily uses PyQt5 which in turn is based on Qt5 libraries.
I have been offering calibre packages in my repository for over eight years, starting with the 0.7.20 release as far as I could see (then still Qt4 based). This roughly coincided with my wife buying her first E-reader. The program has evolved a lot over the years and is much better than the proprietary library management software that ships with the major E-reader hardware.

Kovid Goyal is the primary developer, and he released a new major version of Calibre a few weeks ago. The new 4.x series delivers a completely re-written reader, a new content server with basically the same management and editing capabilities as the calibre desktop program, and a stark increase in amount and version numbers of the dependent software. For instance, Calibre 4 now depends on features in Qt 5.13.0 and PyQt 5.13.0. Several new pieces of sofware are listed in the dependencies list now, which were not required for Calibre 3.

The challenge was to create a solid Slackware package for Calibre 4. I know, you can simply download pre-built binaries for a generic Linux platform, and SlackBuilds.org even offers a build script to package these binaries for you, but it is much more fun, and very educational, to compile all of it yourself. In addition you’ll get binaries which are native to your Slackware distro instead of having to resort to binaries that were compiled on Ubuntu or Debian and do unpeakable things to your system when you’re not looking.

Luckily I have taken a week off from work, so I had time to spend on a rewrite of calibre.SlackBuild.

I also decided to do away with external dependencies. Until now, you would have to install podofo and unrar in order to fully use Calibre’s functionality. WIth my new calibre-4 package all dependencies are bundled inside. This includes Python 2.7.17 and Qt 5.13.1 as well as podofo and unrar libraries. This bundling makes it possible to build a fully functional Calibre on Slackware 14.2 (I had to add a newer version of the hunspell spell-checker because Slackware 14.2 has a version that is too old).

You can still compile a calibre package without all these internal libraries. For instance if you already have Qt 5.13.1 installed you can reduce the size of the package significantly by recompiling it. The calibre.SlackBuild will find your Qt5 libraries and won’t compile an internal version then. Same for Python 2.7. But I would recommend building the package always with the python interpreter and the slew of python modules included. It does not take that much time and you’ll be independent of updates in Slackware. Also, I do not offer packages for all those required Python modules anyway.

Here’s a couple of example command lines in case you would want to recompile. If you want create a package without any external dependency:

# BUILD_QT=YES BUILD_PYTHON=YES BUILD_MTP=YES  ./calibre.SlackBuild

In case you already have Qt 5.13.0 or newer installed and want to shrink the size of the package:

# BUILD_PYTHON=YES ./calibre.SlackBuild

Note:
On Slackware 14.2 you will have to install meson, python3 and python3-setuptools from my repository or else the compilation will fail.  Slackware-current contains all of them already.

Note:
If you have issues with Calibre 4 and think you can convince me to re-add a Calibre 3 package to my repository, let me know in the comments section below.

Note:
If you use XFCE or some other desktop environment which does not support StatusNotifier (and only supports the old X11 based XEmbed specification like the systray), then Calibre will not be able to display its system tray icon. You will have to install ‘xfce4-statusnotifier-plugin’ and its dependency ‘libdbusmenu-gtk’. Both are available as packages in my repository. After installing, right-click on the XFCE status bar, select ‘Panel > Add new items’ and add ‘Status Notifier Plugin’.

Get the new ‘calibre-4.2.0‘ package from my repository (or any mirror) and enjoy your e-book library!

If you want to know how to properly setup COPS and serve your e-book library on the internet (with or without authentication) let me know and I will devote an article to the topic. Perhaps in more generic terms, I should address the topic of reverse proxying.

Eric

© 2024 Alien Pastures

Theme by Anders NorenUp ↑