Minor improvements to kicad-install.sh.

* Exit script when package install, build configuration, or build fails.
* Install each dependency package one at a time.
This commit is contained in:
Joseph Chen 2014-10-20 10:33:53 -04:00 committed by Wayne Stambaugh
parent 08bfaa416d
commit ad5ca60401
1 changed files with 44 additions and 30 deletions

View File

@ -89,41 +89,55 @@ install_prerequisites()
# assume all these Debian, Mint, Ubuntu systems have same prerequisites # assume all these Debian, Mint, Ubuntu systems have same prerequisites
if [ "$(expr match "$PM" '.*\(apt-get\)')" == "apt-get" ]; then if [ "$(expr match "$PM" '.*\(apt-get\)')" == "apt-get" ]; then
#echo "debian compatible system" #echo "debian compatible system"
sudo apt-get install \ prerequisite_list="
bzr \ bzr
bzrtools \ bzrtools
build-essential \ build-essential
cmake \ cmake
cmake-curses-gui \ cmake-curses-gui
debhelper \ debhelper
doxygen \ doxygen
grep \ grep
libbz2-dev \ libbz2-dev
libcairo2-dev \ libcairo2-dev
libglew-dev \ libglew-dev
libssl-dev \ libssl-dev
libwxgtk3.0-dev \ libwxgtk3.0-dev
python-wxgtk3.0 python-wxgtk3.0
"
for p in ${prerequisite_list}
do
sudo apt-get install $p || exit 1
done
# assume all yum systems have same prerequisites # assume all yum systems have same prerequisites
elif [ "$(expr match "$PM" '.*\(yum\)')" == "yum" ]; then elif [ "$(expr match "$PM" '.*\(yum\)')" == "yum" ]; then
#echo "red hat compatible system" #echo "red hat compatible system"
# Note: if you find this list not to be accurate, please submit a patch: # Note: if you find this list not to be accurate, please submit a patch:
sudo yum groupinstall "Development Tools" sudo yum groupinstall "Development Tools" || exit 1
sudo yum install \
bzr \ prerequisite_list="
bzrtools \ install
bzip2-libs \ bzr
bzip2-devel \ bzrtools
cmake \ bzip2-libs
cmake-gui \ bzip2-devel
doxygen \ cmake
cairo-devel \ cmake-gui
glew-devel \ doxygen
grep \ cairo-devel
openssl-devel \ glew-devel
wxGTK-devel \ grep
openssl-devel
wxGTK-devel
wxPython wxPython
"
for p in ${prerequisite_list}
do
sudo yum install $p || exit 1
done
else else
echo echo
echo "Incompatible System. Neither 'yum' nor 'apt-get' found. Not possible to continue." echo "Incompatible System. Neither 'yum' nor 'apt-get' found. Not possible to continue."
@ -255,14 +269,14 @@ install_or_update()
cd kicad.bzr cd kicad.bzr
if [ ! -d "build" ]; then if [ ! -d "build" ]; then
mkdir build && cd build mkdir build && cd build
cmake $OPTS ../ cmake $OPTS ../ || exit 1
else else
cd build cd build
# Although a "make clean" is sometimes needed, more often than not it slows down the update # Although a "make clean" is sometimes needed, more often than not it slows down the update
# more than it is worth. Do it manually if you need to in this directory. # more than it is worth. Do it manually if you need to in this directory.
# make clean # make clean
fi fi
make -j4 make -j4 || exit 1
echo " kicad compiled." echo " kicad compiled."