1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(extensions): Add toxext to CI scripts

This commit is contained in:
Mick Sayson 2019-11-17 14:00:25 -08:00 committed by Anthony Bilinski
parent b715815011
commit 670457a77b
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
7 changed files with 332 additions and 12 deletions

View File

@ -126,16 +126,18 @@ CC="ccache $CC" CXX="ccache $CXX" make -j$(nproc)
sudo checkinstall --install --pkgname libsodium --pkgversion 1.0.8 --nodoc -y sudo checkinstall --install --pkgname libsodium --pkgversion 1.0.8 --nodoc -y
sudo ldconfig sudo ldconfig
cd .. cd ..
# toxcore # toxcore
git clone --branch v0.2.12 --depth=1 https://github.com/toktok/c-toxcore.git toxcore git clone --branch v0.2.12 --depth=1 https://github.com/toktok/c-toxcore.git toxcore
cd toxcore cd toxcore
autoreconf -if mkdir build-cmake
CC="ccache $CC" CXX="ccache $CXX" ./configure cd build-cmake
CC="ccache $CC" CXX="ccache $CXX" make -j$(nproc) > /dev/null CC="ccache $CC" CXX="ccache $CXX" cmake ..
make -j$(nproc) > /dev/null
sudo make install sudo make install
echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf
sudo ldconfig sudo ldconfig
cd .. cd ../..
# filteraudio # filteraudio
git clone --branch v0.0.1 --depth=1 https://github.com/irungentoo/filter_audio filteraudio git clone --branch v0.0.1 --depth=1 https://github.com/irungentoo/filter_audio filteraudio
@ -144,12 +146,32 @@ CC="ccache $CC" CXX="ccache $CXX" sudo make install -j$(nproc)
sudo ldconfig sudo ldconfig
cd .. cd ..
$CC --version # toxext
$CXX --version git clone --branch v0.0.2 --depth=1 https://github.com/toxext/toxext toxext
cd toxext
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
cd ../../
# toxext_messages
git clone --branch v0.0.2 --depth=1 https://github.com/toxext/tox_extension_messages tox_extension_messages
cd tox_extension_messages
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
cd ../../
# needed, otherwise ffmpeg doesn't get detected # needed, otherwise ffmpeg doesn't get detected
export PKG_CONFIG_PATH="$PWD/libs/lib/pkgconfig" export PKG_CONFIG_PATH="$PWD/libs/lib/pkgconfig"
$CC --version
$CXX --version
build_qtox() { build_qtox() {
bdir() { bdir() {
cd $BUILDDIR cd $BUILDDIR

View File

@ -52,7 +52,7 @@ copy_libs() {
echo Copying libraries… echo Copying libraries…
for lib in "${libs[@]}" for lib in "${libs[@]}"
do do
cp -v "$lib" "$dest" cp -v -r "$lib" "$dest"
done done
} }

View File

@ -49,14 +49,20 @@ readonly BASE_DIR="${SCRIPT_DIR}/${INSTALL_DIR}"
# versions of libs to checkout # versions of libs to checkout
readonly TOXCORE_VERSION="v0.2.12" readonly TOXCORE_VERSION="v0.2.12"
readonly TOXEXT_VERSION="v0.0.2"
readonly TOX_EXT_MESSAGES_VERSION="v0.0.2"
readonly SQLCIPHER_VERSION="v4.3.0" readonly SQLCIPHER_VERSION="v4.3.0"
# directory names of cloned repositories # directory names of cloned repositories
readonly TOXCORE_DIR="libtoxcore-$TOXCORE_VERSION" readonly TOXCORE_DIR="libtoxcore-$TOXCORE_VERSION"
readonly TOXEXT_DIR="toxext-$TOXEXT_VERSION"
readonly TOX_EXT_MESSAGES_DIR="tox_ext_messages-$TOXEXT_VERSION"
readonly SQLCIPHER_DIR="sqlcipher-$SQLCIPHER_VERSION" readonly SQLCIPHER_DIR="sqlcipher-$SQLCIPHER_VERSION"
# default values for user given parameters # default values for user given parameters
INSTALL_TOX=true INSTALL_TOX=true
INSTALL_TOXEXT=true
INSTALL_TOX_EXT_MESSAGES=true
INSTALL_SQLCIPHER=false INSTALL_SQLCIPHER=false
SYSTEM_WIDE=true SYSTEM_WIDE=true
KEEP_BUILD_FILES=false KEEP_BUILD_FILES=false
@ -128,6 +134,57 @@ install_toxcore() {
fi fi
} }
install_toxext() {
if [[ $INSTALL_TOXEXT = "true" ]]
then
git clone https://github.com/toxext/toxext.git \
--branch $TOXEXT_VERSION \
"${BASE_DIR}/${TOXEXT_DIR}"
pushd ${BASE_DIR}/${TOXEXT_DIR}
# compile and install
if [[ $SYSTEM_WIDE = "false" ]]
then
cmake . -DCMAKE_INSTALL_PREFIX=${BASE_DIR}
make -j $(nproc)
make install
else
cmake .
make -j $(nproc)
sudo make install
sudo ldconfig
fi
popd
fi
}
install_tox_ext_messages() {
if [[ $INSTALL_TOX_EXT_MESSAGES = "true" ]]
then
git clone https://github.com/toxext/tox_extension_messages.git \
--branch $TOX_EXT_MESSAGES_VERSION \
"${BASE_DIR}/${TOX_EXT_MESSAGES_DIR}"
pushd ${BASE_DIR}/${TOX_EXT_MESSAGES_DIR}
# compile and install
if [[ $SYSTEM_WIDE = "false" ]]
then
cmake . -DCMAKE_INSTALL_PREFIX=${BASE_DIR}
make -j $(nproc)
make install
else
cmake .
make -j $(nproc)
sudo make install
sudo ldconfig
fi
popd
fi
}
install_sqlcipher() { install_sqlcipher() {
if [[ $INSTALL_SQLCIPHER = "true" ]] if [[ $INSTALL_SQLCIPHER = "true" ]]
@ -178,6 +235,22 @@ main() {
then then
INSTALL_TOX=false INSTALL_TOX=false
shift shift
elif [ ${1} = "--with-toxext" ]
then
INSTALL_TOXEXT=true
shift
elif [ ${1} = "--without-toxext" ]
then
INSTALL_TOXEXT=false
shift
elif [ ${1} = "--with-toxext-messages" ]
then
INSTALL_TOX_EXT_MESSAGES=true
shift
elif [ ${1} = "--without-toxext-messages" ]
then
INSTALL_TOX_EXT_MESSAGES=false
shift
elif [ ${1} = "--with-sqlcipher" ] elif [ ${1} = "--with-sqlcipher" ]
then then
INSTALL_SQLCIPHER=true INSTALL_SQLCIPHER=true
@ -221,6 +294,8 @@ main() {
############### install step ############### ############### install step ###############
install_toxcore install_toxcore
install_toxext
install_tox_ext_messages
install_sqlcipher install_sqlcipher
############### cleanup step ############### ############### cleanup step ###############

View File

@ -117,6 +117,30 @@
} }
] ]
}, },
{
"name": "toxext",
"buildsystem": "cmake-ninja",
"sources": [
{
"type": "git",
"url": "https://github.com/toxext/toxext",
"tag": "v0.0.2",
"commit": "0280357a0dded4dd46d0ff29f52875687136472d"
}
]
},
{
"name": "tox_extension_messages",
"buildsystem": "cmake-ninja",
"sources": [
{
"type": "git",
"url": "https://github.com/toxext/tox_extension_messages",
"tag": "v0.0.2",
"commit": "f1f4539cf1aeed0bcc0ad476fbae74cb5bd0cf66"
}
]
},
{ {
"name": "qTox", "name": "qTox",
"buildsystem": "cmake-ninja", "buildsystem": "cmake-ninja",

View File

@ -41,6 +41,8 @@ QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1
QT_DIR_VER="${QT_DIR}/${QT_VER[1]}" QT_DIR_VER="${QT_DIR}/${QT_VER[1]}"
TOXCORE_DIR="${MAIN_DIR}/toxcore" # Change to Git location TOXCORE_DIR="${MAIN_DIR}/toxcore" # Change to Git location
TOX_EXT_DIR="${MAIN_DIR}/toxext"
TOX_EXT_MESSAGES_DIR="${MAIN_DIR}/tox_extension_messages"
LIB_INSTALL_PREFIX="${QTOX_DIR}/libs" LIB_INSTALL_PREFIX="${QTOX_DIR}/libs"
@ -80,6 +82,43 @@ build_toxcore() {
make install > /dev/null || exit 1 make install > /dev/null || exit 1
} }
build_toxext() {
echo "Starting Toxext build and install"
cd $TOX_EXT_DIR
echo "Now working in: ${PWD}"
[[ $TRAVIS != true ]] \
&& sleep 3
mkdir _build && cd _build
fcho "Starting cmake ..."
PKG_CONFIG_PATH="${LIB_INSTALL_PREFIX}"/lib/pkgconfig cmake -DCMAKE_INSTALL_PREFIX="${LIB_INSTALL_PREFIX}" ..
make clean &> /dev/null
fcho "Compiling toxext."
make > /dev/null || exit 1
fcho "Installing toxext."
make install > /dev/null || exit 1
}
build_tox_extension_messages() {
echo "Starting tox_extension_messages build and install"
cd $TOX_EXT_MESSAGES_DIR
echo "Now working in: ${PWD}"
[[ $TRAVIS != true ]] \
&& sleep 3
mkdir _build && cd _build
fcho "Starting cmake ..."
PKG_CONFIG_PATH="${LIB_INSTALL_PREFIX}"/lib/pkgconfig cmake -DCMAKE_INSTALL_PREFIX="${LIB_INSTALL_PREFIX}" ..
make clean &> /dev/null
fcho "Compiling tox_extension_messages."
make > /dev/null || exit 1
fcho "Installing tox_extension_messages."
make install > /dev/null || exit 1
}
install() { install() {
fcho "==============================" fcho "=============================="
fcho "This script will install the necessary applications and libraries needed to compile qTox properly." fcho "This script will install the necessary applications and libraries needed to compile qTox properly."
@ -145,6 +184,26 @@ install() {
fcho "Cloning Toxcore git ... " fcho "Cloning Toxcore git ... "
git clone --branch v0.2.12 --depth=1 https://github.com/toktok/c-toxcore "$TOXCORE_DIR" git clone --branch v0.2.12 --depth=1 https://github.com/toktok/c-toxcore "$TOXCORE_DIR"
fi fi
# toxext
if [[ -e $TOX_EXT_DIR/.git/index ]]
then
fcho "ToxExt git repo already in place !"
cd $TOX_EXT_DIR
git pull
else
fcho "Cloning ToxExt git ... "
git clone --branch v0.0.2 --depth=1 https://github.com/toxext/toxext "$TOX_EXT_DIR"
fi
# tox_extension_messages
if [[ -e $TOX_EXT_MESSAGES_DIR/.git/index ]]
then
fcho "ToxExt git repo already in place !"
cd $TOX_EXT_MESSAGES_DIR
git pul
else
fcho "Cloning tox_extension_messages git ... "
git clone --branch v0.0.2 --depth=1 https://github.com/toxext/tox_extension_messages "$TOX_EXT_MESSAGES_DIR"
fi
# qTox # qTox
if [[ $TRAVIS = true ]] if [[ $TRAVIS = true ]]
then then
@ -161,12 +220,16 @@ install() {
fi fi
fi fi
if [[ $TRAVIS != true ]]
then
fcho "If all went well you should now have all the tools needed to compile qTox!"
fi
# toxcore build # toxcore build
if [[ $TRAVIS = true ]] if [[ $TRAVIS = true ]]
then then
build_toxcore build_toxcore
else else
fcho "If all went well you should now have all the tools needed to compile qTox!"
read -r -p "Would you like to install toxcore now? [y/N] " response read -r -p "Would you like to install toxcore now? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]] if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then then
@ -176,6 +239,34 @@ install() {
fi fi
fi fi
# toxext build
if [[ $TRAVIS = true ]]
then
build_toxext
else
read -r -p "Would you like to install toxext now? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
build_toxext
else
fcho "You can simply use the -u command and say [Yes/n] when prompted"
fi
fi
# tox_extension_messages build
if [[ $TRAVIS = true ]]
then
build_tox_extension_messages
else
read -r -p "Would you like to install tox_extension_messages now? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
build_tox_extension_messages
else
fcho "You can simply use the -u command and say [Yes/n] when prompted"
fi
fi
QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p')) QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p'))
QT_DIR_VER="${QT_DIR}/${QT_VER[1]}" QT_DIR_VER="${QT_DIR}/${QT_VER[1]}"
@ -230,7 +321,6 @@ build() {
cd $BUILD_DIR cd $BUILD_DIR
fcho "Now working in ${PWD}" fcho "Now working in ${PWD}"
fcho "Starting cmake ..." fcho "Starting cmake ..."
export CMAKE_PREFIX_PATH=$(brew --prefix qt5)
if [[ $TRAVIS = true ]] if [[ $TRAVIS = true ]]
then then
@ -238,7 +328,11 @@ build() {
else else
STRICT_OPTIONS="OFF" STRICT_OPTIONS="OFF"
fi fi
cmake -H$QTOX_DIR -B. -DUPDATE_CHECK=ON -DSPELL_CHECK=OFF -DSTRICT_OPTIONS="${STRICT_OPTIONS}" cmake -H$QTOX_DIR -B. \
-DUPDATE_CHECK=ON \
-DSPELL_CHECK=OFF \
-DSTRICT_OPTIONS="${STRICT_OPTIONS}" \
-DCMAKE_PREFIX_PATH="$(brew --prefix qt5);${LIB_INSTALL_PREFIX}"
make -j$(sysctl -n hw.ncpu) make -j$(sysctl -n hw.ncpu)
} }
@ -262,6 +356,8 @@ bootstrap() {
#Toxcore #Toxcore
build_toxcore build_toxcore
build_toxext
build_tox_extension_messages
#Boot Strap #Boot Strap
fcho "Running: sudo ${QTOX_DIR}/bootstrap-osx.sh" fcho "Running: sudo ${QTOX_DIR}/bootstrap-osx.sh"

View File

@ -1030,6 +1030,109 @@ else
echo "Using cached build of Toxcore `cat $TOXCORE_PREFIX_DIR/done`" echo "Using cached build of Toxcore `cat $TOXCORE_PREFIX_DIR/done`"
fi fi
# toxext
TOXEXT_PREFIX_DIR="$DEP_DIR/toxext"
TOXEXT_VERSION=0.0.2
TOXEXT_HASH="047093eeed396ea9b4a3f0cd0a6bc4e0e09b339e2b03ba4b676e30888fe6acde"
TOXEXT_FILENAME="toxext-$TOXEXT_VERSION.tar.gz"
if [ ! -f "$TOXEXT_PREFIX_DIR/done" ]
then
rm -rf "$TOXEXT_PREFIX_DIR"
mkdir -p "$TOXEXT_PREFIX_DIR"
curl $CURL_OPTIONS https://github.com/toxext/toxext/archive/v$TOXEXT_VERSION.tar.gz -o $TOXEXT_FILENAME
check_sha256 "$TOXEXT_HASH" "$TOXEXT_FILENAME"
bsdtar --no-same-owner --no-same-permissions -xf "$TOXEXT_FILENAME"
rm "$TOXEXT_FILENAME"
cd toxext*
mkdir -p build
cd build
export PKG_CONFIG_PATH="$OPUS_PREFIX_DIR/lib/pkgconfig:$SODIUM_PREFIX_DIR/lib/pkgconfig:$VPX_PREFIX_DIR/lib/pkgconfig:$TOXCORE_PREFIX_DIR/lib/pkgconfig"
export PKG_CONFIG_LIBDIR="/usr/$ARCH-w64-mingw32"
echo "
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER $ARCH-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER $ARCH-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER $ARCH-w64-mingw32-windres)
SET(CMAKE_FIND_ROOT_PATH /usr/$ARCH-w64-mingw32 $OPUS_PREFIX_DIR $SODIUM_PREFIX_DIR $VPX_PREFIX_DIR $TOXCORE_PREFIX_DIR)
" > toolchain.cmake
cmake -DCMAKE_INSTALL_PREFIX=$TOXEXT_PREFIX_DIR \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
..
make
make install
echo -n $TOXEXT_VERSION > $TOXEXT_PREFIX_DIR/done
unset PKG_CONFIG_PATH
unset PKG_CONFIG_LIBDIR
cd ..
cd ..
rm -rf ./toxext*
else
echo "Using cached build of ToxExt `cat $TOXEXT_PREFIX_DIR/done`"
fi
# tox_extension_messages
TOX_EXTENSION_MESSAGES_PREFIX_DIR="$DEP_DIR/tox_extension_messages"
TOX_EXTENSION_MESSAGES_VERSION=0.0.2
TOX_EXTENSION_MESSAGES_HASH="95e8cdd1de6cc7ba561620716f340e9606a06b3c2ff9c9020af4784c22fd0d7f"
TOX_EXTENSION_MESSAGES_FILENAME="tox_extension_messages-$TOX_EXTENSION_MESSAGES_VERSION.tar.gz"
if [ ! -f "$TOX_EXTENSION_MESSAGES_PREFIX_DIR/done" ]
then
rm -rf "$TOX_EXTENSION_MESSAGES_PREFIX_DIR"
mkdir -p "$TOX_EXTENSION_MESSAGES_PREFIX_DIR"
curl $CURL_OPTIONS https://github.com/toxext/tox_extension_messages/archive/v$TOX_EXTENSION_MESSAGES_VERSION.tar.gz -o $TOX_EXTENSION_MESSAGES_FILENAME
check_sha256 "$TOX_EXTENSION_MESSAGES_HASH" "$TOX_EXTENSION_MESSAGES_FILENAME"
bsdtar --no-same-owner --no-same-permissions -xf "$TOX_EXTENSION_MESSAGES_FILENAME"
rm "$TOX_EXTENSION_MESSAGES_FILENAME"
cd tox_extension_messages*
mkdir -p build
cd build
export PKG_CONFIG_PATH="$OPUS_PREFIX_DIR/lib/pkgconfig:$SODIUM_PREFIX_DIR/lib/pkgconfig:$VPX_PREFIX_DIR/lib/pkgconfig:$TOXCORE_PREFIX_DIR/lib/pkgconfig"
export PKG_CONFIG_LIBDIR="/usr/$ARCH-w64-mingw32"
echo "
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER $ARCH-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER $ARCH-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER $ARCH-w64-mingw32-windres)
SET(CMAKE_FIND_ROOT_PATH /usr/$ARCH-w64-mingw32 $OPUS_PREFIX_DIR $SODIUM_PREFIX_DIR $VPX_PREFIX_DIR $TOXCORE_PREFIX_DIR $TOXEXT_PREFIX_DIR)
" > toolchain.cmake
cmake -DCMAKE_INSTALL_PREFIX=$TOX_EXTENSION_MESSAGES_PREFIX_DIR \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=toolchain.cmake \
..
make
make install
echo -n $TOX_EXTENSION_MESSAGES_VERSION > $TOX_EXTENSION_MESSAGES_PREFIX_DIR/done
unset PKG_CONFIG_PATH
unset PKG_CONFIG_LIBDIR
cd ..
cd ..
rm -rf ./tox_extension_messages*
else
echo "Using cached build of tox_extension_messages `cat $TOX_EXTENSION_MESSAGES_PREFIX_DIR/done`"
fi
set +u set +u
if [[ -n "$TRAVIS_CI_STAGE" ]] || [[ "$BUILD_TYPE" == "debug" ]] if [[ -n "$TRAVIS_CI_STAGE" ]] || [[ "$BUILD_TYPE" == "debug" ]]