From a9e6798e4100b24fe853d74c1f77f31cc14ee590 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Sun, 10 Nov 2024 23:41:22 +0300 Subject: [PATCH] Minor fixes --- .github/workflows/common_build.yml | 2 +- .github/workflows/installer.yml | 16 +++++----- .github/workflows/setup_environment.yml | 4 +-- buildScripts/github/build_installer.sh | 2 +- .../github/install_installer_Linux.sh | 31 ++++++++++--------- .../github/install_installer_environment.sh | 17 +++++----- .../github/install_installer_macOS.sh | 6 ++-- 7 files changed, 41 insertions(+), 37 deletions(-) diff --git a/.github/workflows/common_build.yml b/.github/workflows/common_build.yml index 6c308863d9..6a03d332b5 100644 --- a/.github/workflows/common_build.yml +++ b/.github/workflows/common_build.yml @@ -192,7 +192,7 @@ jobs: uses: ./.github/workflows/installer.yml with: os: ubuntu-latest - container_name: altlinux/base:latest + container_name: alt:latest artifact_name: ubuntu-latest-installer install-archlinux-installer: diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 8c5bf936a8..62d99cd911 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -29,15 +29,15 @@ jobs: steps: - name: Install dependencies - run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git p7zip curl + run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git-core p7zip curl sudo if: startsWith(inputs.container_name, 'altlinux') == true - name: Install dependencies - run: yum install -y epel-release && yum update -y && yum install -y git-core findutils p7zip + run: yum install -y epel-release && yum update -y && yum install -y git-core findutils p7zip sudo if: startsWith(inputs.container_name, 'rocky') == true - name: Install dependencies - run: pacman -Sy && pacman -S git p7zip --noconfirm + run: pacman -Sy && pacman -S git p7zip sudo --noconfirm if: startsWith(inputs.container_name, 'arch') == true - name: Install dependencies @@ -82,18 +82,18 @@ jobs: - name: Run minimal tests run: | TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) - for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" -b -s 5 "$i" --platform minimal; done + for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" -b -s 5 "$i" --platform minimal; done - name: Run minimal JavaScript interpeter tests run: | TWOD_EXEC_NAME=$(ls -1d "$BIN_DIR"/2D-model* | head -n 1) - for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ - -b -s 5 --direct-script-path "$i".js "$i" --platform minimal; done + for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript \ + -b -s 5 --script-path "$i".js "$i" --platform minimal; done - name: Run minimal Python interpeter tests run: | TRIK_PYTHONPATH_BUNDLE_DIR="$LIB_DIR"/python-runtime export TRIK_PYTHONPATH=.:"${TRIK_PYTHONPATH_BUNDLE_DIR}/base_library.zip:${TRIK_PYTHONPATH_BUNDLE_DIR}/lib-dynload:${TRIK_PYTHONPATH_BUNDLE_DIR}" TWOD_EXEC_NAME=$(ls -1d $BIN_DIR/2D-model* | head -n 1) - for i in $GITHUB_WORKSPACE/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".py \ - -b -s 5 --direct-script-path "$i".py "$i" --platform minimal; done + for i in "$GITHUB_WORKSPACE"/testing_small/*; do "$TWOD_EXEC_NAME" --generate-path "$i".py \ + -b -s 5 --script-path "$i".py "$i" --platform minimal; done diff --git a/.github/workflows/setup_environment.yml b/.github/workflows/setup_environment.yml index baca363bf1..19561a1513 100644 --- a/.github/workflows/setup_environment.yml +++ b/.github/workflows/setup_environment.yml @@ -76,12 +76,12 @@ jobs: steps: - name: Install dependencies - run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git + run: apt-get update && apt-get -y dist-upgrade && apt-get install -y glibc git sudo if: startsWith(inputs.container_name, 'altlinux') == true - name: Install dependencies - run: yum update -y && yum install -y git-core + run: yum update -y && yum install -y git-core sudo if: startsWith(inputs.container_name, 'rocky') == true - name: Configure git diff --git a/buildScripts/github/build_installer.sh b/buildScripts/github/build_installer.sh index 6b359fea98..69eb2bcbab 100755 --- a/buildScripts/github/build_installer.sh +++ b/buildScripts/github/build_installer.sh @@ -8,7 +8,7 @@ case $RUNNER_OS in TSNAME="trik-studio-installer-mac-$BRANCH_NAME.dmg" ;; Linux) - QTIFWBIN=$(find /Qt/Tools -name "bin" | head -n 1) + QTIFWBIN=$(find "$HOME"/Qt/Tools -name "bin" | head -n 1) ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) TSNAME="trik-studio-installer-linux-$BRANCH_NAME-$ID.run" ;; diff --git a/buildScripts/github/install_installer_Linux.sh b/buildScripts/github/install_installer_Linux.sh index 066989f80d..10443f0d11 100755 --- a/buildScripts/github/install_installer_Linux.sh +++ b/buildScripts/github/install_installer_Linux.sh @@ -4,44 +4,47 @@ set -eux ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) if [ "$ID" = "altlinux" ]; then - apt-get update && apt-get install -y libxkbcommon-x11 libX11 fontconfig libxcbutil-icccm \ + sudo apt-get update && sudo apt-get install -y libxkbcommon-x11 libX11 fontconfig libxcbutil-icccm \ libxcbutil-image libdbus libxcbutil-keysyms libxcb-render-util elif [ "$ID" = "ubuntu" ]; then - sudo apt-get update && sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 \ + sudo apt-get update && sudo apt-get install -y --no-install-recommends libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 \ libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-sync1 libxcb-xfixes0 \ libxcb-shape0 libx11-xcb1 libfreetype6 libfontconfig1 libdbus-1-3 elif [ "$ID" = "arch" ]; then - pacman -Sy && pacman -S libxkbcommon-x11 xcb-util-wm xcb-util-image xcb-util-keysyms xcb-util-renderutil fontconfig libx11 --noconfirm + sudo pacman -Sy && sudo pacman -S libxkbcommon-x11 xcb-util-wm xcb-util-image xcb-util-keysyms xcb-util-renderutil fontconfig libx11 --noconfirm elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then - yum update -y && yum install -y libxkbcommon-x11 xcb-util-wm libX11 xcb-util-image \ + sudo yum update -y && sudo yum install -y libxkbcommon-x11 xcb-util-wm libX11 xcb-util-image \ dbus-libs xcb-util-keysyms xcb-util-renderutil fontconfig libX11-xcb fi INSTALLER_NAME="$INSTALLER_NAME.run" chmod +x "$INSTALLER_NAME" -./$INSTALLER_NAME --verbose --script trik_studio_installscript.qs --platform minimal --mco "$CONCURRENCY" +# Default value --- 0 +./"$INSTALLER_NAME" --verbose --script trik_studio_installscript.qs --platform minimal --mco "$CONCURRENCY" PREFIX=/opt if [ "$ID" = "ubuntu" ]; then - PREFIX=$HOME + PREFIX="$HOME" fi -BIN_DIR=$PREFIX/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV -LIB_DIR=$PREFIX/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV -APP_DIR=$PREFIX/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV +BIN_DIR="$PREFIX"/TRIKStudio/bin && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV +LIB_DIR="$PREFIX"/TRIKStudio/lib && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV +APP_DIR="$PREFIX"/TRIKStudio && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV +export QT_PLATFORM_QPA=minimal export LD_LIBRARY_PATH="$LIB_DIR" -"$BIN_DIR"/2D-model --version --platform minimal -"$APP_DIR"/maintenance --version --platform minimal -"$APP_DIR"/trik-studio --version --platform minimal +"$BIN_DIR"/2D-model --version +"$APP_DIR"/maintenance --version +"$APP_DIR"/trik-studio --version "$BIN_DIR"/patcher --version cd "$LIB_DIR" -ls *.so* | xargs ldd | grep -Ev "not found$" | grep so | sed -e '/^[^\t]/ d' | sed -e 's/\t//' \ +# Find dependencies that have not been packaged, but are still in the system +ls -- *.so* | xargs ldd | grep -Ev "not found$" | grep so | sed -e '/^[^\t]/ d' | sed -e 's/\t//' \ | sed -e 's/.*=..//' | sed -e 's/ (0.*)//' | grep -Ev "lib(c|dl|m|pthread|rt)\.so.*" \ | grep -Ev "$LD_LIBRARY_PATH" | grep -Ev "ld|linux-vdso" -ls *.so* | xargs ldd | grep "not found" || exit 0 +ls -- *.so* | xargs ldd | grep "not found" || exit 0 exit 1 diff --git a/buildScripts/github/install_installer_environment.sh b/buildScripts/github/install_installer_environment.sh index 771d696467..87a105cabd 100755 --- a/buildScripts/github/install_installer_environment.sh +++ b/buildScripts/github/install_installer_environment.sh @@ -6,24 +6,25 @@ GCC_VERSION=${GCC_VERSION:-13} TRIK_PYTHON="python3.${TRIK_PYTHON3_VERSION_MINOR}" TRIK_QT_VERSION=${TRIK_QT_VERSION:-5.15} -yum update -y && yum install -y epel-release -yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ +sudo yum update -y && sudo yum install -y epel-release +sudo yum install --allowerasing -y sudo which libusbx-devel curl wget make gcc-toolset-"$GCC_VERSION"-{gcc-c++,libasan-devel,libubsan-devel,gdb} \ git-core ccache zlib-devel rsync "$TRIK_PYTHON"-{devel,pip,urllib3} mesa-libGL-devel systemd-devel fontconfig p7zip xz time findutils -yum install -y pulseaudio-libs-glib2 qt5-qtbase-gui libwayland-{server,client,cursor} libxkbcommon-x11 +sudo yum install -y pulseaudio-libs-glib2 qt5-qtbase-gui libwayland-{server,client,cursor} libxkbcommon-x11 echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile +"$TRIK_PYTHON" -m venv venv +. ./venv/bin/activate "$TRIK_PYTHON" -m pip install -U pip "$TRIK_PYTHON" -m pip install aqtinstall -"$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O /Qt -m qtscript qtwaylandcompositor --archives qtbase qtmultimedia qtsvg qtscript \ +"$TRIK_PYTHON" -m aqt install-qt linux desktop "$TRIK_QT_VERSION" -O "$HOME"/Qt -m qtscript qtwaylandcompositor --archives qtbase qtmultimedia qtsvg qtscript \ qttools qtserialport qtimageformats icu qtwayland qtdeclarative #libQt5WaylandCompositor.so.5.15: libQt5Quick.so.5 libQt5Qml.so.5 libQt5QmlModels.so.5 -QT_ROOT_DIR=$(ls -1d /Qt/$TRIK_QT_VERSION*/gcc_64 | head -n 1) +QT_ROOT_DIR=$(ls -1d "$HOME"/Qt/$TRIK_QT_VERSION*/gcc_64 | head -n 1) echo "$QT_ROOT_DIR/bin" >> $GITHUB_PATH if [ "$BUILD_INSTALLER" = "true" ]; then - "$TRIK_PYTHON" -m pip install -U pip - "$TRIK_PYTHON" -m pip install aqtinstall - "$TRIK_PYTHON" -m aqt install-tool -O /Qt linux desktop tools_ifw + "$TRIK_PYTHON" -m aqt install-tool -O "$HOME"/Qt linux desktop tools_ifw fi +deactivate diff --git a/buildScripts/github/install_installer_macOS.sh b/buildScripts/github/install_installer_macOS.sh index 14ce26917b..da18720fb1 100755 --- a/buildScripts/github/install_installer_macOS.sh +++ b/buildScripts/github/install_installer_macOS.sh @@ -1,16 +1,16 @@ #!/bin/bash -set -euxo pipefail +set -eux sudo hdiutil attach "$INSTALLER_EXT_NAME" sudo cp -rf "/Volumes/$INSTALLER_NAME/$INSTALLER_NAME.app" $GITHUB_WORKSPACE sudo hdiutil detach /Volumes/"$INSTALLER_NAME" -./$INSTALLER_NAME.app/Contents/MacOS/$INSTALLER_NAME --verbose --script trik_studio_installscript.qs +./"$INSTALLER_NAME".app/Contents/MacOS/$INSTALLER_NAME --verbose --script trik_studio_installscript.qs BIN_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" && echo "BIN_DIR=$BIN_DIR" >> $GITHUB_ENV LIB_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/Lib" && echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV APP_DIR="/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" && echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV -sudo rm -rf $INSTALLER_NAME.app +sudo rm -rf "$INSTALLER_NAME".app ls "/Applications/TRIKStudio/TRIK Studio.app/Contents/MacOS" export DYLD_LIBRARY_PATH="$LIB_DIR" "$BIN_DIR"/2D-model --version