Compiling UltraStar Deluxe - HermannDppes/USDX GitHub Wiki

Freepascal 3.0.0 or newer is required to compile UltraStar Deluxe. If you had some older version of fpc installed before, make sure to remove everything of it correctly before trying to install freepascal (otherwise compiling will fail with various weird error messages). Also, using the 3.0-development branch with current fixes is suggested. If you want to help the project by coding patches, we suggest you to use the Lazarus 1.6 or newer integrated development environment. For linking and running the game, the following libraries are also required:

  • SDL2, SDL2_image
  • ffmpeg 2.8 or older
  • sqlite
  • bass
  • some fonts like ttf-dejavu and ttf-freefont
  • portaudio
  • lua 5.1 or 5.2 or 5.3
  • opencv if you want webcam support
  • projectM if you want audio visualisation support

Compiling using Lazarus

  1. Start Lazarus.
  2. Choose Project → Open Project … in the menu bar. A file-dialog box will show.
  3. Change to the src subdirectory of your USDX working copy (e.g. ultrastardx/src).
  • If you are running Windows, open the ultrastardx-win.lpi project-file (Preferably use the win32 verison of lazarus, as the included libraries are 32 bit).
  • On Unix-like systems use the ultrastardx-unix.lpi file.
  1. Now you can compile USDX by choosing the menu entry Run → Build or pressing Ctrl+F9.
  2. If you want to compile and/or start USDX directly choose Run → Run or press F9.

Compiling on Linux/BSD using make

  1. make sure all required libraries are installed
  • for current debian / ubuntu: sudo apt-get update && sudo apt-get install git automake make gcc fpc libsdl2-image-dev libavformat-dev libswscale-dev libsqlite3-dev libfreetype6-dev portaudio19-dev libportmidi-dev liblua5.3-dev libopencv-videoio-dev
  • if you want to build --with-libprojectM, you also need sudo apt-get install g++ libprojectm-dev
  • if you want to build --with-opencv-cxx-api, you also need sudo apt-get install g++ libopencv-dev
  • for Fedora with RPM Fusion: sudo dnf install git automake make gcc fpc SDL2_image-devel ffmpeg-devel sqlite-devel freetype-devel portaudio-devel portmidi-devel lua-devel opencv-devel and to be able to use --with-libprojectM: sudo dnf install gcc-c++ libprojectM-devel
  • for arch linux there is an aur package called ultrastardx-git
  1. git clone https://github.com/UltraStar-Deluxe/USDX
  2. cd USDX
  3. ./autogen.sh
  4. ./configure (or use autoconf)
  5. make
  6. Play the game,
    • install the game and start it
      • sudo make install
      • ultrastardx
    • or start it directly ./game/ultrastardx

Compiling on Linux using flatpak-builder

  • The Flatpak manifest uses the org.freedesktop.Platform 20.08 runtime, which is available for the major architectures on the Flathub remote. If it isn't available for your architecture, you can lower the version in the manifest. Below 19.08 you either need to enable the dav1d module or disable AV1 support in the ffmpeg module by removing the --enable-libdav1d configure option. For some architectures the runtime is not hosted by Flathub but can be downloaded from the Freedesktop SDK remote.
  • The build has to be done outside of the USDX source code tree since flatpak-builder will to copy the whole source tree into the build directory. Also note that flatpak-builder will create a hidden directory .flatpak-builder in the directory it was called in where downloads and build results are cached.
  • Assuming you can use the Flathub remote and you didn't already add it to your flatpak configuration, you can do it with
    • flatpak remote-add --user flathub https://flathub.org/repo/flathub.flatpakrepo
  • Then building and installing the USDX flatpak is just a matter of
    • flatpak-builder --user --install-deps-from=flathub --install build $USDX_SOURCE_TREE/dists/flatpak/eu.usdx.UltraStarDeluxe.yaml
  • The .flatpak-builder and build directories can be removed afterwards.
  • Songs must be placed in ~/.var/app/eu.usdx.UltraStarDeluxe/.ultrastardx/songs

Compiling on macOS (High Sierra and above)

  • USDX is built using Homebrew and official FreePascal build (using its compiler FPC)
  • To install Homebrew, follow instructions from brew.sh
  • You can get the FPC build from freepascal.org or
    • brew install fpc
  • Make sure the XCode command line tools are installed.
    • xcode-select --install
  • Needed brew libraries can be installed using (ffmpeg up to 4.2.1 is supported):
    • brew install sdl2 sdl2_image automake portaudio binutils sqlite freetype lua libtiff pkg-config ffmpeg
  • Clone repo
    • git clone https://github.com/UltraStar-Deluxe/USDX
  • Generate configure file and more
    • ./autogen.sh
  • Make sure that you have your build setup right
    • ./configure
  • Now build the UltraStar application
    • make macosx-standalone-app
  • Run by clicking UltraStarDeluxe in your build folder or
    • open UltraStarDeluxe.app

Feel free to fork this project, modify it to your hearts content and maybe also do pull requests to this repository for additional features, improvements or clean-ups.