Compiling ovoplayer under FreeBSD


Subject

We're going to compile ovoplayer from source under FreeBSD. This is a music player which is not distributed to FreeBSD.

Prerequisites

  • Free Pascal Compiler (I used branch fixes-3.2)
  • Lazarus (I used version 3.8)
  • Qt5Pas library
  • DBUS
  • Bash
  • Git

Step 1: Clone the repository

Choose a directory and execute git clone https://github.com/varianus/ovoplayer.

Step 2: Adjust buildlinux.sh

We will use the linux build script provided in the distribution to build our player. It only requires a couple of changes:

  • Adjust the path to Lazarus in LAZARUS_DIR variable
  • Replace all occurrences of linux with freebsd
  • Lastly, add --ws=qt5 to lazbuild called on ovoplayer.lpi (unless your lazbuild builds Qt5 by default)

Step 3: Adjust release.cfg

This file contains extra fpc configuration. In my case, I needed to add two additional options:

  • Point to DBUS units from FPC source: -Fu/path/to/fpc/source/packages/dbus/src
  • Point to Qt5 library: -Fl/usr/local/lib/qt5

Step 4: Enable cthreads

The last thing to do before compiling is to enable cthreads, needed for the player to actually play the music. You can either add a UseCThreads define or remove the {$IFDEF UseCThreads} macro in src/ovoplayer.lpr file. I chose the latter.

Step 5: Compile!

Simply run bash buildlinux.sh. The compilation should pass without any more problems. After compiling, you will have the program available in bin/freebsd/ovoplayer.

Step 6: Adjusting the configuration

After successfully compiling, my ovoplayer could not start properly because it was searching for resources in /usr/share. To fix this, after running it first time, locate ~/.config/ovoplayer.cfg file and modify ResourcesPath value under UNIX section. It was enough to point to images directory of the repository pulled from Github.

That's it!

You can now enjoy your pascal-powered music player.


Comments? Suggestions? Send to bbrtj.pro@gmail.com
Published on 2025-04-24