Revisiting Penguin Subtitle Player and Qt

Update: There’s a new post about building Qt statically in Windows

It has been a while since I last updated Penguin Subtitle Player. Anyways, after a few days of work, and more than a year of waiting since the last beta, here comes the first production release of Penguin Subtitle Player. Apart from developing multi-subtitle-format parser support for maximum flexibility and maintainability and fixing a few GitHub issues, most importantly, I have tidied up the project and code to meet the standard of a good open-source project. The project is ready for testing and TravisCI is doing its work.

The subtitle player’s deployment is actually quite complicated since the goal of it is to be open-source, cross-platform and standalone. The “standalone” term implies convenience to user and trouble to me. Compiling Qt statically is time-consuming and messy, especially when you have to do it for 3 platforms. It will take you 3-4 hours before you notice another wrong configuration.

Here are some tips for those who are static compiling Qt5.8 under Ubuntu:

During ./configure,

  • -static, of course.
  • Use -qt-xcb, otherwise, your binary will complain about xcb not found.
  • Use -fontconfig, otherwise, there will be no font in your binary. It requires -system-freetype.
  • -nomake examples -nomake tests is the usual thing, otherwise, it will be slow and will blow up your hard disk. This thread on SO says it needs 70GB.

During your trial and error with ./configure,

  • Make sure you -recheck-all after installing libraries and if you don’t clear the build directories.

During make,

  • -j is supposed to speed things up. e.g. -j 4 means 4 recipes to execute at once.
  • If anything goes wrong, don’t make clean because it will take ages. If you git clone’d it, git checkout everything will be a better idea. If you downloaded the source manually, just rm -rf the current directory and extract the .tar again. Thank me later!

Here’s something else you may find useful:

2 years ago, it took me 3-4 days to compile Qt. Now it takes me 2 days. Next time? No, thanks.

Tags// , ,