[Bf-blender-cvs] [05fe9a4] master: Make libyaml-cpp-dev not-breaking case for deb-like distros, and colors for messages!
Bastien Montagne
noreply at git.blender.org
Sat Dec 14 15:51:31 CET 2013
Commit: 05fe9a435af75239439c853906425b54eea42fb5
Author: Bastien Montagne
Date: Sat Dec 14 15:50:13 2013 +0100
http://developer.blender.org/rB05fe9a435af75239439c853906425b54eea42fb5
Make libyaml-cpp-dev not-breaking case for deb-like distros, and colors for messages!
===================================================================
M build_files/build_environment/install_deps.sh
===================================================================
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh
index cf6958d..f5f88db 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -277,6 +277,22 @@ export LANG
##### Generic Helpers #####
+BLACK=$(tput setaf 0)
+RED=$(tput setaf 1)
+GREEN=$(tput setaf 2)
+YELLOW=$(tput setaf 3)
+LIME_YELLOW=$(tput setaf 190)
+POWDER_BLUE=$(tput setaf 153)
+BLUE=$(tput setaf 4)
+MAGENTA=$(tput setaf 5)
+CYAN=$(tput setaf 6)
+WHITE=$(tput setaf 7)
+BRIGHT=$(tput bold)
+NORMAL=$(tput sgr0)
+BLINK=$(tput blink)
+REVERSE=$(tput smso)
+UNDERLINE=$(tput smul)
+
_echo() {
if [ "X$1" = "X-n" ]; then
shift; printf "%s" "$@"
@@ -286,10 +302,18 @@ _echo() {
}
ERROR() {
- _echo "$@"
+ _echo "${BRIGHT}${RED}ERROR! ${NORMAL}${RED}$@${NORMAL}"
+}
+
+WARNING() {
+ _echo "${BRIGHT}${YELLOW}WARNING! ${NORMAL}${YELLOW}$@${NORMAL}"
}
INFO() {
+ _echo "${GREEN}$@${NORMAL}"
+}
+
+PRINT() {
_echo "$@"
}
@@ -312,13 +336,13 @@ while true; do
THREADS="$2"; shift; shift; continue
;;
-h|--help)
- INFO ""
- INFO "USAGE:"
- INFO ""
- INFO "`eval _echo "$COMMON_INFO"`"
- INFO ""
- INFO "`eval _echo "$ARGUMENTS_INFO"`"
- INFO ""
+ PRINT ""
+ PRINT "USAGE:"
+ PRINT ""
+ PRINT "`eval _echo "$COMMON_INFO"`"
+ PRINT ""
+ PRINT "`eval _echo "$ARGUMENTS_INFO"`"
+ PRINT ""
exit 0
;;
--with-all)
@@ -416,11 +440,11 @@ while true; do
break
;;
*)
- INFO ""
- INFO "Wrong parameter! Usage:"
- INFO ""
- INFO "`eval _echo "$COMMON_INFO"`"
- INFO ""
+ PRINT ""
+ ERROR "Wrong parameter! Usage:"
+ PRINT ""
+ PRINT "`eval _echo "$COMMON_INFO"`"
+ PRINT ""
exit 1
;;
esac
@@ -563,11 +587,11 @@ _create_inst_shortcut() {
run_ldconfig() {
_lib_path="$INST/$1/lib"
_ldconf_path="/etc/ld.so.conf.d/$1.conf"
- INFO ""
+ PRINT ""
INFO "Running ldconfig for $1..."
sudo sh -c "echo \"$_lib_path\" > $_ldconf_path"
sudo /sbin/ldconfig # XXX OpenSuse does not include sbin in command path with sudo!!!
- INFO ""
+ PRINT ""
}
#### Build Python ####
@@ -972,6 +996,7 @@ compile_OPENEXR() {
_openexr_inst=$INST/openexr-$OPENEXR_VERSION
compile_ILMBASE
+ PRINT ""
_ilmbase_inst=$_inst_shortcut
_init_openexr
@@ -1392,7 +1417,6 @@ compile_OSL() {
cmake_d="$cmake_d -D OPENIMAGEIOHOME=$INST/oiio"
fi
- INFO "$LLVM_VERSION_FOUND"
if [ ! -z $LLVM_VERSION_FOUND ]; then
cmake_d="$cmake_d -D LLVM_VERSION=$LLVM_VERSION_FOUND"
if [ -d $INST/llvm ]; then
@@ -1659,36 +1683,36 @@ install_packages_DEB() {
}
install_DEB() {
- INFO ""
+ PRINT ""
INFO "Installing dependencies for DEB-based distribution"
- INFO ""
- INFO "`eval _echo "$COMMON_INFO"`"
- INFO ""
+ PRINT ""
+ PRINT "`eval _echo "$COMMON_INFO"`"
+ PRINT ""
read -p "Do you want to continue (Y/n)?"
[ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" != "y" ] && exit
if [ ! -z "`cat /etc/debian_version | grep ^6`" ]; then
if [ -z "`cat /etc/apt/sources.list | grep backports.debian.org`" ]; then
- INFO "Looks like you're using Debian Squeeze which does have broken CMake"
- INFO "It is highly recommended to install cmake from backports, otherwise"
- INFO "compilation of some libraries could fail"
- INFO ""
- INFO "You could install newer CMake from debian-backports repository"
- INFO "Add this this line to your /etc/apt/sources.lixt:"
- INFO ""
- INFO "deb http://backports.debian.org/debian-backports squeeze-backports main"
- INFO ""
- INFO "and then run:"
- INFO ""
- INFO "sudo apt-get update && sudo apt-get install cmake=2.8.7-4~bpo60+1 sudo apt-get install cmake=2.8.7-4~bpo60+1"
- INFO ""
- INFO "(you could also add this reporisotry using GUI like synaptic)"
- INFO ""
- INFO "Hit Enter to continue running the script, or hit Ctrl-C to abort the script"
+ WARNING "Looks like you're using Debian Squeeze which does have broken CMake"
+ PRINT "It is highly recommended to install cmake from backports, otherwise"
+ PRINT "compilation of some libraries could fail"
+ PRINT ""
+ PRINT "You could install newer CMake from debian-backports repository"
+ PRINT "Add this this line to your /etc/apt/sources.lixt:"
+ PRINT ""
+ PRINT "deb http://backports.debian.org/debian-backports squeeze-backports main"
+ PRINT ""
+ PRINT "and then run:"
+ PRINT ""
+ PRINT "sudo apt-get update && sudo apt-get install cmake=2.8.7-4~bpo60+1 sudo apt-get install cmake=2.8.7-4~bpo60+1"
+ PRINT ""
+ PRINT "(you could also add this reporisotry using GUI like synaptic)"
+ PRINT ""
+ PRINT "Hit Enter to continue running the script, or hit Ctrl-C to abort the script"
read
- INFO ""
+ PRINT ""
fi
fi
@@ -1704,13 +1728,24 @@ install_DEB() {
libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev \
libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
- libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libyaml-cpp-dev libtinyxml-dev"
+ libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev"
OPENJPEG_USE=true
VORBIS_USE=true
OGG_USE=true
THEORA_USE=true
+ # Some not-so-old distro (ubuntu 12.4) do not have it, do not fail in this case, just warn.
+ YAMLCPP_DEV="libyaml-cpp-dev"
+ check_package_DEB $YAMLCPP_DEV
+ if [ $? -eq 0 ]; then
+ _packages="$_packages $YAMLCPP_DEV"
+ else
+ PRINT ""
+ WARNING "libyaml-cpp-dev not found, you may have to install it by hand to get Blender compiling..."
+ PRINT ""
+ fi
+
# Install newest libtiff-dev in debian/ubuntu.
TIFF="libtiff"
check_package_DEB $TIFF
@@ -1733,13 +1768,11 @@ install_DEB() {
GIT="git"
check_package_DEB $GIT
if [ $? -eq 0 ]; then
- INFO $GIT
_packages="$_packages $GIT"
else
GIT="git-core" # Some old distro, like e.g. ubuntu 10.04 :/
check_package_DEB $GIT
if [ $? -eq 0 ]; then
- INFO $GIT
_packages="$_packages $GIT"
fi
fi
@@ -1748,10 +1781,10 @@ install_DEB() {
_packages="$_packages libspnav-dev libjack-dev"
fi
- INFO ""
+ PRINT ""
install_packages_DEB $_packages
- INFO ""
+ PRINT ""
X264_DEV="libx264-dev"
check_package_version_ge_DEB $X264_DEV $X264_VERSION_MIN
if [ $? -eq 0 ]; then
@@ -1760,7 +1793,7 @@ install_DEB() {
fi
if $WITH_ALL; then
- INFO ""
+ PRINT ""
# Grmpf, debian is libxvidcore-dev and ubuntu libxvidcore4-dev!
# Note: not since ubuntu 10.04
XVID_DEV="libxvidcore-dev"
@@ -1777,7 +1810,7 @@ install_DEB() {
fi
fi
- INFO ""
+ PRINT ""
MP3LAME_DEV="libmp3lame-dev"
check_package_DEB $MP3LAME_DEV
if [ $? -eq 0 ]; then
@@ -1785,7 +1818,7 @@ install_DEB() {
MP3LAME_USE=true
fi
- INFO ""
+ PRINT ""
VPX_DEV="libvpx-dev"
check_package_version_ge_DEB $VPX_DEV $VPX_VERSION_MIN
if [ $? -eq 0 ]; then
@@ -1794,28 +1827,28 @@ install_DEB() {
fi
fi
- INFO ""
+ PRINT ""
if $PYTHON_SKIP; then
- INFO "WARNING! Skipping Python installation, as requested..."
+ WARNING "Skipping Python installation, as requested..."
else
_do_compile=false
check_package_DEB python$PYTHON_VERSION_MIN-dev
if [ $? -eq 0 ]; then
install_packages_DEB python$PYTHON_VERSION_MIN-dev
- INFO ""
+ PRINT ""
if $NUMPY_SKIP; then
- INFO "WARNING! Skipping NumPy installation, as requested..."
+ WARNING "Skipping NumPy installation, as requested..."
else
check_package_DEB python$PYTHON_VERSION_MIN-numpy
if [ $? -eq 0 ]; then
install_packages_DEB python$PYTHON_VERSION_MIN-numpy
elif $NUMPY_REQUIRED; then
- INFO "WARNING! Valid python package but no valid numpy package!"
- INFO " Building both Python and Numpy from sources!"
+ WANING "Valid python package but no valid numpy package!" \
+ " Building both Python and Numpy from sources!"
_do_compile=true
else
- INFO "WARNING! Sorry, using python package but no valid numpy package available!"
- INFO " Use --required-numpy to force building of both Python and numpy."
+ WARNING "Sorry, using python package but no valid numpy package available!" \
+ " Use --required-numpy to force building of both Python and numpy."
fi
fi
else
@@ -1824,9 +1857,9 @@ install_DEB() {
if $_do_compile; then
compile_Python
- INFO ""
+ PRINT ""
if $NUMPY_SKIP; then
- INFO "WARNING! Skipping NumPy installation, as requested..."
+ WARNING "Skipping NumPy installation, as requested..."
else
compile_Numpy
fi
@@ -1835,9 +1868,9 @@ install_DEB() {
fi
fi
- INFO ""
+ PRINT ""
if $BOOST_SKIP; then
- INFO "WARNING! Skipping Boost installation, as requested..."
+ WARNING "Skipping Boost installation, as requested..."
else
check_package_version_ge_DEB libboost-dev $BOOST_VERSION_MIN
if [ $? -eq 0 ]; then
@@ -1859,9 +1892,9 @@ install_DEB() {
fi
fi
- INFO ""
+ PRINT ""
if $OCIO_SKIP; then
- INFO "WARNING! Skipping OpenColorIO installation, as requested..."
+ WARNING "Skipping OpenColorIO installation, as requested..."
else
check_package_version_ge_DEB libopencolorio-dev $OCIO_VERSION_MIN
if [ $? -eq 0 ]; then
@@ -1872,9 +1905,9 @@ install_DEB() {
fi
fi
- INFO ""
+ PRINT ""
if $OPENEXR_SKIP; then
- INFO "WARNING! Skipping OpenEXR installation, as requested..."
+ WARNING "Skipping OpenEXR installation, as requested..."
else
check_package_version_ge_DEB libopenexr-dev $OPENEXR_VERSION_MIN
if [ $? -eq 0 ]; then
@@ -1887,9 +1920,9 @@ install_DEB() {
fi
fi
- INFO ""
+ PRINT
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list