-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2 3
- Loading branch information
Showing
11 changed files
with
218 additions
and
184 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
# 下载文件 | ||
file( | ||
DOWNLOAD | ||
"https://github.com/RealChuan/Qt-App/releases/download/0.0.1/fonts.7z" | ||
"fonts.7z" | ||
STATUS status | ||
SHOW_PROGRESS) | ||
|
||
list(GET status 0 error_code) | ||
list(GET status 1 error_message) | ||
|
||
if(error_code GREATER 0) | ||
message(FATAL_ERROR "Error downloading file: ${error_message}") | ||
endif() | ||
|
||
# 解压文件 | ||
execute_process(COMMAND 7z x fonts.7z -o./fonts RESULT_VARIABLE error_code) | ||
|
||
if(NOT error_code EQUAL 0) | ||
message(FATAL_ERROR "Error extracting file") | ||
endif() | ||
|
||
execute_process(COMMAND rm -f fonts.7z) | ||
|
||
# 列出文件 | ||
file(GLOB_RECURSE files ./fonts/*) | ||
foreach(file IN LISTS files) | ||
message("${file}") | ||
endforeach() |
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
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,28 @@ | ||
#!/bin/bash -ex | ||
|
||
cd "$(dirname "$0")" | ||
cd ../.. | ||
project_dir="$(pwd)" | ||
echo "Current directory: ${project_dir}" | ||
|
||
packet_dir="${project_dir}/packaging/packet" | ||
releases_dir="${project_dir}/packaging/releases" | ||
|
||
sudo chmod -R +x ${packet_dir} | ||
mv -vf "${packet_dir}/fonts" "${packet_dir}/Qt-App.app/Contents/MacOS/" | ||
|
||
macdeployqt "${packet_dir}/Qt-App.app" -always-overwrite | ||
|
||
ls -al "${packet_dir}/Qt-App.app/Contents/Frameworks" | ||
|
||
pip3 install dmgbuild | ||
|
||
cd "${packet_dir}" | ||
dmgbuild -s "${project_dir}/packaging/macos/dmgbuild.py" "Qt-App.app" "Qt-App.dmg" | ||
|
||
# 排除的文件名 | ||
EXCLUDE_FILE="Qt-App.dmg" | ||
find . -maxdepth 1 ! -name "$EXCLUDE_FILE" ! -name "." ! -name ".." -exec rm -rf -- {} + | ||
cd "${project_dir}" | ||
|
||
echo "Deployment macos completed." |
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,59 @@ | ||
#!/bin/bash -ex | ||
|
||
cd "$(dirname "$0")" | ||
cd ../.. | ||
project_dir="$(pwd)" | ||
echo "Current directory: ${project_dir}" | ||
|
||
packet_dir="${project_dir}/packaging/packet" | ||
releases_dir="${project_dir}/packaging/releases" | ||
|
||
sudo chmod -R +x ${packet_dir} | ||
|
||
# 安装linuxdeployqt | ||
sudo add-apt-repository universe | ||
sudo apt update | ||
sudo apt install -y libfuse2 libxcb-cursor0 | ||
wget -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" \ | ||
-O /usr/local/bin/linuxdeployqt | ||
sudo chmod +x /usr/local/bin/linuxdeployqt | ||
|
||
cp -vf "${project_dir}/packaging/ubuntu/Qt-App.desktop" ${packet_dir}/ | ||
cp -vf "${project_dir}/src/resource/icon/app.png" ${packet_dir}/ | ||
|
||
plugins="${packet_dir}/plugins" | ||
if [ -d "${plugins}" ]; then | ||
cp -vf "${plugins}"/* ${packet_dir}/ | ||
fi | ||
|
||
# 删除测试文件 | ||
rm -rf "${packet_dir}/examples" | ||
rm -f "${packet_dir}"/*Test* | ||
|
||
export LD_LIBRARY_PATH=${packet_dir}:${packet_dir}/lib:$LD_LIBRARY_PATH | ||
|
||
# 使用linuxdeployqt部署 | ||
cd "${packet_dir}" | ||
so_files=$(find . -maxdepth 1 -name "*.so" -printf '%P\n') | ||
for so_file in ${so_files}; do | ||
linuxdeployqt ${so_file} \ | ||
-qmake=qmake \ | ||
-always-overwrite \ | ||
-unsupported-allow-new-glibc || true | ||
done | ||
|
||
# 删除插件 | ||
rm -f "${packet_dir}"/*plugin*.so | ||
rm -f "${packet_dir}"/AppRun | ||
mv -vf "${packet_dir}/"*.so "${packet_dir}/lib" | ||
|
||
linuxdeployqt ${packet_dir}/Qt-App \ | ||
-executable=${packet_dir}/CrashReport \ | ||
-qmake=qmake \ | ||
-always-overwrite \ | ||
-unsupported-allow-new-glibc \ | ||
-appimage || true | ||
sudo chmod +x *.AppImage | ||
cd "${project_dir}" | ||
|
||
echo "Deployment ubuntu completed." |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.