Building D2K

Source Code

To retrieve D2K’s source code, see the Download page.

Dependencies

D2K has quite a few dependencies:

  • GLib
    • libiconv
    • libffi
    • PCRE
    • gettext
    • gtk-doc
      • docbook
      • libxml2
        • itstool
      • libxslt
    • zlib
  • cairo
    • fontconfig
      • expat
    • libpng
    • pixman
  • Pango
    • FreeType2
    • HarfBuzz
      • ragel
  • Lua
  • Lua GObject Introspection
    • GObject Introspection
  • OpenGL
  • LibXDiff
  • ENet
  • cURL
    • GnuTLS
    • libssh2
    • libidn2
  • Jansson
  • SDL
  • SDL_image
  • SDL_mixer
  • xz
  • PortMidi*
  • FluidSynth*
  • libjpeg*
  • libtiff*
  • libwebp*
  • DUMB*
  • libogg*
  • libvorbis*
  • FLAC*
  • libMAD*
  • MikMod*
  • gperf*

* = optional

On Arch Linux, the only dependency not bundled is libXDiff which can be found in the AUR. I’m afraid I can’t help with other distributions or operating systems.

Building on Linux

Building requires CMake.

Dependencies should be installed according to your distribution (Debian/Ubuntu/Mint will use apt-get, RedHat/Fedora will use yum, Arch Linux will use pacman, etc.). Afterwards, build.sh will build d2k in the cbuild subfolder.

Building on Mac OS X

Building requires CMake.

Building on Mac OS X hasn’t been tested for some time.

Dependencies may be installed using the Homebrew project and the install_macosx_packages.sh script found in the D2K source repository. Afterwards, build-mac.sh will build the d2k in the cbuild subfolder.

Building on Windows

Windows builds are cross-compiled on Linux. Building natively on Windows hasn’t been tested for some time.

There is an outdated Code::Blocks project in the codeblocks folder.

Assuming your D2K source is at C:\d2k, the Code::Blocks project file expects dependencies at C:\d2k\deps, so that libfluidsynth.dll resides at C:\d2k\deps\bin\libfluidsynth.dll.

Because satisfying D2K’s dependencies on Windows is difficult, I have either located or built them and put them here. You will need 7-Zip (or something that handles .7z files) to decompress the archive.

Cross-Compiling

D2K can be cross-compiled on Linux for Windows; in fact, this is how Windows binaries are built. To do so:

  • Clone D2K
    • Assuming install folder of ~/d2k
  • Unpack the dependencies to ~/d2k/crossdeps, so that libfluidsynth.dll is at ~/d2k/crossdeps/bin/libfluidsynth.dll
  • Run crossbuild.sh
    • Executable will be ~/d2k/crossbuild/d2k.exe
  • Run build_windows_package.sh
    • Archive will be ~/d2k/d2k.7z

MP3

MP3 support is mostly free now. However, OGG is a superior and definitely free technology; I encourage mappers and modders to use it instead.