From a4f3e972b69cc297b0ddbfa97b50b6bf9b13f988 Mon Sep 17 00:00:00 2001 From: user Date: Sat, 1 Jan 2022 22:37:50 +0300 Subject: [PATCH] Rename dependencies directory --- .gitignore | 2 +- dependencies/README.md | 22 ++++++++ dependencies/boost/build.sh | 50 ++++++++++++++++++ dependencies/boost/setup.sh | 20 +++++++ dependencies/db/build.sh | 64 ++++++++++++++++++++++ dependencies/db/setup.sh | 21 +++++++ dependencies/openssl/build.sh | 70 +++++++++++++++++++++++++ dependencies/openssl/setup.sh | 8 +++ dependencies/qt/build.sh | 93 +++++++++++++++++++++++++++++++++ dependencies/qt/setup.sh | 17 ++++++ dependencies/qt/stack_protector.patch | 25 +++++++++ dependencies/zlib/build.sh | 64 ++++++++++++++++++++++ dependencies/zlib/setup.sh | 8 +++ mingw64_deps/README.md | 22 -------- mingw64_deps/boost/build.sh | 50 ------------------ mingw64_deps/boost/setup.sh | 20 ------- mingw64_deps/db/build.sh | 64 ---------------------- mingw64_deps/db/setup.sh | 21 ------- mingw64_deps/openssl/build.sh | 70 ------------------------- mingw64_deps/openssl/setup.sh | 8 --- mingw64_deps/qt/build.sh | 93 --------------------------------- mingw64_deps/qt/setup.sh | 17 ------ mingw64_deps/qt/stack_protector.patch | 25 --------- mingw64_deps/zlib/build.sh | 64 ---------------------- mingw64_deps/zlib/setup.sh | 8 --- 25 files changed, 463 insertions(+), 463 deletions(-) create mode 100644 dependencies/README.md create mode 100755 dependencies/boost/build.sh create mode 100755 dependencies/boost/setup.sh create mode 100755 dependencies/db/build.sh create mode 100755 dependencies/db/setup.sh create mode 100755 dependencies/openssl/build.sh create mode 100755 dependencies/openssl/setup.sh create mode 100755 dependencies/qt/build.sh create mode 100755 dependencies/qt/setup.sh create mode 100644 dependencies/qt/stack_protector.patch create mode 100755 dependencies/zlib/build.sh create mode 100755 dependencies/zlib/setup.sh delete mode 100644 mingw64_deps/README.md delete mode 100755 mingw64_deps/boost/build.sh delete mode 100755 mingw64_deps/boost/setup.sh delete mode 100755 mingw64_deps/db/build.sh delete mode 100755 mingw64_deps/db/setup.sh delete mode 100755 mingw64_deps/openssl/build.sh delete mode 100755 mingw64_deps/openssl/setup.sh delete mode 100755 mingw64_deps/qt/build.sh delete mode 100755 mingw64_deps/qt/setup.sh delete mode 100644 mingw64_deps/qt/stack_protector.patch delete mode 100755 mingw64_deps/zlib/build.sh delete mode 100755 mingw64_deps/zlib/setup.sh diff --git a/.gitignore b/.gitignore index 968151e..2a84d39 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,6 @@ qrc_*.cpp #mac specific .DS_Store build -mingw64_deps +dependencies !src/leveldb/Makefile diff --git a/dependencies/README.md b/dependencies/README.md new file mode 100644 index 0000000..08f9eec --- /dev/null +++ b/dependencies/README.md @@ -0,0 +1,22 @@ +# Cross-build dependencies for Windows x86-64 and Windows ARM64 + +## Requirements + +Please use llvm-mingw compiler which can be downloaded here: + + https://github.com/mstorsjo/llvm-mingw/releases + +You will also need to install CMake 3.20 or newer to compile Qt libraries. Simplest way to do this is to use python repositories: + + sudo apt install python3-pip + pip3 install cmake + +Unpack compiler binaries to suitable directory (/opt is preferred) and ensure that its /bin subdirectory is mentioned in your PATH. You will also need to add /home/user/.local/bin to PATH as well. + +## Setting up + + Every subdirectory contains a setup.sh script which can be used to download source code and create source trees. + +## Building + + Just execute ./build.sh script for corresponding dependency using either x86_64 or aarch64 as argument. It will build binaries automatically. diff --git a/dependencies/boost/build.sh b/dependencies/boost/build.sh new file mode 100755 index 0000000..10e1e4c --- /dev/null +++ b/dependencies/boost/build.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +TARGET_CPU=$1 +TARGET_OS=$2 +ROOT=$(pwd) + +if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then +echo "Platform ${TARGET_CPU} is not supported" +echo "Expected either aarch64 or x86_64." +exit 1 +fi + +if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then +echo "Operation sysrem ${TARGET_OS} is not supported" +echo "Expected either w64-mingw32 or linux-gnu." +exit 1 +fi + +# Cross-building prefix +CROSS=${TARGET_CPU}-${TARGET_OS} + +if [[ ! $(which ${CROSS}-gcc) ]]; then +echo "Target C compiler ${CROSS}-gcc is not found" +exit 1 +fi + +if [[ ! $(which ${CROSS}-g++) ]]; then +echo "Target C++ compiler ${CROSS}-g++ is not found" +exit 1 +fi + +if [ "${TARGET_OS}" == "w64-mingw32" ]; then +MINGW32_PARAMS="target-os=windows" +fi + +# Create stage directory +mkdir ${ROOT}/${CROSS} + +cd ${ROOT}/boost + +# Create compiler settings +echo "using gcc : : ${CROSS}-g++ ;" > user-config-${CROSS}.jam + +# Build boost +./b2 --user-config=user-config-${CROSS}.jam cxxflags="-fstack-protector-strong -D_FORTIFY_SOURCE=2" linkflags=-fstack-protector-strong --build-type=minimal --layout=system --with-chrono --with-filesystem --with-program_options --with-system --with-thread ${MINGW32_PARAMS} address-model=64 variant=release link=static threading=multi runtime-link=static stage --prefix=${ROOT}/${CROSS} install + +cd ${ROOT} + +# Remove build directories +rm -rf ${ROOT}/boost/stage ${ROOT}/boost/bin.v2 ${ROOT}/boost/user-config-${CROSS}.jam diff --git a/dependencies/boost/setup.sh b/dependencies/boost/setup.sh new file mode 100755 index 0000000..8a35c2e --- /dev/null +++ b/dependencies/boost/setup.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +if [[ ! $(which wget) ]]; then + echo "wget is not installed" + exit -1 +fi + +ROOT=$(pwd) +VER=1_78_0 + +wget -O ${ROOT}/boost_${VER}.tar.gz https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_${VER}.tar.gz +tar -xzf ${ROOT}/boost_${VER}.tar.gz +mv ${ROOT}/boost_${VER} boost + +cd ${ROOT}/boost + +# Compile b2 tool +./bootstrap.sh + +cd ${ROOT} diff --git a/dependencies/db/build.sh b/dependencies/db/build.sh new file mode 100755 index 0000000..ed83ace --- /dev/null +++ b/dependencies/db/build.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +TARGET_CPU=$1 +TARGET_OS=$2 +ROOT=$(pwd) +MUTEX="x86_64/gcc-assembly" + +if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then +echo "Platform ${TARGET_CPU} is not supported" +echo "Expected either aarch64 or x86_64." +exit 1 +fi + +if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then +echo "Operation sysrem ${TARGET_OS} is not supported" +echo "Expected either w64-mingw32 or linux-gnu." +exit 1 +fi + +# Cross-building prefix +CROSS=${TARGET_CPU}-${TARGET_OS} + +if [[ ! $(which ${CROSS}-gcc) ]]; then +echo "Target C compiler ${CROSS}-gcc is not found" +exit 1 +fi + +if [[ ! $(which ${CROSS}-g++) ]]; then +echo "Target C++ compiler ${CROSS}-g++ is not found" +exit 1 +fi + +if [[ ! $(which make) ]]; then +echo "make is not installed, please install buld-essential package" +exit 1 +fi + +if [ "${TARGET_CPU}" == "aarch64" ]; then +MUTEX="ARM64/gcc-assembly" +fi + +if [ "${TARGET_OS}" == "w64-mingw32" ]; then +MINGW32_PARAMS="--enable-mingw" +fi + +# Make build directories +mkdir ${ROOT}/${CROSS}-build + +# Stage directory +mkdir ${ROOT}/${CROSS} + +# Compile BerkeleyDB + +cd ${ROOT}/${CROSS}-build +export CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2" +export CXXFLAGS=${CFLAGS} +export LDFLAGS="-fstack-protector-all" +${ROOT}/libdb/dist/configure --prefix=${ROOT}/${CROSS} --enable-smallbuild --enable-cxx --disable-shared --disable-replication --with-mutex=${MUTEX} ${MINGW32_PARAMS} --host=${CROSS} +make -j 4 library_build +make library_install + +# Remove build directore +cd ${ROOT} +rm -rf ${ROOT}/${CROSS}-build diff --git a/dependencies/db/setup.sh b/dependencies/db/setup.sh new file mode 100755 index 0000000..007c536 --- /dev/null +++ b/dependencies/db/setup.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +if [[ ! $(which wget) ]]; then + echo "wget is not installed" + exit -1 +fi + +if [[ ! $(which tar) ]]; then + echo "tar is not installed" + exit -1 +fi + +if [[ ! $(which sed) ]]; then + echo "sed is not installed" + exit -1 +fi + +wget https://fossies.org/linux/misc/db-18.1.40.tar.gz +tar -xzf db-18.1.40.tar.gz +mv db-18.1.40 libdb +sed -i "s/WinIoCtl.h/winioctl.h/g" libdb/src/dbinc/win_db.h diff --git a/dependencies/openssl/build.sh b/dependencies/openssl/build.sh new file mode 100755 index 0000000..26fb4a8 --- /dev/null +++ b/dependencies/openssl/build.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +TARGET_CPU=$1 +TARGET_OS=$2 +ROOT=$(pwd) + +if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then +echo "Platform ${TARGET_CPU} is not supported" +echo "Expected either aarch64 or x86_64." +exit 1 +fi + +if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then +echo "Operation sysrem ${TARGET_OS} is not supported" +echo "Expected either w64-mingw32 or linux-gnu." +exit 1 +fi + +# Cross-building prefix +CROSS=${TARGET_CPU}-${TARGET_OS} + +if [[ ! $(which ${CROSS}-gcc) ]]; then +echo "Target C compiler ${CROSS}-gcc is not found" +exit 1 +fi + +if [[ ! $(which ${CROSS}-g++) ]]; then +echo "Target C++ compiler ${CROSS}-g++ is not found" +exit 1 +fi + +if [[ ! $(which make) ]]; then +echo "make is not installed, please install buld-essential package" +exit 1 +fi + +if [ "${TARGET_CPU}" == "aarch64" ]; then +MUTEX="ARM64/gcc-assembly" +fi + +if [ "${TARGET_OS}" == "w64-mingw32" ]; then +TARGET_PARAMS="mingw64" +else +TARGET_PARAMS="linux-generic64" +fi + +# Make build directories +mkdir ${ROOT}/${CROSS}-build + +# Stage directory +mkdir ${ROOT}/${CROSS} + +# Compile BerkeleyDB + +cd ${ROOT}/${CROSS}-build +export CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2" +export LDFLAGS="-fstack-protector-all" +${ROOT}/openssl/Configure --cross-compile-prefix=${CROSS}- --prefix=${ROOT}/${CROSS} no-shared no-asm ${TARGET_PARAMS} --api=1.1.1 +make -j 4 build_libs +make install_dev + +# Create symlink for compatibility +cd ${ROOT}/${CROSS} +if [[ -d lib64 ]]; then + ln -s lib64 lib +fi + +# Remove build directore +cd ${ROOT} +rm -rf ${ROOT}/${CROSS}-build diff --git a/dependencies/openssl/setup.sh b/dependencies/openssl/setup.sh new file mode 100755 index 0000000..7847a1a --- /dev/null +++ b/dependencies/openssl/setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [[ ! $(which git) ]]; then + echo "git is not installed" + exit -1 +fi + +git clone -b openssl-3.0 https://github.com/openssl/openssl diff --git a/dependencies/qt/build.sh b/dependencies/qt/build.sh new file mode 100755 index 0000000..7ab0019 --- /dev/null +++ b/dependencies/qt/build.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +TARGET_CPU=$1 +TARGET_OS=$2 +ROOT=$(pwd) + +if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then +echo "Platform ${TARGET_CPU} is not supported" +echo "Expected either aarch64 or x86_64." +exit 1 +fi + +if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then +echo "Operation sysrem ${TARGET_OS} is not supported" +echo "Expected either w64-mingw32 or linux-gnu." +exit 1 +fi + +# Cross-building prefix +CROSS=${TARGET_CPU}-${TARGET_OS} + +if [[ ! $(which ${CROSS}-gcc) ]]; then +echo "Target C compiler ${CROSS}-gcc is not found" +exit 1 +fi + +if [[ ! $(which ${CROSS}-g++) ]]; then +echo "Target C++ compiler ${CROSS}-g++ is not found" +exit 1 +fi + +if [[ ! $(which make) ]]; then +echo "make is not installed, please install buld-essential package" +exit 1 +fi + +if [ "${TARGET_OS}" == "w64-mingw32" ]; then + TARGET_PARAMS="win32-clang-g++ -no-freetype" +else + if [ "${TARGET_CPU}" == "aarch64" ]; then + TARGET_PARAMS="linux-aarch64-gnu-g++" + else + TARGET_PARAMS="linux-g++-64" + fi +fi + +# Make build directories +mkdir ${ROOT}/${CROSS}-build +mkdir ${ROOT}/${CROSS}-build-qttools +mkdir ${ROOT}/${CROSS}-build-qttranslations +mkdir ${ROOT}/${CROSS}-build-qtdeclarative + +# Stage directory +mkdir ${ROOT}/${CROSS} + +# Compile Qt + +cd ${ROOT}/${CROSS}-build +export CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2" +export CXXFLAGS=${CFLAGS} +export LDFLAGS="-fstack-protector-all" +${ROOT}/qtbase/configure -xplatform ${TARGET_PARAMS} --hostprefix=${ROOT}/${CROSS} --prefix=${ROOT}/${CROSS} -device-option CROSS_COMPILE=${CROSS}- -release -confirm-license -no-compile-examples -no-cups -no-egl -no-eglfs -no-evdev -no-icu -no-iconv -no-libproxy -no-openssl -no-reduce-relocations -no-schannel -no-sctp -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-system-proxies -no-use-gold-linker -no-zstd -nomake examples -nomake tests -nomake tools -opensource -qt-libpng -qt-pcre -qt-zlib -static -no-feature-bearermanagement -no-feature-colordialog -no-feature-concurrent -no-feature-dial -no-feature-ftp -no-feature-http -no-feature-image_heuristic_mask -no-feature-keysequenceedit -no-feature-lcdnumber -no-feature-networkdiskcache -no-feature-networkproxy -no-feature-pdf -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sessionmanager -no-feature-socks5 -no-feature-sql -no-feature-sqlmodel -no-feature-statemachine -no-feature-syntaxhighlighter -no-feature-textbrowser -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-topleveldomain -no-feature-udpsocket -no-feature-undocommand -no-feature-undogroup -no-feature-undostack -no-feature-undoview -no-feature-vnc -no-feature-xml -no-dbus -no-opengl +make -j 4 +make install +cd ${ROOT} +rm -rf ${ROOT}/${CROSS}-build + +# Compile Qt tools + +cd ${ROOT}/${CROSS}-build-qttools +${ROOT}/${CROSS}/bin/qmake ${ROOT}/qttools +make -j 4 +make DESTDIR=${ROOT}/${CROSS} install +cd ${ROOT} +rm -rf ${ROOT}/${CROSS}-build-qttools + +# Compile translations + +cd ${ROOT}/${CROSS}-build-qttranslations +${ROOT}/${CROSS}/bin/qmake ${ROOT}/qttranslations +make -j 4 +make DESTDIR=${ROOT}/${CROSS} install +cd ${ROOT} +rm -rf ${ROOT}/${CROSS}-build-qttranslations + +# Compile qtdeclarative + +cd ${ROOT}/${CROSS}-build-qtdeclarative +${ROOT}/${CROSS}/bin/qmake ${ROOT}/qtdeclarative +make -j 4 +make DESTDIR=${ROOT}/${CROSS} install +cd ${ROOT} +rm -rf ${ROOT}/${CROSS}-build-qtdeclarative diff --git a/dependencies/qt/setup.sh b/dependencies/qt/setup.sh new file mode 100755 index 0000000..0e3b6a9 --- /dev/null +++ b/dependencies/qt/setup.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +ROOT=$(pwd) + +if [[ ! $(which git) ]]; then + echo "git is not installed" + exit -1 +fi + +git clone -b 5.15.2 https://github.com/qt/qtbase.git ${ROOT}/qtbase +git clone -b 5.15.2 https://github.com/qt/qttools.git ${ROOT}/qttools +git clone -b 5.15.2 https://github.com/qt/qttranslations.git ${ROOT}/qttranslations +git clone -b 5.15.2 https://github.com/qt/qtdeclarative.git ${ROOT}/qtdeclarative + +cd ${ROOT}/qtbase +patch -s -p1 < ${ROOT}/stack_protector.patch +cd ${ROOT} diff --git a/dependencies/qt/stack_protector.patch b/dependencies/qt/stack_protector.patch new file mode 100644 index 0000000..22ad1d6 --- /dev/null +++ b/dependencies/qt/stack_protector.patch @@ -0,0 +1,25 @@ +diff --git a/mkspecs/win32-clang-g++/qmake.conf b/mkspecs/win32-clang-g++/qmake.conf +index 59d42176f0..d9eaad4637 100644 +--- a/mkspecs/win32-clang-g++/qmake.conf ++++ b/mkspecs/win32-clang-g++/qmake.conf +@@ -14,11 +14,11 @@ include(../common/g++-win32.conf) + QMAKE_COMPILER += clang llvm # clang pretends to be gcc + + QMAKE_CC = $${CROSS_COMPILE}clang +-QMAKE_CFLAGS += ++QMAKE_CFLAGS += -fstack-protector-all -D_FORTIFY_SOURCE=2 + QMAKE_CFLAGS_WARN_ON += -Wextra -Wno-ignored-attributes + + QMAKE_CXX = $${CROSS_COMPILE}clang++ +-QMAKE_CXXFLAGS += ++QMAKE_CXXFLAGS += -fstack-protector-all -D_FORTIFY_SOURCE=2 + QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON + + QMAKE_LINK = $${CROSS_COMPILE}clang++ +@@ -32,4 +32,6 @@ QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG + + QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz + ++QMAKE_LFLAGS += -fstack-protector-strong -lssp ++ + load(qt_config) diff --git a/dependencies/zlib/build.sh b/dependencies/zlib/build.sh new file mode 100755 index 0000000..7ea071e --- /dev/null +++ b/dependencies/zlib/build.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +TARGET_CPU=$1 +TARGET_OS=$2 +ROOT=$(pwd) + +if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then +echo "Platform ${TARGET_CPU} is not supported" +echo "Expected either aarch64 or x86_64." +exit 1 +fi + +if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then +echo "Operation sysrem ${TARGET_OS} is not supported" +echo "Expected either w64-mingw32 or linux-gnu." +exit 1 +fi + +# Cross-building prefix +CROSS=${TARGET_CPU}-${TARGET_OS} + +if [[ ! $(which ${CROSS}-gcc) ]]; then +echo "Target C compiler ${CROSS}-gcc is not found" +exit 1 +fi + +if [[ ! $(which ${CROSS}-g++) ]]; then +echo "Target C++ compiler ${CROSS}-g++ is not found" +exit 1 +fi + +if [[ ! $(which make) ]]; then +echo "make is not installed, please install buld-essential package" +exit 1 +fi + +if [ "${TARGET_CPU}" == "aarch64" ]; then +MUTEX="ARM64/gcc-assembly" +fi + +# Make build directoriy +cp -r ${ROOT}/zlib ${ROOT}/${CROSS}-build-zlib + +# Stage directory +mkdir ${ROOT}/${CROSS} + +# Compile zlib +cd ${ROOT}/${CROSS}-build-zlib +export CC=${CROSS}-gcc +export CXX=${CROSS}-g++ +export LD=${CROSS}-ld +export RANLIB=${CROSS}-ranlib +export CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2" +export CXXFLAGS=${CFLAGS} +export LDFLAGS="-fstack-protector-all" +${ROOT}/zlib/configure --prefix=${ROOT}/${CROSS} --static +make -j 4 + +# Install zlib to our cross-tools directory +make install + +# Remove build directory +cd ${ROOT} +rm -rf ${ROOT}/${CROSS}-build-zlib diff --git a/dependencies/zlib/setup.sh b/dependencies/zlib/setup.sh new file mode 100755 index 0000000..9401da7 --- /dev/null +++ b/dependencies/zlib/setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [[ ! $(which git) ]]; then + echo "git is not installed" + exit -1 +fi + +git clone https://github.com/madler/zlib diff --git a/mingw64_deps/README.md b/mingw64_deps/README.md deleted file mode 100644 index 08f9eec..0000000 --- a/mingw64_deps/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Cross-build dependencies for Windows x86-64 and Windows ARM64 - -## Requirements - -Please use llvm-mingw compiler which can be downloaded here: - - https://github.com/mstorsjo/llvm-mingw/releases - -You will also need to install CMake 3.20 or newer to compile Qt libraries. Simplest way to do this is to use python repositories: - - sudo apt install python3-pip - pip3 install cmake - -Unpack compiler binaries to suitable directory (/opt is preferred) and ensure that its /bin subdirectory is mentioned in your PATH. You will also need to add /home/user/.local/bin to PATH as well. - -## Setting up - - Every subdirectory contains a setup.sh script which can be used to download source code and create source trees. - -## Building - - Just execute ./build.sh script for corresponding dependency using either x86_64 or aarch64 as argument. It will build binaries automatically. diff --git a/mingw64_deps/boost/build.sh b/mingw64_deps/boost/build.sh deleted file mode 100755 index 10e1e4c..0000000 --- a/mingw64_deps/boost/build.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -TARGET_CPU=$1 -TARGET_OS=$2 -ROOT=$(pwd) - -if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then -echo "Platform ${TARGET_CPU} is not supported" -echo "Expected either aarch64 or x86_64." -exit 1 -fi - -if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then -echo "Operation sysrem ${TARGET_OS} is not supported" -echo "Expected either w64-mingw32 or linux-gnu." -exit 1 -fi - -# Cross-building prefix -CROSS=${TARGET_CPU}-${TARGET_OS} - -if [[ ! $(which ${CROSS}-gcc) ]]; then -echo "Target C compiler ${CROSS}-gcc is not found" -exit 1 -fi - -if [[ ! $(which ${CROSS}-g++) ]]; then -echo "Target C++ compiler ${CROSS}-g++ is not found" -exit 1 -fi - -if [ "${TARGET_OS}" == "w64-mingw32" ]; then -MINGW32_PARAMS="target-os=windows" -fi - -# Create stage directory -mkdir ${ROOT}/${CROSS} - -cd ${ROOT}/boost - -# Create compiler settings -echo "using gcc : : ${CROSS}-g++ ;" > user-config-${CROSS}.jam - -# Build boost -./b2 --user-config=user-config-${CROSS}.jam cxxflags="-fstack-protector-strong -D_FORTIFY_SOURCE=2" linkflags=-fstack-protector-strong --build-type=minimal --layout=system --with-chrono --with-filesystem --with-program_options --with-system --with-thread ${MINGW32_PARAMS} address-model=64 variant=release link=static threading=multi runtime-link=static stage --prefix=${ROOT}/${CROSS} install - -cd ${ROOT} - -# Remove build directories -rm -rf ${ROOT}/boost/stage ${ROOT}/boost/bin.v2 ${ROOT}/boost/user-config-${CROSS}.jam diff --git a/mingw64_deps/boost/setup.sh b/mingw64_deps/boost/setup.sh deleted file mode 100755 index 8a35c2e..0000000 --- a/mingw64_deps/boost/setup.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -if [[ ! $(which wget) ]]; then - echo "wget is not installed" - exit -1 -fi - -ROOT=$(pwd) -VER=1_78_0 - -wget -O ${ROOT}/boost_${VER}.tar.gz https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_${VER}.tar.gz -tar -xzf ${ROOT}/boost_${VER}.tar.gz -mv ${ROOT}/boost_${VER} boost - -cd ${ROOT}/boost - -# Compile b2 tool -./bootstrap.sh - -cd ${ROOT} diff --git a/mingw64_deps/db/build.sh b/mingw64_deps/db/build.sh deleted file mode 100755 index ed83ace..0000000 --- a/mingw64_deps/db/build.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -TARGET_CPU=$1 -TARGET_OS=$2 -ROOT=$(pwd) -MUTEX="x86_64/gcc-assembly" - -if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then -echo "Platform ${TARGET_CPU} is not supported" -echo "Expected either aarch64 or x86_64." -exit 1 -fi - -if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then -echo "Operation sysrem ${TARGET_OS} is not supported" -echo "Expected either w64-mingw32 or linux-gnu." -exit 1 -fi - -# Cross-building prefix -CROSS=${TARGET_CPU}-${TARGET_OS} - -if [[ ! $(which ${CROSS}-gcc) ]]; then -echo "Target C compiler ${CROSS}-gcc is not found" -exit 1 -fi - -if [[ ! $(which ${CROSS}-g++) ]]; then -echo "Target C++ compiler ${CROSS}-g++ is not found" -exit 1 -fi - -if [[ ! $(which make) ]]; then -echo "make is not installed, please install buld-essential package" -exit 1 -fi - -if [ "${TARGET_CPU}" == "aarch64" ]; then -MUTEX="ARM64/gcc-assembly" -fi - -if [ "${TARGET_OS}" == "w64-mingw32" ]; then -MINGW32_PARAMS="--enable-mingw" -fi - -# Make build directories -mkdir ${ROOT}/${CROSS}-build - -# Stage directory -mkdir ${ROOT}/${CROSS} - -# Compile BerkeleyDB - -cd ${ROOT}/${CROSS}-build -export CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2" -export CXXFLAGS=${CFLAGS} -export LDFLAGS="-fstack-protector-all" -${ROOT}/libdb/dist/configure --prefix=${ROOT}/${CROSS} --enable-smallbuild --enable-cxx --disable-shared --disable-replication --with-mutex=${MUTEX} ${MINGW32_PARAMS} --host=${CROSS} -make -j 4 library_build -make library_install - -# Remove build directore -cd ${ROOT} -rm -rf ${ROOT}/${CROSS}-build diff --git a/mingw64_deps/db/setup.sh b/mingw64_deps/db/setup.sh deleted file mode 100755 index 007c536..0000000 --- a/mingw64_deps/db/setup.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -if [[ ! $(which wget) ]]; then - echo "wget is not installed" - exit -1 -fi - -if [[ ! $(which tar) ]]; then - echo "tar is not installed" - exit -1 -fi - -if [[ ! $(which sed) ]]; then - echo "sed is not installed" - exit -1 -fi - -wget https://fossies.org/linux/misc/db-18.1.40.tar.gz -tar -xzf db-18.1.40.tar.gz -mv db-18.1.40 libdb -sed -i "s/WinIoCtl.h/winioctl.h/g" libdb/src/dbinc/win_db.h diff --git a/mingw64_deps/openssl/build.sh b/mingw64_deps/openssl/build.sh deleted file mode 100755 index 26fb4a8..0000000 --- a/mingw64_deps/openssl/build.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -TARGET_CPU=$1 -TARGET_OS=$2 -ROOT=$(pwd) - -if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then -echo "Platform ${TARGET_CPU} is not supported" -echo "Expected either aarch64 or x86_64." -exit 1 -fi - -if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then -echo "Operation sysrem ${TARGET_OS} is not supported" -echo "Expected either w64-mingw32 or linux-gnu." -exit 1 -fi - -# Cross-building prefix -CROSS=${TARGET_CPU}-${TARGET_OS} - -if [[ ! $(which ${CROSS}-gcc) ]]; then -echo "Target C compiler ${CROSS}-gcc is not found" -exit 1 -fi - -if [[ ! $(which ${CROSS}-g++) ]]; then -echo "Target C++ compiler ${CROSS}-g++ is not found" -exit 1 -fi - -if [[ ! $(which make) ]]; then -echo "make is not installed, please install buld-essential package" -exit 1 -fi - -if [ "${TARGET_CPU}" == "aarch64" ]; then -MUTEX="ARM64/gcc-assembly" -fi - -if [ "${TARGET_OS}" == "w64-mingw32" ]; then -TARGET_PARAMS="mingw64" -else -TARGET_PARAMS="linux-generic64" -fi - -# Make build directories -mkdir ${ROOT}/${CROSS}-build - -# Stage directory -mkdir ${ROOT}/${CROSS} - -# Compile BerkeleyDB - -cd ${ROOT}/${CROSS}-build -export CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2" -export LDFLAGS="-fstack-protector-all" -${ROOT}/openssl/Configure --cross-compile-prefix=${CROSS}- --prefix=${ROOT}/${CROSS} no-shared no-asm ${TARGET_PARAMS} --api=1.1.1 -make -j 4 build_libs -make install_dev - -# Create symlink for compatibility -cd ${ROOT}/${CROSS} -if [[ -d lib64 ]]; then - ln -s lib64 lib -fi - -# Remove build directore -cd ${ROOT} -rm -rf ${ROOT}/${CROSS}-build diff --git a/mingw64_deps/openssl/setup.sh b/mingw64_deps/openssl/setup.sh deleted file mode 100755 index 7847a1a..0000000 --- a/mingw64_deps/openssl/setup.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -if [[ ! $(which git) ]]; then - echo "git is not installed" - exit -1 -fi - -git clone -b openssl-3.0 https://github.com/openssl/openssl diff --git a/mingw64_deps/qt/build.sh b/mingw64_deps/qt/build.sh deleted file mode 100755 index 7ab0019..0000000 --- a/mingw64_deps/qt/build.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash - -TARGET_CPU=$1 -TARGET_OS=$2 -ROOT=$(pwd) - -if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then -echo "Platform ${TARGET_CPU} is not supported" -echo "Expected either aarch64 or x86_64." -exit 1 -fi - -if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then -echo "Operation sysrem ${TARGET_OS} is not supported" -echo "Expected either w64-mingw32 or linux-gnu." -exit 1 -fi - -# Cross-building prefix -CROSS=${TARGET_CPU}-${TARGET_OS} - -if [[ ! $(which ${CROSS}-gcc) ]]; then -echo "Target C compiler ${CROSS}-gcc is not found" -exit 1 -fi - -if [[ ! $(which ${CROSS}-g++) ]]; then -echo "Target C++ compiler ${CROSS}-g++ is not found" -exit 1 -fi - -if [[ ! $(which make) ]]; then -echo "make is not installed, please install buld-essential package" -exit 1 -fi - -if [ "${TARGET_OS}" == "w64-mingw32" ]; then - TARGET_PARAMS="win32-clang-g++ -no-freetype" -else - if [ "${TARGET_CPU}" == "aarch64" ]; then - TARGET_PARAMS="linux-aarch64-gnu-g++" - else - TARGET_PARAMS="linux-g++-64" - fi -fi - -# Make build directories -mkdir ${ROOT}/${CROSS}-build -mkdir ${ROOT}/${CROSS}-build-qttools -mkdir ${ROOT}/${CROSS}-build-qttranslations -mkdir ${ROOT}/${CROSS}-build-qtdeclarative - -# Stage directory -mkdir ${ROOT}/${CROSS} - -# Compile Qt - -cd ${ROOT}/${CROSS}-build -export CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2" -export CXXFLAGS=${CFLAGS} -export LDFLAGS="-fstack-protector-all" -${ROOT}/qtbase/configure -xplatform ${TARGET_PARAMS} --hostprefix=${ROOT}/${CROSS} --prefix=${ROOT}/${CROSS} -device-option CROSS_COMPILE=${CROSS}- -release -confirm-license -no-compile-examples -no-cups -no-egl -no-eglfs -no-evdev -no-icu -no-iconv -no-libproxy -no-openssl -no-reduce-relocations -no-schannel -no-sctp -no-sql-db2 -no-sql-ibase -no-sql-oci -no-sql-tds -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-system-proxies -no-use-gold-linker -no-zstd -nomake examples -nomake tests -nomake tools -opensource -qt-libpng -qt-pcre -qt-zlib -static -no-feature-bearermanagement -no-feature-colordialog -no-feature-concurrent -no-feature-dial -no-feature-ftp -no-feature-http -no-feature-image_heuristic_mask -no-feature-keysequenceedit -no-feature-lcdnumber -no-feature-networkdiskcache -no-feature-networkproxy -no-feature-pdf -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sessionmanager -no-feature-socks5 -no-feature-sql -no-feature-sqlmodel -no-feature-statemachine -no-feature-syntaxhighlighter -no-feature-textbrowser -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-topleveldomain -no-feature-udpsocket -no-feature-undocommand -no-feature-undogroup -no-feature-undostack -no-feature-undoview -no-feature-vnc -no-feature-xml -no-dbus -no-opengl -make -j 4 -make install -cd ${ROOT} -rm -rf ${ROOT}/${CROSS}-build - -# Compile Qt tools - -cd ${ROOT}/${CROSS}-build-qttools -${ROOT}/${CROSS}/bin/qmake ${ROOT}/qttools -make -j 4 -make DESTDIR=${ROOT}/${CROSS} install -cd ${ROOT} -rm -rf ${ROOT}/${CROSS}-build-qttools - -# Compile translations - -cd ${ROOT}/${CROSS}-build-qttranslations -${ROOT}/${CROSS}/bin/qmake ${ROOT}/qttranslations -make -j 4 -make DESTDIR=${ROOT}/${CROSS} install -cd ${ROOT} -rm -rf ${ROOT}/${CROSS}-build-qttranslations - -# Compile qtdeclarative - -cd ${ROOT}/${CROSS}-build-qtdeclarative -${ROOT}/${CROSS}/bin/qmake ${ROOT}/qtdeclarative -make -j 4 -make DESTDIR=${ROOT}/${CROSS} install -cd ${ROOT} -rm -rf ${ROOT}/${CROSS}-build-qtdeclarative diff --git a/mingw64_deps/qt/setup.sh b/mingw64_deps/qt/setup.sh deleted file mode 100755 index 0e3b6a9..0000000 --- a/mingw64_deps/qt/setup.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -ROOT=$(pwd) - -if [[ ! $(which git) ]]; then - echo "git is not installed" - exit -1 -fi - -git clone -b 5.15.2 https://github.com/qt/qtbase.git ${ROOT}/qtbase -git clone -b 5.15.2 https://github.com/qt/qttools.git ${ROOT}/qttools -git clone -b 5.15.2 https://github.com/qt/qttranslations.git ${ROOT}/qttranslations -git clone -b 5.15.2 https://github.com/qt/qtdeclarative.git ${ROOT}/qtdeclarative - -cd ${ROOT}/qtbase -patch -s -p1 < ${ROOT}/stack_protector.patch -cd ${ROOT} diff --git a/mingw64_deps/qt/stack_protector.patch b/mingw64_deps/qt/stack_protector.patch deleted file mode 100644 index 22ad1d6..0000000 --- a/mingw64_deps/qt/stack_protector.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/mkspecs/win32-clang-g++/qmake.conf b/mkspecs/win32-clang-g++/qmake.conf -index 59d42176f0..d9eaad4637 100644 ---- a/mkspecs/win32-clang-g++/qmake.conf -+++ b/mkspecs/win32-clang-g++/qmake.conf -@@ -14,11 +14,11 @@ include(../common/g++-win32.conf) - QMAKE_COMPILER += clang llvm # clang pretends to be gcc - - QMAKE_CC = $${CROSS_COMPILE}clang --QMAKE_CFLAGS += -+QMAKE_CFLAGS += -fstack-protector-all -D_FORTIFY_SOURCE=2 - QMAKE_CFLAGS_WARN_ON += -Wextra -Wno-ignored-attributes - - QMAKE_CXX = $${CROSS_COMPILE}clang++ --QMAKE_CXXFLAGS += -+QMAKE_CXXFLAGS += -fstack-protector-all -D_FORTIFY_SOURCE=2 - QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON - - QMAKE_LINK = $${CROSS_COMPILE}clang++ -@@ -32,4 +32,6 @@ QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG - - QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz - -+QMAKE_LFLAGS += -fstack-protector-strong -lssp -+ - load(qt_config) diff --git a/mingw64_deps/zlib/build.sh b/mingw64_deps/zlib/build.sh deleted file mode 100755 index 7ea071e..0000000 --- a/mingw64_deps/zlib/build.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -TARGET_CPU=$1 -TARGET_OS=$2 -ROOT=$(pwd) - -if [[ ! "${TARGET_CPU}" =~ ^(aarch64|x86_64) ]]; then -echo "Platform ${TARGET_CPU} is not supported" -echo "Expected either aarch64 or x86_64." -exit 1 -fi - -if [[ ! "${TARGET_OS}" =~ ^(w64\-mingw32|linux\-gnu) ]]; then -echo "Operation sysrem ${TARGET_OS} is not supported" -echo "Expected either w64-mingw32 or linux-gnu." -exit 1 -fi - -# Cross-building prefix -CROSS=${TARGET_CPU}-${TARGET_OS} - -if [[ ! $(which ${CROSS}-gcc) ]]; then -echo "Target C compiler ${CROSS}-gcc is not found" -exit 1 -fi - -if [[ ! $(which ${CROSS}-g++) ]]; then -echo "Target C++ compiler ${CROSS}-g++ is not found" -exit 1 -fi - -if [[ ! $(which make) ]]; then -echo "make is not installed, please install buld-essential package" -exit 1 -fi - -if [ "${TARGET_CPU}" == "aarch64" ]; then -MUTEX="ARM64/gcc-assembly" -fi - -# Make build directoriy -cp -r ${ROOT}/zlib ${ROOT}/${CROSS}-build-zlib - -# Stage directory -mkdir ${ROOT}/${CROSS} - -# Compile zlib -cd ${ROOT}/${CROSS}-build-zlib -export CC=${CROSS}-gcc -export CXX=${CROSS}-g++ -export LD=${CROSS}-ld -export RANLIB=${CROSS}-ranlib -export CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2" -export CXXFLAGS=${CFLAGS} -export LDFLAGS="-fstack-protector-all" -${ROOT}/zlib/configure --prefix=${ROOT}/${CROSS} --static -make -j 4 - -# Install zlib to our cross-tools directory -make install - -# Remove build directory -cd ${ROOT} -rm -rf ${ROOT}/${CROSS}-build-zlib diff --git a/mingw64_deps/zlib/setup.sh b/mingw64_deps/zlib/setup.sh deleted file mode 100755 index 9401da7..0000000 --- a/mingw64_deps/zlib/setup.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -if [[ ! $(which git) ]]; then - echo "git is not installed" - exit -1 -fi - -git clone https://github.com/madler/zlib -- 1.7.1