Building DarkTable from source
You’ll probably need to install some development packages. These are the packages that are listed as dependencies for the 64 bit version of Ubuntu. I’m running Ubuntu 16.04 (Xenial). (If you’re running something else, google for "build darktable dependencies") On Ubuntu, you can then check in the Synaptic package manager, and install anything that you don’t already have.
See the list of dependencies
If you’re still missing something when you attempt to run the build, the process will complain and tell you what you need. After you’ve fixed it, you can just rerun.
Now download the Darktable source from https://github.com/darktable-org/darktable/releases/. The tarball (darktable-x.x.x.tar.xz) is the recommended source for the latest stable release.
Extract the archive from the tarball. It wil create a directory named darktable-x.x.x containing all of the source. Change directory (cd <target_directory_path>) into that directory and run "./build.sh". It takes a while to run, but it worked for me with no problems.
After the build completes successfully, it prints the command you need to run to install the program. You need to log in as root (or use sudo or su) to run this part. The install puts the program in /opt/darktable.
Don’t get rid of the source at this point. The "tools" directory is in the download directory, not in the installed program directory.