-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swith QtIFW to 3.2 for Linux and make common crypts for multiple plat…
…forms
- Loading branch information
Showing
16 changed files
with
243 additions
and
240 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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
TRIK_PYTHON=python3.${TRIK_PYTHON3_VERSION_MINOR} | ||
|
||
install_qt(){ | ||
# Usage: install_qt <os> <platform-type> <qt-version> <path-to-install-qt> <modules> <archives> | ||
# TODO: add <addittional-options> | ||
"$TRIK_PYTHON" -m venv venv | ||
. ./venv/bin/activate | ||
"$TRIK_PYTHON" -m pip install -U pip | ||
"$TRIK_PYTHON" -m pip install aqtinstall | ||
if [ -z "${6+x}" ]; then | ||
"$TRIK_PYTHON" -m aqt install-qt "$1" "$2" "$3" -O "$4" -m "${modules[@]}" | ||
else | ||
"$TRIK_PYTHON" -m aqt install-qt "$1" "$2" "$3" -O "$4" -m "${modules[@]}" --archives "${archives[@]}" | ||
fi | ||
if [ "$BUILD_INSTALLER" = "true" ]; then | ||
[ -d $HOME/qtifw ] || env TRIK_QTIFW_INSTALL_DIR="$HOME/qtifw" "$(dirname $(realpath ${BASH_SOURCE[0]}))"/install_qtifw.sh | ||
fi | ||
deactivate | ||
} | ||
|
||
case "`uname`" in | ||
Darwin) | ||
export HOMEBREW_NO_INSTALL_CLEANUP=1 | ||
export HOMEBREW_NO_AUTO_UPDATE=1 | ||
brew tap "hudochenkov/sshpass" | ||
TRIK_BREW_PACKAGES="ccache coreutils libusb pkg-config gnu-sed sshpass p7zip python@3.${TRIK_PYTHON3_VERSION_MINOR}" | ||
for pkg in $TRIK_BREW_PACKAGES ; do | ||
p="${pkg##*/}" | ||
p="${p%.*}" | ||
brew install --quiet "$pkg" || brew upgrade "$pkg" || brew link --force "$pkg" || echo "Failed to install/upgrade $pkg" | ||
done | ||
modules=("qtscript") | ||
install_qt mac desktop "${TRIK_QT_VERSION}" "$HOME/Qt" $modules | ||
sudo xcode-select -s /Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer | ||
xcodebuild -showsdks | ||
xcrun -sdk macosx --show-sdk-path | ||
;; | ||
Linux) | ||
ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) | ||
|
||
if [ "$ID" = "altlinux" ]; then | ||
sudo apt-get update && sudo apt-get install -y gcc-c++ curl xz p7zip-standalone rsync libusb-devel \ | ||
libudev-devel libGL-devel libGLX-mesa python3-dev zlib-devel make ccache python3-module-pip time \ | ||
qt5-multimedia-devel qt5-svg-devel qt5-script-devel qt5-tools qt5-serialport-devel | ||
elif [ "$ID" = "ubuntu" ]; then | ||
sudo apt-get update && sudo apt-get install -y --no-install-recommends ccache curl libusb-1.0-0-dev \ | ||
make qtscript5-dev qttools5-dev-tools qtmultimedia5-dev libqt5serialport5-dev libqt5svg5-dev \ | ||
libudev-dev "$TRIK_PYTHON"-dev qtbase5-private-dev qtwayland5 | ||
elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then | ||
GCC_VERSION=${GCC_VERSION:-13} | ||
sudo yum update -y && sudo yum install -y --setopt=install_weak_deps=False epel-release | ||
sudo yum install --allowerasing -y --setopt=install_weak_deps=False 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 | ||
|
||
#no desire to enumerate all required libraries for QtIFw | ||
# pulseaudio-libs-glib2 to run TS and 2D-model even with `minimal` platform | ||
sudo yum install -y --setopt=install_weak_deps=False pulseaudio-libs-glib2 libxkbcommon-x11 qt5-qtbase-gui libwayland-{server,client,cursor} | ||
|
||
echo $INSTALL_INSTALLER_ENVIRONMENT | ||
if [ "$INSTALL_INSTALLER_ENVIRONMENT" != "true" ]; then | ||
sudo yum install -y --setopt=install_weak_deps=False qt5-qtscript-devel qt5-qttools-devel qt5-qtmultimedia-devel qt5-qtserialport-devel \ | ||
qt5-qtsvg-devel qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtwayland | ||
else | ||
sudo yum install -y --setopt=install_weak_deps=False libX11-xcb libXext libxkbcommon-x11 fontconfig freetype libXrender | ||
#libQt5WaylandCompositor.so.5.15: libQt5Quick.so.5 libQt5Qml.so.5 libQt5QmlModels.so.5 | ||
modules=("qtscript" "qtwaylandcompositor") | ||
archives=("qtbase" "qtmultimedia" "qtsvg" "qtscript" "qttools" "qtserialport" "qtimageformats" "icu" "qtwayland" "qtdeclarative") | ||
install_qt linux desktop "$TRIK_QT_VERSION" "$HOME/Qt" $modules $archives | ||
QT_ROOT_DIR=$(ls -1d "$HOME"/Qt/$TRIK_QT_VERSION*/gcc_64 | head -n 1) | ||
echo "$QT_ROOT_DIR/bin" >> $GITHUB_PATH | ||
fi | ||
echo "source scl_source enable gcc-toolset-$GCC_VERSION" >> ~/.bash_profile | ||
fi | ||
;; | ||
*) exit 1 ;; | ||
esac |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,116 @@ | ||
#!/bin/bash | ||
set -eux | ||
|
||
prepare_environment(){ | ||
case "`uname`" in | ||
Linux) | ||
ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) | ||
if [ "$ID" = "altlinux" ]; then | ||
sudo apt-get update && sudo apt-get install -y fontconfig libdbus libX11 libXrender libXext libxkbcommon-x11 | ||
elif [ "$ID" = "ubuntu" ]; then | ||
sudo apt-get update && sudo apt-get install -y --no-install-recommends fontconfig libdbus-1-3 libx11-xcb1 libxkbcommon-x11-0 | ||
elif [ "$ID" = "arch" ]; then | ||
sudo pacman -Sy && sudo pacman -S fontconfig libx11 libxrender libxext libxkbcommon-x11 --noconfirm | ||
elif [[ "$ID" = "rocky" || "$ID" = '"rocky"' ]]; then | ||
sudo yum install -y --setopt=install_weak_deps=False libX11-xcb libXext libxkbcommon-x11 fontconfig freetype libXrender | ||
fi | ||
return 0 ;; | ||
Darwin) return 0 ;; | ||
MINGW64*) return 0 ;; | ||
*) exit 1 ;; | ||
esac | ||
} | ||
|
||
install_installer(){ | ||
case "`uname`" in | ||
Darwin) | ||
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 | ||
sudo rm -rf "$INSTALLER_NAME".app | ||
return 0 ;; | ||
Linux) | ||
INSTALLER_NAME="$INSTALLER_NAME.run" | ||
chmod +x "$INSTALLER_NAME" | ||
./"$INSTALLER_NAME" --verbose --script trik_studio_installscript.qs --platform minimal | ||
return 0 ;; | ||
MINGW64*) | ||
./"$INSTALLER_NAME" --verbose --script trik_studio_installscript.qs | ||
return 0 ;; | ||
*) exit 1 ;; | ||
esac | ||
} | ||
|
||
prepare_environment_variable_and_check_tools(){ | ||
EXT="" | ||
case "`uname`" in | ||
Darwin) | ||
PREFIX="/Applications" | ||
LIB_DIR="$PREFIX/TRIKStudio/TRIK Studio.app/Contents/Lib" | ||
export DYLD_LIBRARY_PATH="$LIB_DIR" | ||
;; | ||
Linux) | ||
ID=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) | ||
if [[ $ID = ubuntu ]]; then PREFIX="$HOME"; else PREFIX="/opt"; fi | ||
LIB_DIR="$PREFIX/TRIKStudio/lib" | ||
export LD_LIBRARY_PATH="$LIB_DIR" | ||
export QT_QPA_PLATFORM=minimal | ||
;; | ||
MINGW64*) | ||
PREFIX="/C" | ||
LIB_DIR="$PREFIX/TRIKStudio" | ||
export LD_LIBRARY_PATH="LIB_DIR" | ||
EXT=".exe" | ||
;; | ||
*) exit 1 ;; | ||
esac | ||
|
||
APP_DIR="$PREFIX/TRIKStudio" | ||
|
||
TWOD_EXEC_NAME=$(find "$APP_DIR" -name "2D-model$EXT" -print -quit) | ||
PATCHER_NAME=$(find "$APP_DIR" -name "patcher$EXT" -print -quit) | ||
TRIK_STUDIO_NAME=$(find "$APP_DIR" -name "trik-studio$EXT" -print -quit) | ||
MAINTENANCE=$(find "$APP_DIR" -name "maintenance$EXT" -print -quit) | ||
|
||
"$TWOD_EXEC_NAME" --version | ||
"$PATCHER_NAME" --version | ||
"$TRIK_STUDIO_NAME" --version | ||
"$MAINTENANCE" --version | ||
|
||
echo "TWOD_EXEC_NAME=$TWOD_EXEC_NAME" >> $GITHUB_ENV | ||
echo "PATCHER_NAME=$PATCHER_NAME" >> $GITHUB_ENV | ||
echo "LIB_DIR=$LIB_DIR" >> $GITHUB_ENV | ||
echo "APP_DIR=$APP_DIR" >> $GITHUB_ENV | ||
} | ||
|
||
dll_search(){ | ||
cd "$LIB_DIR" | ||
case "`uname`" in | ||
Darwin) | ||
ls -- *.dylib | xargs otool -L | grep "not found" || exit 0 | ||
;; | ||
Linux) | ||
# 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 | ||
;; | ||
MINGW64*) | ||
# Find dependencies that have not been packaged, but are still in the system | ||
ls -- *.dll* | xargs ldd | grep -Ev "not found$" | grep dll | sed -e '/^[^\t]/ d' | sed -e 's/\t//' \ | ||
| sed -e 's/.*=..//' | sed -e 's/ (0.*)//' | grep -Ev "lib(System|SYSTEM)32.*dll" \ | ||
| grep -Ev "$LD_LIBRARY_PATH" | ||
|
||
ls -- *.dll* | xargs ldd | grep "not found" || exit 0 | ||
;; | ||
*) exit 1 ;; | ||
esac | ||
exit 1 | ||
} | ||
|
||
prepare_environment | ||
install_installer | ||
prepare_environment_variable_and_check_tools | ||
dll_search |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.