@ -2,11 +2,12 @@
WINDOWS_VERSION = $( cmd.exe /c ver 2>/dev/null | grep "Microsoft Windows" )
WINDOWS_VERSION = $( cmd.exe /c ver 2>/dev/null | grep "Microsoft Windows" )
if [ ! -z " $WINDOWS_VERSION " ] ; then
if [ ! -z " $WINDOWS_VERSION " ] ; then
cd windows
cd windows
./bootstrap.sh
./bootstrap.sh
exit $?
exit $?
fi
fi
################ parameters ################
################ parameters ################
# directory where the script is located
# directory where the script is located
SCRIPT_DIR = $( cd $( dirname $0 ) ; pwd -P)
SCRIPT_DIR = $( cd $( dirname $0 ) ; pwd -P)
@ -23,19 +24,19 @@ FILTER_AUDIO_DIR=libfilteraudio-latest
if [ -z " $BASE_DIR " ] ; then
if [ -z " $BASE_DIR " ] ; then
echo "internal error detected!"
echo "internal error detected!"
echo "BASE_DIR should not be empty... aborting "
echo "BASE_DIR should not be empty. Aborting. "
exit 1
exit 1
fi
fi
if [ -z " $TOX_CORE_DIR " ] ; then
if [ -z " $TOX_CORE_DIR " ] ; then
echo "internal error detected!"
echo "internal error detected!"
echo "TOX_CORE_DIR should not be empty... aborting "
echo "TOX_CORE_DIR should not be empty. Aborting. "
exit 1
exit 1
fi
fi
if [ -z " $FILTER_AUDIO_DIR " ] ; then
if [ -z " $FILTER_AUDIO_DIR " ] ; then
echo "internal error detected!"
echo "internal error detected!"
echo "FILTER_AUDIO_DIR should not be empty... aborting "
echo "FILTER_AUDIO_DIR should not be empty. Aborting. "
exit 1
exit 1
fi
fi
@ -45,9 +46,10 @@ INSTALL_FILTER_AUDIO=true
SYSTEM_WIDE = true
SYSTEM_WIDE = true
KEEP_BUILD_FILES = false
KEEP_BUILD_FILES = false
########## parse input parameters ##########
########## parse input parameters ##########
while [ $# -ge 1 ] ; do
while [ $# -ge 1 ] ; do
if [ ${ 1 } = "--with-tox" ] ; then
if [ ${ 1 } = "--with-tox" ] ; then
INSTALL_TOX = true
INSTALL_TOX = true
shift
shift
elif [ ${ 1 } = "--without-tox" ] ; then
elif [ ${ 1 } = "--without-tox" ] ; then
@ -89,11 +91,11 @@ if [ ${1} = "--with-tox" ] ; then
echo "example usages:"
echo "example usages:"
echo " ${ 0 } -- install libtoxcore and libfilteraudio "
echo " ${ 0 } -- install libtoxcore and libfilteraudio "
exit 1
exit 1
fi
fi
done
done
########## print debug output ##########
############ print debug output ## ##########
echo " with tox : ${ INSTALL_TOX } "
echo " with tox : ${ INSTALL_TOX } "
echo " with filter-audio : ${ INSTALL_FILTER_AUDIO } "
echo " with filter-audio : ${ INSTALL_FILTER_AUDIO } "
echo " install into ${ INSTALL_DIR } : ${ SYSTEM_WIDE } "
echo " install into ${ INSTALL_DIR } : ${ SYSTEM_WIDE } "
@ -110,19 +112,36 @@ mkdir -p ${BASE_DIR}
rm -rf ${ BASE_DIR } /${ TOX_CORE_DIR }
rm -rf ${ BASE_DIR } /${ TOX_CORE_DIR }
rm -rf ${ BASE_DIR } /${ FILTER_AUDIO_DIR }
rm -rf ${ BASE_DIR } /${ FILTER_AUDIO_DIR }
############### install step ###############
#install libtoxcore
#install libtoxcore
if [ [ $INSTALL_TOX = "true" ] ] ; then
if [ [ $INSTALL_TOX = "true" ] ] ; then
git clone https://github.com/irungentoo/toxcore.git ${ BASE_DIR } /${ TOX_CORE_DIR } --depth 1
git clone https://github.com/irungentoo/toxcore.git ${ BASE_DIR } /${ TOX_CORE_DIR } --depth 1
pushd ${ BASE_DIR } /${ TOX_CORE_DIR }
pushd ${ BASE_DIR } /${ TOX_CORE_DIR }
./autogen.sh
./autogen.sh
if [ [ $SYSTEM_WIDE = "false" ] ] ; then
# configure
if [ [ $SYSTEM_WIDE = "false" ] ] ; then
./configure --prefix= ${ BASE_DIR }
./configure --prefix= ${ BASE_DIR }
make -j2
make install
else
else
./configure
./configure
make -j2
fi
# ensure A/V support is enabled
if ! grep -Fxq "BUILD_AV_TRUE=''" config.log
then
echo "A/V support of libtoxcore is disabled but required by qTox. Aborting."
echo "Maybe the dev-packages of libopus and libvpx are not installed?"
exit 1
fi
# compile
make -j 2
# install
if [ [ $SYSTEM_WIDE = "false" ] ] ; then
make install
else
sudo make install
sudo make install
sudo ldconfig
sudo ldconfig
fi
fi
@ -132,19 +151,19 @@ fi
#install libfilteraudio
#install libfilteraudio
if [ [ $INSTALL_FILTER_AUDIO = "true" ] ] ; then
if [ [ $INSTALL_FILTER_AUDIO = "true" ] ] ; then
git clone https://github.com/irungentoo/filter_audio.git ${ BASE_DIR } /${ FILTER_AUDIO_DIR } --depth 1
git clone https://github.com/irungentoo/filter_audio.git ${ BASE_DIR } /${ FILTER_AUDIO_DIR } --depth 1
pushd ${ BASE_DIR } /${ FILTER_AUDIO_DIR }
pushd ${ BASE_DIR } /${ FILTER_AUDIO_DIR }
if [ [ $SYSTEM_WIDE = "false" ] ] ; then
if [ [ $SYSTEM_WIDE = "false" ] ] ; then
PREFIX = ${ BASE_DIR } make -j2
PREFIX = ${ BASE_DIR } make -j2
PREFIX = ${ BASE_DIR } make install
PREFIX = ${ BASE_DIR } make install
else
else
make -j2
make -j2
sudo make install
sudo make install
sudo ldconfig
sudo ldconfig
fi
fi
popd
popd
fi
fi