Okay. Rant time.
A bit of a rant about “cross-platform” software that is not exactly cross-platform.
Around 4 AM last night, I wanted to read something before I fall asleep.
“Hey”, I thought, “I haven’t read The Pulling Report in a while.” The report has been around for quite a long time, and it’s funny how I have two Firefox bookmarks to the thing and neither points to the current location.
It’s just that now I have an Android tablet, so I thought I might read the thing on that. It’s just that on this particular tablet, Firefox for Mobile isn’t exactly a speed demon.
So what the hell, I thought I might have as well convert the thing to an EPUB file and read it using Cool Reader.
The best way to create EPUB files is by using Sigil. I’ve used it before on Windows and it’s a fantastic app. Now, my netbook is a little bit dead, so so much for running the bastard on Windows.
What do I do now? Well, Sigil is a cross-platform program. It also runs on Linux and Mac OS X.
Of course there’s no official Linux binaries of Sigil, so I tried downloading the source code. It required me to install Qt 5, which is pretty funny, because I didn’t even know there is a fifth major version of Qt, because as any fool knows, Nokia never gets anything really done. The Linux build instructions also thoughtfully asked you to use the compilers provided with Qt. Fuck that, just because Qt provides its own version of GCC with it on Windows doesn’t mean it’s a brilliant idea to bundle that shit on Linux. This is fucking Unix, the system is fucking supposed to come with its own compiler toolchain anyway, and I have perfectly functional copies of GCC and LLVM Clang around, thank you very much.
A little bit of tweaking, aaaaaaand Sigil then Fails To Build From Source. Debian people call this situation “FTBFS”. I don’t know what this abbreviation means, but I assume it means “fuck this bastard’s fucking source”. Apparently, after installing the Qt 5 development files, the Sigil build system fails to find the Qt 5 development files. Turns out it wants some very private development files. Hush hush.
Tried installing Sigil on my sister’s old PowerBook. After downloading, I noticed that the final download page has a tiny notice that says “10.8+”. Are you fucking kidding me, Mac OS X versions don’t ever go past 10.5…?
But oh! A bit of Googling says that while Sigil doesn’t have official Debian binaries, it does have unofficial binaries for Ubuntu. Since Ubuntu is mostly Debian-based, all I need to do is to just download the .deb and install it, right? Oh, too bad the most recent version of Sigil is 0.7.2 and the packages are 0.5.3, which is like a few years old, but that’s not a huge problem, is it? I don’t need huge bells and whistles and most recent EPUB 3 finesses, all I just want to do is to convert a bloody HTML file to EPUB.
When I run the program I get
SIGILL, which is not a mispelled version of the program’s name. Instead it stands for “illegal instruction” signal.
You know, if Debian builds official packages, they try to set up the build environment so that the programs run at minimum set of hardware. Programs that don’t absolutely fucking need SSE2 don’t get built with SSE2 optimisations.
I can understand that some CPU-heavy apps need SSE2, but this is a fucking text editor.
Ultimately, I couldn’t run the software on Linux or Mac, so I decided to do what I was supposed to do. Install the newest version of pandoc, which is able to slurp in a HTML file and spit out a rather rough EPUB.
Which was good enough for now. I could just read that stuff and fall asleep.
Then the dawn came. Back to fucking around with Sigil source!
I decided that I need to install Qt 5 development stuff to get stuff rolling. And a bunch of private source packages that are apparently not supposed to be needed for normal development and aren’t installed by default, hint hint.
I installed Qt 5 SVG development files, and their private versions. I installed WebKit development files, and it fails to find WebKit headers because I don’t have the private files. Never mind, I’ll install the pri—
…there’s no private files for WebKit in Debian.
I absolutely can’t build this shit from source because cmake is retarded and wants private shit.
Well never mind about running this shit on Linux, then. Cross-platform applications my ass. If this had been written in Java or, goddess forbid, C#, I’d be already using it.
Ultimately, I figured out what to do. I knew why the Ubuntu PPA version depended on 0.5.3: it was still based on Qt 4 instead of Qt fucking 5. So if the binaries on the PPA are SSE2-only, maybe I can just build those bastards from the source.
I added the Ubuntu Oneiric PPA to my sources, then did…
# apt-get build-dep sigil # apt-get source sigil # cd sigil-0.5.3 # CC=clang CXX=clang++ debian/rules binary
(…cut a huge bunch of further updating of shit that’s vaguely specified in the packages - I had Boost 1.46 installed and apparently 1.49 was required to build this shit…)
It builds! It builds for a good hour and then some! Longer than the fucking Linux kernel! On fucking Clang, which is much faster than GCC that is needed to build the Linux kernel!
…and it’s done.
# cd .. # dpkg -i sigil_0.5.3-0rg0~oneiric1_i386.deb
Wooo! It installs!
% sigil ... zsh: illegal hardware instruction sigil
Plague upon you and your progeny. May the ground reject thee.
It’s a fucking text editor. I had fucking text editors on my Commodore 64. What the fuck does it need fucking advanced CPU pipelining for?
Someone needs to make an EPUB builder for Emacs or something.
UPDATE: Holy shit!
% CC=clang CXX=clang++ \ CFLAGS="-march=athlon-xp" \ CXXFLAGS="-march=athlon-xp" \ fakeroot debian/rules binary
A couple of hours of *ahem* rebuilding later, it actually works now.
I feared I might have had to shake my fist accusingly at the heavens, but after explicitly specifying Athlon XP as the architecture, the program runs perfectly in Linux without feeling
ILL from all the SSE2 bullshit.