-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
252 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,52 @@ | ||
#!/bin/bash | ||
|
||
sudo apt install -y lsb-release | ||
|
||
target_arch="$1" | ||
root_path="$(pwd)" | ||
sysroot_path="${root_path}/sysroot" | ||
sysroot_ubuntu_version="$(lsb_release -rs).1" | ||
sysroot_ubuntu_codename="$(lsb_release -cs)" | ||
cross_prefix="${root_path}/qt-cross" | ||
toolchain_config="${root_path}/.ci/qt6-toolchain.cmake" | ||
|
||
case "$target_arch" in | ||
aarch64) | ||
toolchain_prefix="aarch64-linux-gnu-" | ||
echo "APPIMAGE_ARCH=aarch64" >> "${GITHUB_ENV}" | ||
;; | ||
armv7) | ||
toolchain_prefix="arm-linux-gnueabihf-" | ||
echo "APPIMAGE_ARCH=armhf" >> "${GITHUB_ENV}" | ||
target_arch_name="armv8-a" | ||
target_arch_debian_name="arm64" | ||
toolchain_name="aarch64-linux-gnu" | ||
target_platform="linux-aarch64-gnu-g++" | ||
;; | ||
esac | ||
|
||
echo "$(pwd)/qt-cross/bin:$(pwd)/qt-host/libexec" >> $GITHUB_PATH | ||
echo "LD_LIBRARY_PATH=$(pwd)/qt-cross/lib:$(pwd)/qt-host/lib" >> "${GITHUB_ENV}" | ||
.ci/install-cross-compiler.sh "$target_arch" | ||
.ci/qt6-dependencies.sh | ||
if [[ "$target_arch" == "armv7" ]]; then | ||
echo "QMAKE_CC=arm-linux-gnueabihf-gcc | ||
QMAKE_CXX=arm-linux-gnueabihf-g++ | ||
QMAKE_LINK=arm-linux-gnueabihf-g++ | ||
QMAKE_LINK_SHLIB=arm-linux-gnueabihf-g++ | ||
QMAKE_AR=arm-linux-gnueabihf-ar cqs | ||
QMAKE_OBJCOPY=arm-linux-gnueabihf-objcopy | ||
QMAKE_NM=arm-linux-gnueabihf-nm -P | ||
QMAKE_STRIP=arm-linux-gnueabihf-strip" >> .qmake.conf | ||
fi | ||
|
||
# Prepare cross-tools for linuxdeploy | ||
sudo cp /usr/bin/${toolchain_prefix}strip strip | ||
sudo mv /usr/bin/ldd /usr/bin/ldd-amd64 | ||
sudo cp .ci/bin/xldd /usr/bin/${toolchain_prefix}ldd | ||
sudo ln -s /usr/bin/${toolchain_prefix}ldd /usr/bin/ldd | ||
echo "CT_XLDD_ROOT=$(pwd)/sysroot" >> "${GITHUB_ENV}" | ||
toolchain_prefix="${toolchain_name}-" | ||
|
||
echo "Target architecture: ${target_arch} (${target_arch_name})" | ||
|
||
# Install dependencies | ||
${root_path}/.ci/install_cross_compiler.sh "${target_arch}" || exit 1 | ||
sudo apt install -y qemu-user-static || exit 1 | ||
|
||
# Prepare sysroot | ||
echo "Preparing sysroot..." | ||
curl "https://cdimage.ubuntu.com/ubuntu-base/releases/${sysroot_ubuntu_codename}/release/ubuntu-base-${sysroot_ubuntu_version}-base-${target_arch_debian_name}.tar.gz" > ./ubuntu-base.tar.gz || exit 1 | ||
mkdir -p "$sysroot_path" | ||
sudo tar -xvzf ubuntu-base.tar.gz -C "$sysroot_path" || exit 1 | ||
rm ubuntu-base.tar.gz | ||
sudo update-binfmts --enable qemu-arm || exit 1 | ||
sudo mount -o bind /dev "${sysroot_path}/dev" || exit 1 | ||
sudo cp /etc/resolv.conf "${sysroot_path}/etc" || exit 1 | ||
sudo chmod 1777 "${sysroot_path}/tmp" || exit 1 | ||
sudo cp "${root_path}/.ci/qt6_deps.sh" "${sysroot_path}/" | ||
sudo chroot "$sysroot_path" /bin/bash -c "/qt6_deps.sh" || exit 1 | ||
sudo chroot "$sysroot_path" /bin/bash -c "apt update && apt install -y symlinks libssl-dev && symlinks -rc /" || exit 1 | ||
sudo umount "${sysroot_path}/dev" || exit 1 | ||
|
||
# Prepare environment | ||
echo "BUILD_SYSROOT_PATH=$sysroot_path" >> "$GITHUB_ENV" | ||
echo "BUILD_TOOLCHAIN_NAME=$toolchain_name" >> "$GITHUB_ENV" | ||
echo "BUILD_TOOLCHAIN_PREFIX=$toolchain_prefix" >> "$GITHUB_ENV" | ||
echo "BUILD_TOOLCHAIN_CONFIG=$toolchain_config" >> "$GITHUB_ENV" | ||
echo "BUILD_ARCH_NAME=$target_arch_name" >> "$GITHUB_ENV" | ||
echo "BUILD_PLATFORM=$target_platform" >> "$GITHUB_ENV" | ||
echo "QT_ROOT_DIR=$cross_prefix" >> "$GITHUB_ENV" |
Oops, something went wrong.