Beginning of guile support

This commit is contained in:
Bob Mottram 2017-08-23 17:30:13 +01:00
parent 36d73b2a6c
commit 3cdf3e45a5
1 changed files with 89 additions and 0 deletions

89
src/freedombone-utils-guile Executable file
View File

@ -0,0 +1,89 @@
#!/bin/bash
#
# .---. . .
# | | |
# |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
# | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
# ' ' --' --' -' - -' ' ' -' -' -' ' - --'
#
# Freedom in the Cloud
#
# Recent version of guile
#
# License
# =======
#
# Copyright (C) 2017 Bob Mottram <bob@freedombone.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
GUILE_VERSION='2.2.0'
GUILE_HASH='c707b9cf6f97ecca3a4e3e704e62b83f95f1aec28ed1535f5d0a1d36af07a015'
EIGHTSYNC_REPO="git://git.savannah.gnu.org/8sync.git"
EIGHTSYNC_COMMIT=''
function install_8sync {
apt-get -qy install flex libunistring-dev libgc-dev autoconf texinfo
if [ ! -d $INSTALL_DIR ]; then
mkdir $INSTALL_DIR
fi
cd $INSTALL_DIR
git_clone $EIGHTSYNC_REPO $INSTALL_DIR/eightsync
cd $INSTALL_DIR/eightsync
git checkout ${EIGHTSYNC_COMMIT} -b ${EIGHTSYNC_COMMIT}
GUILE_PATH=/opt/guile-${GUILE_VERSION}
PATH=${GUILE_PATH}/bin:$PATH
export GUILE_CFLAGS="-I${GUILE_PATH}/include"
export GUILE_LIBS="-L${GUILE_PATH}/lib"
./bootstrap.sh
configure
make
make install
}
function install_guile {
# Currently this only works for x86_64
read_config_param ARCHITECTURE
if [[ ${ARCHITECTURE} != "x86_64" ]]; then
return
fi
GUILE_ARCH='x86_64'
apt-get -qy install flex libunistring-dev libgc-dev autoconf texinfo lzip wget
if [ ! -d $INSTALL_DIR ]; then
mkdir $INSTALL_DIR
fi
cd $INSTALL_DIR
if [ ! -f guile-${GUILE_VERSION}-pack-${GUILE_ARCH}-linux-gnu.tar.lz ]; then
wget https://ftp.gnu.org/gnu/guile/guile-${GUILE_VERSION}-pack-${GUILE_ARCH}-linux-gnu.tar.lz
fi
if [ ! -f guile-${GUILE_VERSION}-pack-${GUILE_ARCH}-linux-gnu.tar.lz ]; then
echo 'Unable to download guile pack'
exit 6735238
fi
CURR_GUILE_HASH=$(sha256sum guile-${GUILE_VERSION}-pack-${GUILE_ARCH}-linux-gnu.tar.lz | awk -F ' ' '{print $1}')
if [[ "$CURR_GUILE_HASH" != "$GUILE_HASH" ]]; then
echo 'Guile hash does not match'
exit 7237625
fi
cd /
tar xvf $INSTALL_DIR/guile-${GUILE_VERSION}-pack-${GUILE_ARCH}-linux-gnu.tar.lz
}
# NOTE: deliberately no exit 0