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

fix(appimage): build sqlcipher form source

Needed since Debian version is broken https://bugs.debian.org/850421
This commit is contained in:
sudden6 2018-04-28 23:32:37 +02:00
parent 48179b6a19
commit 64a7c24b2b
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
2 changed files with 38 additions and 8 deletions

View File

@ -36,6 +36,8 @@ readonly QTOX_APP_DIR="$BUILD_DIR"/appdir
readonly LDQT_BUILD_DIR="$BUILD_DIR"/ldqt
# "appimagetool" becomes aitool
readonly AITOOL_BUILD_DIR="$BUILD_DIR"/aitool
# sqlcipher build directory
readonly SQLCIPHER_BUILD_DIR="$BUILD_DIR"/sqlcipher
# ldqt binary
readonly LDQT_BIN="/usr/lib/x86_64-linux-gnu/qt5/bin/linuxdeployqt"
readonly APT_FLAGS="-y --no-install-recommends"
@ -44,30 +46,49 @@ export MAKEFLAGS="-j$(nproc)"
# Get packages
apt-get update
apt-get install $APT_FLAGS sudo ca-certificates wget fuse xxd git g++ patchelf
apt-get install $APT_FLAGS sudo ca-certificates wget build-essential fuse xxd \
git g++ patchelf tclsh libssl-dev
# get version
cd "$QTOX_SRC_DIR"
export VERSION=$(git rev-parse --short HEAD) # linuxdeployqt uses this for naming the file
# linuxdeployqt uses this for naming the file
export VERSION=$(git rev-parse --short HEAD)
# create build directory
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
# we need a custom built sqlcipher version because of a Debian bug
# https://bugs.debian.org/850421
git clone https://github.com/sqlcipher/sqlcipher.git "$SQLCIPHER_BUILD_DIR"
cd "$SQLCIPHER_BUILD_DIR"
git checkout tags/v3.4.2
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
LDFLAGS="-lcrypto"
make
make install
# copy qtox source
cp -r "$QTOX_SRC_DIR" "$QTOX_BUILD_DIR"
cd "$QTOX_BUILD_DIR"
# ensure this directory is empty
rm -rf ./_build
# reuse for our purposes, pass flags to automatically install packages
./simple_make.sh "$APT_FLAGS"
# APT_FLAGS for automatic install
# True to not install sqlcipher
./simple_make.sh "$APT_FLAGS" True
# build dir of simple_make
cd _build
make DESTDIR="$QTOX_APP_DIR" install ; find "$QTOX_APP_DIR"
LDQT_HASH="9c90a882ac744b5f704598e9588450ddfe487c67" # is master as of 2018-04-25
# is master as of 2018-04-25
LDQT_HASH="9c90a882ac744b5f704598e9588450ddfe487c67"
# build linuxdeployqt
git clone https://github.com/probonopd/linuxdeployqt.git "$LDQT_BUILD_DIR"
cd "$LDQT_BUILD_DIR"
@ -76,9 +97,12 @@ qmake
make
make install
AITOOL_HASH="5d93115f279d94a4d23dfd64fb8ccd109e98f039" # is master as of 2018-04-25
# is master as of 2018-04-25
AITOOL_HASH="5d93115f279d94a4d23dfd64fb8ccd109e98f039"
# build appimagetool
git clone -b appimagetool/master --single-branch --recursive https://github.com/AppImage/AppImageKit "$AITOOL_BUILD_DIR"
git clone -b appimagetool/master --single-branch --recursive \
https://github.com/AppImage/AppImageKit "$AITOOL_BUILD_DIR"
cd "$AITOOL_BUILD_DIR"
git checkout "$AITOOL_HASH"
bash -ex install-build-deps.sh
@ -92,7 +116,9 @@ cd build
# make sure that deps in separate install tree are found
export PKG_CONFIG_PATH=/deps/lib/pkgconfig/
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON -DAPPIMAGEKIT_PACKAGE_DEBS=ON
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON \
-DAPPIMAGEKIT_PACKAGE_DEBS=ON
make
make install

View File

@ -4,6 +4,7 @@ set -eu -o pipefail
# additional flags for apt-get, used for CI
readonly APT_FLAGS=$1
readonly WITHOUT_SQLCIPHER=$2
apt_install() {
local apt_packages=(
@ -24,7 +25,6 @@ apt_install() {
libqt5opengl5-dev
libqt5svg5-dev
libsodium-dev
libsqlcipher-dev
libtool
libvpx-dev
libxss-dev
@ -34,6 +34,10 @@ apt_install() {
qttools5-dev-tools
)
if [ "$WITHOUT_SQLCIPHER" != "True" ]; then
apt_packages+=libsqlcipher-dev
fi
sudo apt-get install $APT_FLAGS "${apt_packages[@]}"
}