CI and Android toolchain improvements

This commit is contained in:
Gioacchino Mazzurco 2021-09-03 12:48:44 +02:00
parent 900ea5508d
commit 8452e30afc
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051
3 changed files with 26 additions and 30 deletions

View File

@ -63,17 +63,7 @@ WORKDIR /bCache
RUN $PREPARE_TOOLCHAIN install_android_sdk
RUN $PREPARE_TOOLCHAIN install_android_ndk
RUN $PREPARE_TOOLCHAIN bootstrap_toolchain
RUN $PREPARE_TOOLCHAIN build_bzlib
RUN $PREPARE_TOOLCHAIN build_openssl
RUN $PREPARE_TOOLCHAIN build_sqlite
RUN $PREPARE_TOOLCHAIN build_sqlcipher
RUN $PREPARE_TOOLCHAIN build_rapidjson
RUN $PREPARE_TOOLCHAIN build_restbed
RUN $PREPARE_TOOLCHAIN build_udp-discovery-cpp
RUN $PREPARE_TOOLCHAIN build_xapian
RUN $PREPARE_TOOLCHAIN build_miniupnpc
RUN $PREPARE_TOOLCHAIN deduplicate_includes
RUN $PREPARE_TOOLCHAIN
ARG QT_INSTALLER_JWT_TOKEN
RUN $PREPARE_TOOLCHAIN install_qt_android

View File

@ -68,7 +68,7 @@ define_default_value QT_ANDROID_VIA_INSTALLER "false"
define_default_value QT_VERSION "5.12.11"
define_default_value QT_INSTALLER_VERSION "4.1.1"
define_default_value QT_INSTALLER_SHA256 1266ffd0d1b0e466244e3bc8422975c1aa9d96745b6bb28d422f7f92df11f34c
define_default_value QT_INSTALLER_JWT_TOKEN "Need a QT account JWT token to use the insaller see https://wiki.qt.io/Online_Installer_4.x"
define_default_value QT_INSTALLER_JWT_TOKEN ""
define_default_value QT_INSTALL_PATH "${NATIVE_LIBS_TOOLCHAIN_PATH}/Qt/"
define_default_value QT_ANDROID_INSTALLER_SHA256 a214084e2295c9a9f8727e8a0131c37255bf724bfc69e80f7012ba3abeb1f763
@ -416,6 +416,13 @@ get_qt_dir()
task_register install_qt_android
install_qt_android()
{
[ "$QT_INSTALLER_JWT_TOKEN" == "" ] &&
{
echo "To run Qt installer QT_INSTALLER_JWT_TOKEN environement variable \
need to be set to a valid JWT token see https://wiki.qt.io/Online_Installer_4.x"
return -1
}
QT_VERSION_CODE="$(echo $QT_VERSION | tr -d .)"
QT_INSTALLER="qt-unified-linux-x86_64-${QT_INSTALLER_VERSION}-online.run"
tMajDotMinVer="$(echo $QT_INSTALLER_VERSION | awk -F. '{print $1"."$2}')"
@ -855,7 +862,6 @@ build_default_toolchain()
task_run build_xapian || return $?
task_run build_miniupnpc || return $?
task_run build_phash || return $?
task_run build_mvptree || return $?
task_run deduplicate_includes || return $?
task_run get_native_libs_toolchain_path || return $?
}

View File

@ -2,42 +2,42 @@
## force cloning a new
## To prepare an image suitable as base for Gitlab CI use
# docker build -t "${CI_REGISTRY_IMAGE}:base" --build-arg KEEP_SOURCE=true --build-arg REPO_DEPTH="" -f base.Dockerfile .
## Now you need to tag it so you can later push it
# docker tag ${ID_OF_THE_CREATED_IMAGE} registry.gitlab.com/retroshare/${CI_REGISTRY_IMAGE}:base
# export CI_REGISTRY_IMAGE="registry.gitlab.com/retroshare/retroshare:base"
# docker build -t "${CI_REGISTRY_IMAGE}" -f base.Dockerfile .
## To push it to gitlab CI registry you need first to login and the to push
# docker login registry.gitlab.com
# docker push registry.gitlab.com/retroshare/${CI_REGISTRY_IMAGE}:base
# docker push "${CI_REGISTRY_IMAGE}"
## To run the container
# docker run -it -p 127.0.0.1:9092:9092 "${CI_REGISTRY_IMAGE}:base" retroshare-service --jsonApiPort 9092 --jsonApiBindAddress 0.0.0.0
# docker run -it -p 127.0.0.1:9092:9092 "${CI_REGISTRY_IMAGE}" retroshare-service --jsonApiPort 9092 --jsonApiBindAddress 0.0.0.0
FROM ubuntu
ARG CACHEBUST=0
RUN \
apt-get update -y && apt-get upgrade -y && \
apt-get install -y build-essential libssl-dev libbz2-dev libsqlite3-dev \
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get upgrade -y -qq && \
apt-get install -y -qq build-essential cimg-dev libssl-dev libbz2-dev \
libsqlite3-dev \
libsqlcipher-dev libupnp-dev pkg-config libz-dev \
qt5-default libxapian-dev qttools5-dev doxygen rapidjson-dev \
git cmake curl
RUN git clone --depth 1 https://github.com/aetilius/pHash.git && \
rm -rf pHash-build && mkdir pHash-build && cd pHash-build && \
cmake -B. -H../pHash && make -j$(nproc) && make install && cd .. && \
rm -rf pHash-build pHash
ARG FRESHCLONE=0
ARG REPO_URL=https://gitlab.com/RetroShare/RetroShare.git
ARG REPO_BRANCH=master
ARG REPO_DEPTH="--depth 2000"
ARG KEEP_SOURCE=false
RUN apt-get update -y && apt-get upgrade -y
RUN git clone $REPO_DEPTH $REPO_URL -b $REPO_BRANCH && cd RetroShare && \
git fetch --tags && cd ..
RUN \
mkdir RetroShare-build && cd RetroShare-build && \
RUN mkdir RetroShare-build && cd RetroShare-build && \
qmake ../RetroShare \
CONFIG+=no_retroshare_plugins CONFIG+=ipv6 \
CONFIG+=no_retroshare_plugins \
CONFIG+=retroshare_service CONFIG+=no_retroshare_gui \
CONFIG+=rs_jsonapi CONFIG+=rs_deep_search && \
(make -j$(nproc) || make -j$(nproc) || make) && make install && \
cd .. && rm -rf RetroShare-build && ($KEEP_SOURCE || rm -rf RetroShare)
cd .. && rm -rf RetroShare-build