Skip to content

Commit

Permalink
DT 3.8.1 on Ubuntu 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
per2jensen committed May 2, 2022
1 parent 2edc9d9 commit a54721e
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 50 deletions.
5 changes: 3 additions & 2 deletions 22.04/DT38_compile.sh → 22.04/DT381_compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
## Licensed under the Apache License 2.0
##

source envvars

# Change this if you want to run the compile script directly on your machine
# Release to use
export RELEASE=release-3.8.1
Expand All @@ -18,6 +20,5 @@ export DT_SRC_FOLDER="$HOME/git/darktable"
# the code name for Ubuntu used in LLVM's repos
export CODENAME_LLVM="jammy"

# FIXME don't hardcode here
./_compileDT38.sh
"./$_COMPILE"

68 changes: 38 additions & 30 deletions 22.04/_compileDT38.sh → 22.04/_compileDT381.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
LOG="$HOME/DT38.log"
#! /bin/bash

source envvars

#########################
# don't change below
Expand Down Expand Up @@ -59,49 +61,55 @@ then
echo "4: Package installation failed, exiting" && exit
fi

# see here: https://github.blog/2022-04-12-git-security-vulnerability-announced/
# if installing outside $HOME, prefix next line with sudo
git config --global --add safe.directory "${DT_SRC_FOLDER}"

# libexiv2 v 0.27.5: https://build.opensuse.org/package/show/graphics:darktable:master/exiv2-non-suse


# get the source ready
if [[ -d $DT_SRC_FOLDER ]]; then
echo "darktable dir exists"
cd $DT_SRC_FOLDER
git pull --rebase
RESULT=$?
if [[ $RESULT != "0" ]]; then
echo \"git pull --rebase\" failed, exiting
exit 1
fi
else
git clone https://github.com/darktable-org/darktable.git $DT_SRC_FOLDER
RESULT=$?
if [[ $RESULT != "0" ]]; then
echo \"git clone\" failed, exiting
exit 1
fi
cd $DT_SRC_FOLDER
if [[ -d "$DT_SRC_FOLDER" ]]; then
rm -fr "${DT_SRC_FOLDER}"
fi
git checkout ${RELEASE} |tee -a $LOG
git submodule init |tee -a $LOG
git submodule update |tee -a $LOG

git clone https://github.com/darktable-org/darktable.git "$DT_SRC_FOLDER" 2>&1|tee -a "$LOG"
if [[ "${PIPESTATUS[0]}" != "0" ]]; then
echo \"git clone\" failed, exiting
exit 1
fi

cd "$DT_SRC_FOLDER"
git checkout "${RELEASE}" 2>&1|tee -a "$LOG"
if [[ "${PIPESTATUS[0]}" != "0" ]]; then
echo \"git checkout\" failed, exiting
exit 1
fi

git submodule init 2>&1|tee -a "$LOG"
if [[ "${PIPESTATUS[0]}" != "0" ]]; then
echo \"git submodule init\" failed, exiting
exit 1
fi

git submodule update 2>&1|tee -a "$LOG"
if [[ "${PIPESTATUS[0]}" != "0" ]]; then
echo \"git sumodule update\" failed, exiting
exit 1
fi

# build darktable
mv ${INSTALL_PREFIX} ${INSTALL_PREFIX}-org
./build.sh --prefix ${INSTALL_PREFIX} |tee -a $LOG
mv "${INSTALL_PREFIX}" "${INSTALL_PREFIX}"-org
./build.sh --prefix "${INSTALL_PREFIX}" 2>&1|tee -a "$LOG"
if [ "${PIPESTATUS[0]}" != "0" ]
then
echo "Build failed, exiting" && exit
fi


#install darktable
sudo cmake --build "$DT_SRC_FOLDER/build" --target install -- -j1 |tee -a $LOG
# if installing outside $HOME, prefix next line with sudo
cmake --build "$DT_SRC_FOLDER/build" --target install -- -j1 2>&1 |tee -a "$LOG"
if [ "${PIPESTATUS[0]}" != "0" ]
then
echo "Installation failed, exiting" && exit
fi

# print --version info
${INSTALL_PREFIX}/bin/darktable --version |tee -a $LOG
"${INSTALL_PREFIX}/bin/darktable" --version 2>&1|tee -a "$LOG"
10 changes: 10 additions & 0 deletions 22.04/envvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash

LOG="$HOME/DT38.log"

VM_NAME=ubuntu2204-DTcompile
VM_SIZE=15G
VM_IMAGE=22.04
DT_COMPILE_SCRIPT=DT381_compile.sh
_COMPILE=_compileDT381.sh

8 changes: 2 additions & 6 deletions 22.04/install_in_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
## Licensed under the Apache License 2.0
##

VM_NAME=ubuntu2204-DTcompile
VM_SIZE=15G
VM_IMAGE=22.04
DT_COMPILE_SCRIPT=DT38_compile.sh
_COMPILE=_compileDT38.sh
source envvars

# check if VM exists and is running
multipass list |grep -E ${VM_NAME}
Expand Down Expand Up @@ -38,7 +34,7 @@ else
fi

echo update OS and start compiling Darktable in virtual machine ${VM_NAME}
multipass transfer ${DT_COMPILE_SCRIPT} ${_COMPILE} ${VM_NAME}:
multipass transfer ${DT_COMPILE_SCRIPT} ${_COMPILE} envvars ${VM_NAME}:
multipass exec ${VM_NAME} -- chmod u+x ${DT_COMPILE_SCRIPT} ${_COMPILE}
# in VM: install dependencies, compile and install, then print DT's --version info
multipass exec ${VM_NAME} -- ./${DT_COMPILE_SCRIPT}
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ The compile script does the following:
* builds and install Darktable in the VM
* starts Darktable to print the --version info in the VM

The end result from running "darktable --version", is this: (on the latest DT version)
The end result from running "darktable --version", is this:
````
this is darktable unknown-version
this is darktable 3.8.1
copyright (c) 2009-2022 johannes hanika
[email protected]
Expand All @@ -62,17 +62,7 @@ compile options:
GraphicsMagick support enabled
ImageMagick support disabled
OpenEXR support enabled
````

*Note* darktable does not report is's version number, even though is has been build from the version 3.8.1
````
ubuntu@ubuntu2204-DTcompile:~/git/darktable$ git status
HEAD detached at release-3.8.1
nothing to commit, working tree clean
````



# How to compile Darktable 3.8.1 for Ubuntu 22.04 in a VM
git clone https://github.com/per2jensen/dt-on-ubuntu.git
Expand Down

0 comments on commit a54721e

Please sign in to comment.