My thoughts on Slackware, life and everything

Tag: ebook (Page 1 of 2)

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

First package for Calibre6 in my repository

Not so very long after I was finally able to produce my first packages for Calibre 5.x, Kovid Goyal ended that development cycle and bumped his e-book management application’s major version number to “6” in order to make a switch from Qt5 to Qt6 as its graphical engine.

The main hurdle for me when the upgrade from Calibre 4.x to 5.x happened was that internally, Calibre switched from Python2 to Python3. Essentially the whole of Calibre is written in Python and it uses PyQt to build the graphical interface using Qt widgets.

It took me a lot of work to re-write the calibre.SlackBuild to also make that Python switch. After all, my single calibre package is actually getting built from many sources (44 tarballs for Calibre 4, 55 tarballs for Calibre 5) and a lot of those had to be replaced to work with Python3. Moving my calibre.SlackBuild to Python3 took so much effort that I decided to apply some simplification as well: I removed the script’s ability to build its own Qt5 libraries from source, instead I let my calibre-5.x packages depend on the qt5 package which is already present in the Slackware OS since release 15.0.
Naturally I was not looking forward to doing the same cumbersome and time-consuming exercise again, now having to figure out the intricacies of Qt6, a graphical toolkit I had never built or used before.

But I was bothered by the consequence that I had to stick with Calibre 5.44 being the final release using Qt5, and so I decided to take my time, and inbetween other activities I started gradually re-writing the calibre.SlackBuild script to encompass the new sources and get these compiled and tested.

Now then finally, you can install Calibre 6 on Slackware using a 170 MB large natively-built package which needs 64 source tarballs to compile You can get the new Calibre 6 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.

To refresh your memory in case you are still thinking “what the heck is he talking about” – Calibre is an e-book library management program which I started using after buying my first E-reader (a Sony TRS-T1) and discovering that the accompanying e-book management software was proprietary and not user-friendly. The functionality and ease-of-use of Calibre were so much better than the commercial software that I never looked back.
I now read my e-books on a Kobo Aura2 H2O . Adding books to the reader is dead-simple: Calibre exports my book library on the internet as a OPDS server that works with any e-reader that has Internet connectivity, and I can scroll through my library even when on vacation and pick a new book to read. The power of Open Source.

A note for those of you who are on a 32bit Slackware and are currently using my Calibre 5.x package. With Calibre 6 it is no longer needed to set the “QTWEBENGINE_CHROMIUM_FLAGS” variable to disable seccomp. Qt6 does not appear to have the issues that the embedded Chromium browser of Qt5 had.

I also checked that the application’s screenreader still 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.
This is great, but the downside of it is, that the default espeak voice sounds like Steve Hawking came to visit you. If you find out how to improve the text-to-speech capability of Calibre by adding voices (especially non-english) and playing with the various engines, please let me know in the comments section below. I really would like to improve the out-of-the-box TTS experience for people with visual disabilities or dyslexia.

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 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

Calibre 3.30.0 for Slackware with internal Qt5 libraries

It took me quite a while to release a new package for Calibre, the e-book library manager. That had a reason.

In July I switched the Qt5 package in my repositories to version 5.11 to support the latest KDE Plasma5 software and because it offers advantages over the previous 5.9 releases. Unfortunately, as I found out soon afterwards, the Calibre software fails to work with Qt 5.11 – its GUI components were not built and there was no obvious error to explain why.

Therefore I had to re-visit the calibre.SlackBuild‘s internals and try to revive the internal functions that compile an embedded Qt library set. This was last tested in the early days of my Calibre packages when Qt4 was the running champion. Adding internal Qt5 support was quite a different beast. Qt5 is a lot bigger than the venerable Qt4 so the build process needed some pruning to keep the compilation times acceptable and the package size under control.

That took a full week’s nights of compiling, debugging, recompiling and so on… hence the lack of updates on the ‘ktown’ front where I should perhaps pay some attention to a recent poppler update in slackware-current. But I managed to add Qt 5.9 internal library support to the calibre package.
My package for Slackware 14.2 still depends on an external ‘qt5’ package (to keep the package size small and because calibre works just fine with the qt 5.7 which is available from my own repository and the SBo script repository). The package for Slackware -current on the other hand was built with an embedded Qt 5.9, which means that its external dependency list shrunk to just ‘podofo’ and ‘unrar’.

Grab the new ‘calibre’ package and enjoy your e-book library!

« Older posts

© 2024 Alien Pastures

Theme by Anders NorenUp ↑