Building on Linux

Requirements

On Debian based systems you can install the requirements with the following command:

$ sudo apt-get install git cmake build-essential libgl1-mesa-dev xorg-dev libasound2-dev

Preparation

First choose a directory to work in, this is where the code will be checked out and built. This directory will be referred to as $DJV_BUILD in the rest of the documentation.

Append your PATH and LD_LIBRARY_PATH environment variables:

$ cd $BUILD_DIR
$ export PATH=$PWD/DJV-install-Debug/bin:$PATH
$ export LD_LIBRARY_PATH=$PWD/DJV-install-Debug/lib:$LD_LIBRARY_PATH

Building DJV

Open a shell, go to the build directory, and clone the DJV repository:

$ cd $BUILD_DIR
$ git clone https://github.com/darbyjohnston/DJV.git

Build the third party dependencies:

$ mkdir DJV-third-party-Debug
$ cd DJV-third-party-Debug
$ cmake ../DJV/third-party -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../DJV-install-Debug
$ cmake --build .
$ cmake --build . --target install
$ cd ..

Build DJV:

$ mkdir DJV-Debug
$ cd DJV-Debug
$ cmake ../DJV -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../DJV-install-Debug -DCMAKE_PREFIX_PATH=../DJV-install-Debug
$ cmake --build .

Try running the confidence tests to make sure everything is working OK:

$ cmake --build . --target test

Run the djv player application:

$ ./build/bin/djv

Packaging DJV

Update the version number "docs/download.html" and "docs/djv_install.html".

Build the static web site:

$ cd docs
$ bundle exec jekyll serve

Tag the git repository with the new version:

git tag -a 2.0.0 -m "Version 2.0.0"
git push origin 2.0.0

Create a release build:

$ cd $BUILD_DIR
$ export PATH=$PWD/DJV-install-Release/bin:$PATH
$ export LD_LIBRARY_PATH=$PWD/DJV-install-Release/lib:$LD_LIBRARY_PATH
$ mkdir DJV-third-party-Release
$ cd DJV-third-party-Release
$ cmake ../DJV/third-party -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../DJV-install-Release
$ cmake --build .
$ cmake --build . --target install
$ cd ..
$ mkdir DJV-Release
$ cd DJV-Release
$ cmake ../DJV -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../DJV-install-Release -DCMAKE_PREFIX_PATH=../DJV-install-Release
$ cmake --build .

Create an RPM package:

$ cmake ../DJV -DCPACK_GENERATOR=RPM -DCPACK_PACKAGING_INSTALL_PREFIX=/usr/local/DJV2 -DDJV_THIRD_PARTY=TRUE
$ cmake --build .
$ cmake --build . --target package

Create a Debian package:

$ cmake ../DJV -DCPACK_GENERATOR=DEB -DCPACK_PACKAGING_INSTALL_PREFIX=/usr/local/DJV2 -DDJV_THIRD_PARTY=TRUE
$ cmake --build .
$ cmake --build . --target package

Create a TGZ package:

$ cmake ../DJV -DCPACK_GENERATOR=TGZ -DCPACK_PACKAGING_INSTALL_PREFIX= -DDJV_THIRD_PARTY=TRUE
$ cmake --build .
$ cmake --build . --target package

Bump the version number in "CMakeLists.txt", "Doxyfile", and "sonar-project.properties".