Skip to content

Commit

Permalink
attempt at verbosity, leto#13
Browse files Browse the repository at this point in the history
  • Loading branch information
djerius committed Nov 1, 2018
1 parent 22f2761 commit e0a5710
Showing 1 changed file with 107 additions and 29 deletions.
136 changes: 107 additions & 29 deletions _travis/before_install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash

get_gsl () (
set -u

die () {

set -euv
echo >&2 $@
exit 1
}

get_gsl () (

if [ "$1" = master ] ; then
get_gsl_master
Expand All @@ -13,53 +19,122 @@ get_gsl () (

get_gsl_version () (

set -euv

cd $GSL_SRC_DIR

# only download if necessary
if [ ! -e "gsl-$1.tar.gz" ]; then
wget -q ftp://ftp.gnu.org/gnu/gsl/gsl-$1.tar.gz
echo "Retrieving GSL $1"
wget -q ftp://ftp.gnu.org/gnu/gsl/gsl-$1.tar.gz \
|| die "Error retrieving GSL $1"
fi

if [ ! -e $GSL_INST_DIR/gsl-$1/bin/gsl-config ]; then

tar zxpf gsl-$1.tar.gz
echo "GSL $1 has not been built and installed"

echo
echo "Extracting..."
tar zxpf gsl-$1.tar.gz \
|| die "Error extracting"

cd gsl-$1
./configure --prefix $GSL_INST_DIR/gsl-$1
make -j2
make -j2 install

echo
echo "Configuring..."
./configure --prefix $GSL_INST_DIR/gsl-$1 \
|| die "Error Configuing"

echo
echo "Building..."
if ! make -j2 >& make.log ; then
cat make.log
die "Error Building"
fi

echo
echo "Installing..."
if ! make -j2 install >& install.log ; then
cat install.log
die "Error Installing"
fi
else
echo "GSL $1 already installed"
fi
)

get_gsl_master () (

set -euv

cd $GSL_SRC_DIR

rmdir "gsl-master" && echo "removed empty gsl-master directory"
if [ -d gsl-master -a ! -d gsl-master/.git ] ; then

echo
echo "Removing existing but incomplete gsl-master directory"
rm -rf gsl-master || die "Error removing gsl-master"
fi


if [ ! -d "gsl-master" ]; then
git clone git://git.savannah.gnu.org/gsl.git gsl-master
cd gsl-master

echo
echo "Cloning master from repo"
git clone git://git.savannah.gnu.org/gsl.git gsl-master \
|| die "Error cloning GSL master"

else
cd gsl-master
ls -la
[ -d ".git" ] && git pull origin master

echo
echo "Updating from repo"
git \
--git-dir=gsl-master/.git \
--work-tree=gsl-master \
pull origin master \
|| die "Error updating working dir"

fi

GSL_COMMIT=`git rev-parse master`
echo "Testing GSL master commit $GSL_COMMIT"

./autogen.sh
./configure --enable-maintainer-mode --prefix $GSL_INST_DIR/gsl-master
make -j2
make -j2 install
)
GSL_COMMIT=$(git --git-dir=gsl-master/.git rev-parse master)

if [ ! -e $GSL_INST_DIR/gsl-master/$GSL_COMMIT ]; then

echo
echo "GSL master $GSL_COMMIT has not been built and installed"

cd gsl-master || die "Where's $GSL_SRC_DIR/gsl-master"

echo
echo "Bootstrapping..."
./autogen.sh || die "error bootstrapping"

echo
echo "Configuring..."
./configure --enable-maintainer-mode --enable-silent-rules --prefix $GSL_INST_DIR/gsl-master \
|| die "error configuring"

echo
echo "Building..."
if ! make -j2 >& make.log ; then
cat make.log
die "Error Building"
fi

echo
echo "Installing..."
if ! make -j2 install >& install.log ; then
cat install.log
die "Error Installing"
fi

set -euvx
touch $GSL_INST_DIR/gsl-master/$GSL_COMMIT

else

echo
echo "GSL master $GSL_COMMIT already installed"

fi
)

: ${GSL_INST_DIR:?environment variable not specified}
: ${GSL_SRC_DIR:?environment variable not specified}
Expand All @@ -69,19 +144,22 @@ set -euvx
mkdir -p $GSL_SRC_DIR
mkdir -p $GSL_INST_DIR

ls -la $GSL_SRC_DIR
echo "Testing agains GSL $GSL; Building with GSL $GSL_CURRENT"
echo

get_gsl $GSL
get_gsl $GSL_CURRENT
if [ $GSL != $GSL_CURRENT ] ; then
get_gsl $GSL_CURRENT
fi

ls -la $GSL_INST_DIR
ls -la ${GSL_INST_DIR}/gsl-${GSL_CURRENT}/bin

if [ -n "$TRAVIS_BUILD_DIR" ] ; then

: ${DIST_DIR:?environment variable not specified}

# perform in subshell to avoid polluting this shell
(
set -v
cpanm -n PkgConfig
cd $TRAVIS_BUILD_DIR

Expand Down

0 comments on commit e0a5710

Please sign in to comment.