Last active
June 19, 2021 11:34
-
-
Save peci1/222a6bdfa028aa043f9c509c78bf9bc4 to your computer and use it in GitHub Desktop.
A script for compiling Darktable on Windows using the Windows Subsystem for Linux ("bash for Windows") introduced in Win 10.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################### | |
# DO NOT REPORT ANY BUGS FROM DARKTABLE INSTALLED THIS WAY. | |
# | |
# This is an unofficial compilation & installation guide. | |
# Darktable developers explicitly say that they don't support Windows ANY way and won't fix ANY bugs on Windows. | |
# Please, respect their decision and do not bother them with Windows bugreports. | |
# | |
# If you find a bug, please verify it on a regular Linux/Mac system or inside a virtual machine. | |
# | |
# There is a chance an official Windows build will appear. Just subscribe to https://github.com/darktable-org/darktable/pull/1327 to be informed. | |
######################################### | |
# Script for building and running Darktable 2.2.1 on Windows Subsystem for Linux ("bash for Windows") | |
# If the subsystem is Ubuntu 14.04 (Trusty), keep following this guide. | |
# If you have the Ubuntu 16.04 subsystem, skip the following steps up to the point where it is said the guide applies to both subsystems. | |
# If you're not sure which subsystem you have, type "lsb_release -a" to the bash console. | |
# Add PPAs that update your Trusty system to a bit more modern one (beware, this may break your system!) | |
sudo add-apt-repository ppa:george-edison55/cmake-3.x | |
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo apt-add-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main" | |
sudo add-apt-repository ppa:gnome3-team/gnome3 | |
sudo add-apt-repository ppa:gnome3-team/gnome3-staging | |
sudo add-apt-repository ppa:philip5/extra | |
sudo add-apt-repository ppa:oded-geek/multimedia | |
# cherry-pick only the required packages from the added PPAs | |
echo "Package: * | |
Pin: release o=LP-PPA-gnome3-team | |
Pin-Priority: 400 | |
Package: *libgtk* | |
Pin: release o=LP-PPA-gnome3-team | |
Pin-Priority: 500 | |
Package: * | |
Pin: release o=LP-PPA-philip5-extra | |
Pin-Priority: 400 | |
Package: *exiv2* | |
Pin: release o=LP-PPA-philip5-extra | |
Pin-Priority: 500 | |
Package: * | |
Pin: release o=LP-PPA-oded-geek-multimedia | |
Pin-Priority: 400 | |
Package: *openjp2* | |
Pin: release o=LP-PPA-oded-geek-multimedia | |
Pin-Priority: 500" | sudo tee /etc/apt/preferences.d/darktable-2_2-pin-400 | |
# Install newer versions of software | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install cmake | |
sudo apt-get install llvm-3.9 | |
sudo apt-get install clang-3.9 | |
sudo apt-get install exiv2 | |
LIBOPENJP2=libopenjp27-dev | |
# After you git-clone the darktable repository (see below), open src/CMakeLists.txt and change lines | |
# find_package(GTK3 3.14 REQUIRED) | |
# add_definitions("-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_14") | |
# to | |
# find_package(GTK3 3.12 REQUIRED) | |
# add_definitions("-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_12") | |
############################################################################### | |
# From now on, the guide should apply to both Ubuntu 14.04 and 16.04 systems. # | |
############################################################################### | |
if [[ "$LIBOPENJP2" -eq "" ]]; then LIBOPENJP2=libopenjp2-7-dev; fi | |
# install required and optional dependencies | |
sudo apt-get install gcc g++ cmake intltool xsltproc libgtk-3-dev libxml2-utils libxml2-dev liblensfun-dev librsvg2-dev libsqlite3-dev libcurl4-gnutls-dev libjpeg-dev libtiff5-dev liblcms2-dev libjson-glib-dev libexiv2-dev libpugixml-dev python3-pkg-resources | |
sudo apt-get install libgphoto2-dev libsoup2.4-dev libopenexr-dev libwebp-dev libopenjpeg-dev libsecret-1-dev libgraphicsmagick1-dev libcolord-dev libcolord-gtk-dev libcups2-dev libsdl1.2-dev libsdl-image1.2-dev libgl1-mesa-dev python3-jsonschema $LIBOPENJP2 | |
# get Darktable | |
sudo apt-get install git | |
git clone --recursive https://github.com/darktable-org/darktable.git | |
cd darktable/ | |
# put any version number you'd like... but this guide is only verified to work with 2.2.x releases. | |
git checkout release-2.2.1 | |
# Build Darktable | |
./build.sh | |
# Install Darktable (change the absolute path to whatever your build.sh command suggests) | |
sudo cmake --build "/mnt/d/Programování/tmp/darktable/build" --target install -- -j8 | |
# Run Darktable; in order for this command to succeed, you first need to run Xming in Windows | |
DISPLAY=:0 LIBGL_ALWAYS_INDIRECT=1 /opt/darktable/bin/darktable |
If you install confilct for libcurl4-gnutls-dev
, it may be because you've already installed libcurl4-somethingelse-dev
, and they can't be installed simultaneousely. In such case, just go on wihtout this package, it should work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to just install (not compile) the current release version of Darktable, things get much easier (thanks to Stefan Hoffmeister for testing):
If your subsystem is Ubuntu 16.04, you'll get the newest release of Darktable. With Ubuntu 14.04 as subsystem, you'll get at most Darktable 2.0.x, which may suffice to you, but it doesn't get updated with new features any more. You can tell the version of your subsystem by calling
If you're on 14.04 and want the up-to-date Darktable, you may use https://github.com/RoliSoft/WSL-Distribution-Switcher to install the 16.04 subsystem (thanks to Jan Ingwer Baer for pointing me to this project). Or wait for March 2017, when it'll be made available for all Windows 10 users with the Anniversary update.