Installation Instructions
-------------------------

    1. Get the source

       Goggles Music Manager builds against the FOX toolkit, which is included
       as a git submodule in fox/. Make sure it has been checked out:

       > git clone --recursive https://github.com/gogglesmm/gogglesmm.git

       If you cloned without --recursive:

       > git submodule update --init

       When downloading a release, use the "gogglesmm-full-" tarball or zip.
       The plain "Source code" archives generated by GitHub do not contain the
       FOX submodule and will fail to configure.

       Alternatively, build against a FOX library already installed on your
       system or against an existing FOX build tree. See FOX_USE_EXTERNAL and
       FOX_BUILD_TREE in step 4, and cmake/FindFox.md for details.

    2. Install all required dependencies:

      * cmake >= 3.23
      * a C++11 compiler
      * sqlite >= 3.6.19
      * taglib >= 1.9.0
      * expat
      * gettext / libintl            (unless WITH_NLS=OFF)
      * OpenGL and libepoxy          (unless WITH_OPENGL=OFF)

      Building the bundled FOX submodule additionally requires:

      * pkg-config
      * X11, including Xrandr, Xrender, Xcursor, Xfixes and Xi
      * freetype and fontconfig
      * OpenGL                       (unless WITH_OPENGL=OFF)

    3. Install optional dependencies:

       * dbus 1.0.x
       * flac
       * mad
       * vorbis (or tremor)
       * ogg
       * opus
       * faad2
       * pulse
       * sndio
       * jack (the Jack output plugin is currently not functional)
       * a52
       * libdca
       * zlib
       * openssl, gnutls or libgcrypt
       * X11 SM and ICE (for X session support)

       The bundled FOX toolkit also picks up jpeg, tiff, webp, openjpeg,
       bzip2, zlib and cups when they are available.

    4. Run cmake:

       > cmake -B build

       The following options are available:

          CMAKE_INSTALL_PREFIX => Installation Directory (default: /usr)
          CMAKE_BUILD_TYPE     => Set the build type. Available types: Release, Debug, RelWithDebInfo and MinSizeRel (default)
          CMAKE_INSTALL_LIBDIR => Name of directory where libraries are meant to be installed
                                  (default: determined by GNUInstallDirs, typically lib or lib64)
          BUILD_SHARED_LIBS    => Build the audio player as a shared library instead of linking it
                                  statically into the executable (default: OFF, forced ON on Windows)
          ENABLE_LTO           => Enables Link Time Optimization (default: OFF)

          FOX toolkit:

          FOX_USE_EXTERNAL     => Use a FOX library installed on the system instead of the
                                  bundled fox/ submodule (default: OFF)
          FOX_BUILD_TREE       => Path to an existing FOX build tree to build against, for example
                                  /path/to/fox/build/release-native. Takes precedence over the above.
          FOX_BUNDLED_SOURCE_DIR
                               => Override the location of the bundled FOX source (default: fox/)

          Output plugins:

          WITH_OSS             => Enables building the OSS Output plugin (default: OFF on Linux, ON on UNIX)
          WITH_ALSA            => Enables building the ALSA Output plugin (default: ON on Linux, OFF on UNIX)
          WITH_PULSE           => Enables building the PulseAudio Output Plugin
          WITH_SNDIO           => Enables building the Sndio Output Plugin
          WITH_JACK            => Enables building the Jack Output Plugin (default: OFF, currently not functional)
          WITH_WAVOUT          => Enables building the Wav File Output Plugin

          Input plugins:

          WITH_MATROSKA        => Enables building the Matroska Input Plugin
          WITH_MP4             => Enables building the MP4 Input Plugin

          Codecs:

          WITH_OGG             => Enables building with Ogg Library (required for Vorbis and Opus)
          WITH_VORBIS          => Enables building with Vorbis Library
          WITH_TREMOR          => Enables building with Tremor Library (Vorbis Alternative) (default: OFF)
          WITH_FLAC            => Enables building with FLAC library
          WITH_MAD             => Enables building with MAD library
          WITH_ALAC            => Enables building with (buildin) ALAC library
          WITH_FAAD            => Enables building with FAAD2 library
          WITH_OPUS            => Enables building with Opus Library
          WITH_A52             => Enables building with A52 Library (default: OFF)
          WITH_DCA             => Enables building with libdca (default: OFF)

          Networking:

          WITH_OPENSSL         => Enables building with OpenSSL
          WITH_GNUTLS          => Enables building with GnuTLS. Only used when WITH_OPENSSL is OFF.
          WITH_GCRYPT          => Enables building with libgcrypt. Only used when both WITH_OPENSSL
                                  and WITH_GNUTLS are OFF.
          WITH_ZLIB            => Enables building with zlib

          Application features:

          WITH_OPENGL          => Enables OpenGL based features
          WITH_DBUS            => Enables DBUS based features
          WITH_NLS             => Enables Native Language Support
          WITH_SESSION         => Enabled X Session Support
          WITH_STATIC_FOX      => Pull in static library dependencies for FOX (default: OFF)

          Options are enabled by default unless otherwise noted.

       These can be passed on the command line using:

          > cmake -B build -Doption=value

       Note that the bundled FOX toolkit shares some option names with
       Goggles Music Manager, so WITH_OPENGL and WITH_ZLIB apply to both.

       After configuring, cmake prints a summary of the features that have
       been enabled.

    5. Compile

       > cmake --build build

    6. Install

       > sudo cmake --install build

    7. Run the software

       > gogglesmm
