Updated buildRT, mainly improvement of "./buildRT -b" mode
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Written by DrSlony
|
# Written by DrSlony
|
||||||
# Version 2.6, 2012-12-13
|
# Version 2.7, 2012-12-31
|
||||||
# Please report bugs or enhancements to http://code.google.com/p/rawtherapee/issues/list
|
# Please report bugs or enhancements to http://code.google.com/p/rawtherapee/issues/list
|
||||||
# www.rawtherapee.com
|
# www.rawtherapee.com
|
||||||
# www.londonlight.org
|
# www.londonlight.org
|
||||||
@@ -64,10 +64,10 @@ compile () {
|
|||||||
[[ -d "${repo}/${buildType}" ]] && { printf "%s\n" "Found old build directory \"${repo}/$buildType\". Removing it."; rm -rf "${repo}/${buildType}"; }
|
[[ -d "${repo}/${buildType}" ]] && { printf "%s\n" "Found old build directory \"${repo}/$buildType\". Removing it."; rm -rf "${repo}/${buildType}"; }
|
||||||
[[ -d "${repo}/rawtherapee" ]] && { printf "%s\n" "Found old build directory \"${repo}/rawtherapee\". Removing it."; rm -rf "${repo}/rawtherapee"; }
|
[[ -d "${repo}/rawtherapee" ]] && { printf "%s\n" "Found old build directory \"${repo}/rawtherapee\". Removing it."; rm -rf "${repo}/rawtherapee"; }
|
||||||
[[ -d "${repo}/build" ]] && { printf "%s\n" "Found old build directory \"${repo}/build\". Removing it."; rm -rf "${repo}/build"; }
|
[[ -d "${repo}/build" ]] && { printf "%s\n" "Found old build directory \"${repo}/build\". Removing it."; rm -rf "${repo}/build"; }
|
||||||
[[ -d "${HOME}/rt_${branch}_${buildType}" ]] && {
|
[[ -d "${HOME}/rt_${branch}_${buildType}${movetoPatched}" ]] && {
|
||||||
printf "%s\n" "Found old build directory ${HOME}/rt_${branch}_${buildType}" "It must be removed to proceed."
|
printf "%s\n" "Found old build directory ${HOME}/rt_${branch}_${buildType}${movetoPatched}" "It must be removed to proceed."
|
||||||
read -p "Do you want to remove it and proceed? y/n: " YN
|
read -p "Do you want to remove it and proceed? y/n: " YN
|
||||||
[[ "$YN" = y ]] && rm -rf "${HOME}/rt_${branch}_${buildType}" || exit 1
|
[[ "$YN" = y ]] && rm -rf "${HOME}/rt_${branch}_${buildType}${movetoPatched}" || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Clean up old CMake junk
|
# Clean up old CMake junk
|
||||||
@@ -140,12 +140,12 @@ compile () {
|
|||||||
zip -Xrq "/tmp/RawTherapee_${branch}_${distribution}_${bits}_${verLatesttag}.${verLatesttagdistance}_${buildType}.zip" AboutThisBuild.txt rawtherapee
|
zip -Xrq "/tmp/RawTherapee_${branch}_${distribution}_${bits}_${verLatesttag}.${verLatesttagdistance}_${buildType}.zip" AboutThisBuild.txt rawtherapee
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Now that the zip is ready, the build can be moved to ~/rt_<branch>_<buildType>
|
# Now that the zip is ready, the build can be moved to ~/rt_<branch>_<buildType><_patched>
|
||||||
printf "%s\n" "" "Moving \"${repo}/build/rawtherapee\" to \"${HOME}/rt_${branch}_${buildType}\""
|
printf "%s\n" "" "Moving \"${repo}/build/rawtherapee\" to \"${HOME}/rt_${branch}_${buildType}${movetoPatched}\""
|
||||||
mv "${repo}/build/rawtherapee" "${HOME}/rt_${branch}_${buildType}" || { printf "%s\n" "" "Could not move \"${repo}/build/rawtherapee\" to \"${HOME}/rt_${branch}_${buildType}\", exiting."; exit 1; }
|
mv "${repo}/build/rawtherapee" "${HOME}/rt_${branch}_${buildType}${movetoPatched}" || { printf "%s\n" "" "Could not move \"${repo}/build/rawtherapee\" to \"${HOME}/rt_${branch}_${buildType}${movetoPatched}\", exiting."; exit 1; }
|
||||||
|
|
||||||
printf "%-15b %b\n" "" "" "Build ready:" "" "\tChoice number:" "$choiceNumber" "\tBranch:" "$branch" "\tBuild type:" "$buildType" "\tTarget:" "$procTarget"
|
printf "%-15b %b\n" "" "" "Build ready:" "" "\tChoice number:" "$choiceNumber" "\tBranch:" "$branch" "\tBuild type:" "$buildType" "\tTarget:" "$procTarget"
|
||||||
printf "%s\n" "" "To run RawTherapee, fire up a terminal and type:" "~/rt_${branch}_${buildType}/rawtherapee" "" "------------------------------------------"
|
printf "%s\n" "" "To run RawTherapee, fire up a terminal and type:" "~/rt_${branch}_${buildType}${movetoPatched}/rawtherapee" "" "------------------------------------------"
|
||||||
alert "RawTherapee-${verLatesttag}.${verLatesttagdistance} ready.\nChoice number ${choiceNumber}, branch: ${branch}, type: ${buildType}, target: ${procTarget}"
|
alert "RawTherapee-${verLatesttag}.${verLatesttagdistance} ready.\nChoice number ${choiceNumber}, branch: ${branch}, type: ${buildType}, target: ${procTarget}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -197,7 +197,7 @@ checkDistro () {
|
|||||||
# distribution=${distro} because if none of the elements match, distro will =YellowDog (last item in the list)
|
# distribution=${distro} because if none of the elements match, distro will =YellowDog (last item in the list)
|
||||||
# add "break 2;" to the end if we really want to, but Ubuntu gets detected as Debian first, then as Ubuntu,
|
# add "break 2;" to the end if we really want to, but Ubuntu gets detected as Debian first, then as Ubuntu,
|
||||||
# so we might want to not break the loop.
|
# so we might want to not break the loop.
|
||||||
[[ -e "$loc" ]] && { distribution=${distro}; echo "Distribution detected as ${distribution}"; }
|
[[ -e "$loc" ]] && { distribution=${distro}; echo "Distribution: ${distribution}"; }
|
||||||
[[ "$distro" = Gentoo ]] && break 2
|
[[ "$distro" = Gentoo ]] && break 2
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
@@ -210,7 +210,7 @@ checkDistro () {
|
|||||||
#sanitize
|
#sanitize
|
||||||
distribution=${distribution//[^a-zA-Z0-9]/}
|
distribution=${distribution//[^a-zA-Z0-9]/}
|
||||||
|
|
||||||
echo "Distribution entered manually: ${distribution}"
|
echo "Distribution: ${distribution}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,11 +219,10 @@ checkBits () {
|
|||||||
if [[ $bits = *64* ]]
|
if [[ $bits = *64* ]]
|
||||||
then
|
then
|
||||||
bits=64
|
bits=64
|
||||||
echo "Bits detected as ${bits}"
|
|
||||||
else
|
else
|
||||||
bits=32
|
bits=32
|
||||||
echo "Bits detected as ${bits}"
|
|
||||||
fi
|
fi
|
||||||
|
echo "System: ${bits}-bit"
|
||||||
|
|
||||||
[[ $bits != 32 ]] && [[ $bits != 64 ]] && checkBits
|
[[ $bits != 32 ]] && [[ $bits != 64 ]] && checkBits
|
||||||
}
|
}
|
||||||
@@ -232,10 +231,10 @@ setVars () {
|
|||||||
unset choiceNumber choiceNumbers buildType buildTypes list branch branches repo
|
unset choiceNumber choiceNumbers buildType buildTypes list branch branches repo
|
||||||
checkDistro
|
checkDistro
|
||||||
checkBits
|
checkBits
|
||||||
repo="${HOME}/rawtherapee" && echo "Repository is set to ${repo}"
|
repo="${HOME}/rawtherapee" && echo "Repository: ${repo}"
|
||||||
cpuCount="`grep -c 'processor' /proc/cpuinfo`"
|
cpuCount="`grep -c 'processor' /proc/cpuinfo`"
|
||||||
if (( "$cpuCount" >= 1 && "$cpuCount" <= 16 )); then echo "CPU count detected as ${cpuCount}"; else cpuCount="1"; echo "CPU count set to ${cpuCount}"; fi
|
if (( "$cpuCount" >= 1 && "$cpuCount" <= 32 )); then echo "CPU count: ${cpuCount}"; else cpuCount="1"; echo "CPU count: ${cpuCount}"; fi
|
||||||
procTarget="2" && echo "procTarget set to ${procTarget}"
|
procTarget="2" && echo "procTarget: ${procTarget}"
|
||||||
|
|
||||||
if hash notify-send 2>/dev/null; then alert_type="notify-send"
|
if hash notify-send 2>/dev/null; then alert_type="notify-send"
|
||||||
elif hash kdialog 2>/dev/null; then alert_type="kdialog"
|
elif hash kdialog 2>/dev/null; then alert_type="kdialog"
|
||||||
@@ -266,10 +265,12 @@ finishUp () {
|
|||||||
|
|
||||||
# PROGRAM START
|
# PROGRAM START
|
||||||
printf "%s\n\n" "Running the RawTherapee build script."
|
printf "%s\n\n" "Running the RawTherapee build script."
|
||||||
|
movetoPatched=""
|
||||||
|
|
||||||
while getopts "bh?-nh" opt; do
|
while getopts "bh?-nh" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
b) patched="b"
|
b) patched="b"
|
||||||
|
movetoPatched="_patched"
|
||||||
printf "%s\n" "Buildonly flag detected, will not hg pull or update";;
|
printf "%s\n" "Buildonly flag detected, will not hg pull or update";;
|
||||||
n) noomp="-DOPTION_OMP=OFF"
|
n) noomp="-DOPTION_OMP=OFF"
|
||||||
printf "%s\n" "OpenMP disabled";;
|
printf "%s\n" "OpenMP disabled";;
|
||||||
|
Reference in New Issue
Block a user