181 cd ~ 182 wget https://raw.githubusercontent.com/Beep6581/RawTherapee/dev/tools/build-rawtherapee -O build-rawtherapee 183 chmod +x build-rawtherapee 184 ./build-rawtherapee 185 sudo gedit/ etc/ default/ grub 186 wget https://raw.githubusercontent.com/Beep6581/RawTherapee/dev/tools/build-rawtherapee -O build-rawtherapee 187 #!/usr/bin/env bash 188 # By Morgan Hardwood 189 # Version 2018-01-06 190 # This script gets the latest source code for the given program and compiles it. 191 # The name of the program, used for the folder names: 192 prog="rawtherapee" 193 # The name of the compiled executable: 194 exe="${prog}" 195 # The name of the sub-folder, if any, relative to the folder into which the 196 # compiled executable is placed. 197 # e.g. If the executable ends up in: 198 # ~/programs/someProgram/foo/bar/someExecutable 199 # then set it to: 200 # exeRelativePath="foo/bar" 201 # or if the executable ends up in 202 # ~/programs/someProgram/someExecutable 203 # then leave it empty: 204 # exeRelativePath="" 205 exeRelativePath="" 206 # The path to the repository: 207 repo="https://github.com/Beep6581/RawTherapee.git" 208 # No touching below this line, with the exception of the "Compile" section 209 # ----------------------------------------------------------------------------- 210 # The name of the project's standard branch, typically "master": 211 master="dev" 212 buildOnly="false" 213 buildType="release" 214 # Removes the trailing forward-slash if one is present 215 exeRelativePath="${exeRelativePath/%\/}" 216 # Append forward-slash to exeRelativePath only if it is not empty. 217 exePath="${exeRelativePath:+${exeRelativePath}/}${exe}" 218 # Command-line arguments 219 OPTIND=1 220 while getopts "bdh?-" opt; do case "${opt}" in b) buildOnly="true"; ;; d) buildType="debug"; ;; h|\?|-) printf '%s\n' "This script gets the latest source code for ${prog} and compiles it." "" " -b" " Optional. If specified, the script only compiles the source, it does not try to update the source. If not specified, the source will be updated first." " -d" " Optional. Compile a \"debug\" build. If not specified, a \"release\" build will be made." ""; exit 0; ;; esac; done 221 shift $((OPTIND-1)) 222 [ "$1" = "--" ] && shift 223 printf '%s\n' "" "Program name: ${prog}" "Build type: ${buildType}" "Build without updating: ${buildOnly}" "" 224 # Clone if needed 225 cloned="false" 226 updates="false" 227 if [[ ! -d "$HOME/programs/code-${prog}" ]]; then mkdir -p "$HOME/programs" || exit 1; git clone "$repo" "$HOME/programs/code-${prog}" || exit 1; pushd "$HOME/programs/code-${prog}" 1>/dev/null || exit 1; cloned="true"; else pushd "$HOME/programs/code-${prog}" 1>/dev/null || exit 1; git fetch; if [[ $(git rev-parse HEAD) != $(git rev-parse '@{u}') ]]; then updates="true"; fi; fi 228 # Pull updates if necessary 229 if [[ "$updates" = "true" && "$buildOnly" = "false" ]]; then git pull || exit 1; fi 230 # Find out which branch git is on 231 branch="$(git rev-parse --abbrev-ref HEAD)" 232 # Set build and install folder names 233 if [[ $branch = $master && $buildType = release ]]; then buildDir="$HOME/programs/code-${prog}/build"; installDir="$HOME/programs/${prog}"; else buildDir="$HOME/programs/code-${prog}/build-${branch}-${buildType}"; installDir="$HOME/programs/${prog}-${branch}-${buildType}"; fi 234 existsExe="false" 235 if [[ -e "${installDir}/${exePath}" ]]; then existsExe="true"; fi 236 # Quit if no updates and build-only flag not set 237 if [[ "$cloned" = "false" && "$buildOnly" = "false" && "$updates" = "false" && "$existsExe" = "true" ]]; then printf '%s\n' "No updates, nothing to do."; exit 0; fi 238 history