Install core deps
This commit is contained in:
parent
479fa4dffc
commit
e28fbcdf28
@ -64,3 +64,7 @@ else
|
||||
echo "Unrecognized os: $OPERATING_SYSTEM_NAME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ./scripts/core/
|
||||
./install-dependencies.sh
|
||||
cd ../../
|
||||
|
@ -85,34 +85,17 @@ else
|
||||
export TD_GENERATED_BINARIES_DIR=$(realpath -m ./generated/td_tools/td/generate)
|
||||
fi
|
||||
|
||||
# Create toolchain
|
||||
echo "Creating toolchain file..."
|
||||
{
|
||||
echo "set(CMAKE_SYSTEM_PROCESSOR ${CPU_ARCH_CMAKE})";
|
||||
echo "set(CMAKE_C_COMPILER ${CPU_ARCH_CMAKE}-linux-gnu-gcc)";
|
||||
echo "set(CMAKE_C_COMPILER_TARGET ${CLANG_TRIPLE})";
|
||||
echo "set(CMAKE_CXX_COMPILER ${CPU_ARCH_CMAKE}-linux-gnu-g++)";
|
||||
echo "set(CMAKE_CXX_COMPILER_TARGET ${CLANG_TRIPLE})";
|
||||
echo "set(CMAKE_ASM_COMPILER ${CPU_ARCH_CMAKE}-linux-gnu-g++)";
|
||||
echo "set(CMAKE_ASM_COMPILER_TARGET ${CLANG_TRIPLE})";
|
||||
echo "set(CMAKE_LIBRARY_PATH /usr/${CPU_ARCH_CMAKE}-linux-gnu/include)";
|
||||
cat <<EOF
|
||||
SET(CMAKE_SYSTEM_NAME Linux)
|
||||
EOF
|
||||
if [[ ${CPU_ARCHITECTURE_NAME} == "aarch64" || ${CPU_ARCHITECTURE_NAME} == "armv6" || ${CPU_ARCHITECTURE_NAME} == "armv7" ]]; then
|
||||
cat <<EOF
|
||||
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
|
||||
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||
set(CMAKE_USE_WIN32_THREADS_INIT 0)
|
||||
set(CMAKE_USE_PTHREADS_INIT 1)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
EOF
|
||||
fi
|
||||
} > ./generated/tdjni_build/toolchain.cmake
|
||||
|
||||
# Configure cmake
|
||||
echo "Configuring CMake..."
|
||||
cd ./generated/tdjni_build/
|
||||
|
||||
CMAKE_EXTRA_ARGUMENTS_TDJNI=""
|
||||
if [[ -z "$CROSS_BUILD_DEPS_DIR" ]]; then
|
||||
# shellcheck disable=SC2089
|
||||
CMAKE_EXTRA_ARGUMENTS_TDJNI="${CMAKE_EXTRA_ARGUMENTS_TDJNI} -DCMAKE_TOOLCHAIN_FILE=${CROSS_BUILD_DEPS_DIR}/toolchain.cmake"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
cmake \
|
||||
"-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" \
|
||||
-DTD_GENERATED_BINARIES_DIR=${TD_GENERATED_BINARIES_DIR} \
|
||||
@ -123,7 +106,7 @@ cmake \
|
||||
-DJAVA_SRC_DIR=$(realpath -m ../src/main/jni-java-src/) \
|
||||
-DTDNATIVES_CPP_SRC_DIR:PATH=$(realpath -m ../src/main/jni-cpp-src/) \
|
||||
-DOPENSSL_USE_STATIC_LIBS=True \
|
||||
"-DCMAKE_TOOLCHAIN_FILE=$CROSS_BUILD_DEPS_DIR/toolchain.cmake" \
|
||||
${CMAKE_EXTRA_ARGUMENTS_TDJNI} \
|
||||
${CMAKE_EXTRA_ARGUMENTS} \
|
||||
$(realpath -m ../src/main/jni-cpp-src/)
|
||||
|
||||
|
@ -61,6 +61,10 @@ if [[ "$IMPLEMENTATION_NAME" = "tdlight" ]]; then
|
||||
else
|
||||
CMAKE_EXTRA_ARGUMENTS_TD=""
|
||||
fi
|
||||
if [[ -z "$CROSS_BUILD_DEPS_DIR" ]]; then
|
||||
# shellcheck disable=SC2089
|
||||
CMAKE_EXTRA_ARGUMENTS_TD="${CMAKE_EXTRA_ARGUMENTS_TD} -DCMAKE_TOOLCHAIN_FILE=${CROSS_BUILD_DEPS_DIR}/toolchain.cmake"
|
||||
fi
|
||||
INSTALL_PREFIX="$(realpath -m ../td_bin/)"
|
||||
INSTALL_BINDIR="$(realpath -m ../td_bin/bin)"
|
||||
echo "Install prefix: $INSTALL_PREFIX"
|
||||
@ -70,7 +74,6 @@ cmake "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_PREFIX" \
|
||||
-DCMAKE_INSTALL_BINDIR:PATH="$INSTALL_BINDIR" \
|
||||
-DTD_ENABLE_JNI=ON \
|
||||
"-DCMAKE_TOOLCHAIN_FILE=$CROSS_BUILD_DEPS_DIR/toolchain.cmake" \
|
||||
${CMAKE_EXTRA_ARGUMENTS_TD} \
|
||||
${CMAKE_EXTRA_ARGUMENTS} \
|
||||
../implementation
|
||||
|
@ -63,10 +63,23 @@ if [[ "$OPERATING_SYSTEM_NAME" == "linux" ]]; then
|
||||
if [[ ! -f "$CROSS_BUILD_DEPS_DIR/ok-012" ]]; then
|
||||
rm -rf "$CROSS_BUILD_DEPS_DIR" || true
|
||||
mkdir -p "$CROSS_BUILD_DEPS_DIR"
|
||||
echo "
|
||||
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
|
||||
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
|
||||
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
|
||||
deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
|
||||
|
||||
deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe multiverse
|
||||
deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
|
||||
deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
|
||||
deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
|
||||
" | sudo tee /etc/apt/sources.list
|
||||
sudo dpkg --add-architecture "${CPU_ARCH_DPKG}"
|
||||
sudo apt-get update || true
|
||||
sudo apt-get install -y "libstdc++-11-dev-${CPU_ARCH_DPKG}-cross" \
|
||||
"crossbuild-essential-${CPU_ARCH_DPKG}" "libstdc++-11-pic-${CPU_ARCH_DPKG}-cross"
|
||||
sudo apt-get install -y "libstdc++-8-dev-${CPU_ARCH_DPKG}-cross" "libstdc++-8-pic-${CPU_ARCH_DPKG}-cross"
|
||||
if [[ "${CPU_ARCHITECTURE_NAME}" != "amd64" && "${CPU_ARCHITECTURE_NAME}" != "386" ]]; then
|
||||
sudo apt-get install -y "crossbuild-essential-${CPU_ARCH_DPKG}"
|
||||
fi
|
||||
cd "$CROSS_BUILD_DEPS_DIR"
|
||||
# LibZ-Dev
|
||||
apt-get download "zlib1g-dev:${CPU_ARCH_DPKG}"
|
||||
@ -94,23 +107,23 @@ if [[ "$OPERATING_SYSTEM_NAME" == "linux" ]]; then
|
||||
dpkg -x "$JC_DEB" "$CROSS_BUILD_DEPS_DIR"
|
||||
rm "$JC_DEB"
|
||||
# OpenJDK-JRE-Headless
|
||||
apt-get download "openjdk-11-jre-headless:${CPU_ARCH_DPKG}"
|
||||
OJDKRH_DEB="$(find "$CROSS_BUILD_DEPS_DIR" -maxdepth 1 -type f -iname "openjdk-11-jre-headless*.deb" | head -n 1)"
|
||||
apt-get download "openjdk-8-jre-headless:${CPU_ARCH_DPKG}"
|
||||
OJDKRH_DEB="$(find "$CROSS_BUILD_DEPS_DIR" -maxdepth 1 -type f -iname "openjdk-8-jre-headless*.deb" | head -n 1)"
|
||||
dpkg -x "$OJDKRH_DEB" "$CROSS_BUILD_DEPS_DIR"
|
||||
rm "$OJDKRH_DEB"
|
||||
# OpenJDK-JRE
|
||||
apt-get download "openjdk-11-jre:${CPU_ARCH_DPKG}"
|
||||
OJDKR_DEB="$(find "$CROSS_BUILD_DEPS_DIR" -maxdepth 1 -type f -iname "openjdk-11-jre*.deb" | head -n 1)"
|
||||
apt-get download "openjdk-8-jre:${CPU_ARCH_DPKG}"
|
||||
OJDKR_DEB="$(find "$CROSS_BUILD_DEPS_DIR" -maxdepth 1 -type f -iname "openjdk-8-jre*.deb" | head -n 1)"
|
||||
dpkg -x "$OJDKR_DEB" "$CROSS_BUILD_DEPS_DIR"
|
||||
rm "$OJDKR_DEB"
|
||||
# OpenJDK-JDK
|
||||
apt-get download "openjdk-11-jdk-headless:${CPU_ARCH_DPKG}"
|
||||
OJDKJ_DEB="$(find "$CROSS_BUILD_DEPS_DIR" -maxdepth 1 -type f -iname "openjdk-11-jdk-headless*.deb" | head -n 1)"
|
||||
apt-get download "openjdk-8-jdk-headless:${CPU_ARCH_DPKG}"
|
||||
OJDKJ_DEB="$(find "$CROSS_BUILD_DEPS_DIR" -maxdepth 1 -type f -iname "openjdk-8-jdk-headless*.deb" | head -n 1)"
|
||||
dpkg -x "$OJDKJ_DEB" "$CROSS_BUILD_DEPS_DIR"
|
||||
rm "$OJDKJ_DEB"
|
||||
# OpenJDK-GUI
|
||||
apt-get download "openjdk-11-jdk:${CPU_ARCH_DPKG}"
|
||||
OJDKG_DEB="$(find "$CROSS_BUILD_DEPS_DIR" -maxdepth 1 -type f -iname "openjdk-11-jdk*.deb" | head -n 1)"
|
||||
apt-get download "openjdk-8-jdk:${CPU_ARCH_DPKG}"
|
||||
OJDKG_DEB="$(find "$CROSS_BUILD_DEPS_DIR" -maxdepth 1 -type f -iname "openjdk-8-jdk*.deb" | head -n 1)"
|
||||
dpkg -x "$OJDKG_DEB" "$CROSS_BUILD_DEPS_DIR"
|
||||
rm "$OJDKG_DEB"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user