From a54721e4dd7d4e6a276c5ee936633893e5962bc3 Mon Sep 17 00:00:00 2001 From: Per Jensen Date: Mon, 2 May 2022 20:00:48 +0200 Subject: [PATCH] DT 3.8.1 on Ubuntu 22.04 --- 22.04/{DT38_compile.sh => DT381_compile.sh} | 5 +- 22.04/{_compileDT38.sh => _compileDT381.sh} | 68 ++++++++++++--------- 22.04/envvars | 10 +++ 22.04/install_in_vm.sh | 8 +-- README.md | 14 +---- 5 files changed, 55 insertions(+), 50 deletions(-) rename 22.04/{DT38_compile.sh => DT381_compile.sh} (92%) rename 22.04/{_compileDT38.sh => _compileDT381.sh} (69%) mode change 100644 => 100755 create mode 100644 22.04/envvars diff --git a/22.04/DT38_compile.sh b/22.04/DT381_compile.sh similarity index 92% rename from 22.04/DT38_compile.sh rename to 22.04/DT381_compile.sh index bd610af..a13bec2 100755 --- a/22.04/DT38_compile.sh +++ b/22.04/DT381_compile.sh @@ -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 @@ -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" diff --git a/22.04/_compileDT38.sh b/22.04/_compileDT381.sh old mode 100644 new mode 100755 similarity index 69% rename from 22.04/_compileDT38.sh rename to 22.04/_compileDT381.sh index 97ec047..5cf00e4 --- a/22.04/_compileDT38.sh +++ b/22.04/_compileDT381.sh @@ -1,4 +1,6 @@ -LOG="$HOME/DT38.log" +#! /bin/bash + +source envvars ######################### # don't change below @@ -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" diff --git a/22.04/envvars b/22.04/envvars new file mode 100644 index 0000000..908266e --- /dev/null +++ b/22.04/envvars @@ -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 + diff --git a/22.04/install_in_vm.sh b/22.04/install_in_vm.sh index 101b80a..79e052e 100755 --- a/22.04/install_in_vm.sh +++ b/22.04/install_in_vm.sh @@ -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} @@ -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} diff --git a/README.md b/README.md index 80fd7ee..cdaca20 100644 --- a/README.md +++ b/README.md @@ -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 darktable-dev@lists.darktable.org @@ -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