@@ -21,6 +21,7 @@ old_cd=$(pwd)
2121cd " $( dirname " $0 " ) "
2222
2323build_mode=Release
24+ arch=arm64
2425errno=1
2526
2627echo
@@ -33,18 +34,24 @@ while [ $# -gt 0 ]; do
3334 case " $( echo " $1 " | tr ' [:upper:]' ' [:lower:]' ) " in
3435 debug) build_mode=Debug ;;
3536 release) build_mode=Release ;;
37+ arm64|arm) arch=arm64 ;;
38+ x64|x86_64|intel) arch=x64 ;;
3639 esac
3740 shift
3841done
3942
40- echo " [*] arch: arm64 "
43+ echo " [*] arch: $arch "
4144echo " [*] build mode: $build_mode "
4245echo
4346
4447qt_mac_path=" $ENV_QT_PATH /macos"
4548publish_path=" $script_path /../publish/$build_mode "
46- release_path=" $script_path /../output/arm64/$build_mode "
47- src_out_path=" $script_path /../../src/out/$build_mode "
49+ release_path=" $script_path /../output/$arch /$build_mode "
50+ if [ " $arch " = " x64" ]; then
51+ src_out_path=" $script_path /../../src/out/$build_mode -x64"
52+ else
53+ src_out_path=" $script_path /../../src/out/$build_mode "
54+ fi
4855
4956echo " [*] Qt macOS path: $qt_mac_path "
5057echo " [*] publish path: $publish_path "
@@ -84,7 +91,7 @@ resources_dir="$publish_path/QuickDesk.app/Contents/Resources"
8491mkdir -p " $resources_dir "
8592
8693echo " [*] copying host and client..."
87- thirdparty_path=" $script_path /../QuickDesk/3rdparty/quickdesk-remoting/arm64 "
94+ thirdparty_path=" $script_path /../QuickDesk/3rdparty/quickdesk-remoting/$arch "
8895echo " [*] 3rdparty path: $thirdparty_path "
8996mkdir -p " $frameworks_dir "
9097
110117
111118# Copy MCP bridge
112119echo " [*] copying quickdesk-mcp..."
113- mcp_output=" $script_path /../output/arm64 /$build_mode /quickdesk-mcp"
120+ mcp_output=" $script_path /../output/$arch /$build_mode /quickdesk-mcp"
114121if [ -f " $mcp_output " ]; then
115122 cp " $mcp_output " " $frameworks_dir /"
116123 echo " [*] copied quickdesk-mcp from output"
121128
122129# Copy skill-host and built-in skills
123130echo " [*] copying quickdesk-skill-host..."
124- skill_host_output=" $script_path /../output/arm64 /$build_mode /quickdesk-skill-host"
131+ skill_host_output=" $script_path /../output/$arch /$build_mode /quickdesk-skill-host"
125132if [ -f " $skill_host_output " ]; then
126133 cp " $skill_host_output " " $frameworks_dir /"
127134 echo " [*] copied quickdesk-skill-host from output"
@@ -137,7 +144,7 @@ echo "[*] copying built-in skills..."
137144# must be present") and triggers the "app is damaged" Gatekeeper error.
138145# Place it under Contents/Resources/ instead, which is the documented
139146# location for arbitrary application resources.
140- skills_output=" $script_path /../output/arm64 /$build_mode /skills"
147+ skills_output=" $script_path /../output/$arch /$build_mode /skills"
141148if [ -d " $skills_output " ]; then
142149 mkdir -p " $resources_dir /skills"
143150 cp -R " $skills_output /" * " $resources_dir /skills/"
@@ -155,6 +162,16 @@ if [ $? -ne 0 ]; then
155162 exit 1
156163fi
157164
165+ # Fix dylib dependencies that reference build-machine-only paths
166+ rapidocr_dylib=" $publish_path /QuickDesk.app/Contents/Frameworks/libRapidOcrOnnx.dylib"
167+ if [ -f " $rapidocr_dylib " ]; then
168+ bad_dep=$( otool -L " $rapidocr_dylib " | grep " /usr/local/opt/llvm" | awk ' {print $1}' )
169+ if [ -n " $bad_dep " ]; then
170+ echo " [*] fixing libRapidOcrOnnx.dylib: removing build-machine dep ($bad_dep )"
171+ install_name_tool -change " $bad_dep " " /usr/lib/libSystem.B.dylib" " $rapidocr_dylib "
172+ fi
173+ fi
174+
158175echo " [*] cleaning unnecessary Qt dependencies..."
159176
160177plugins_dir=" $publish_path /QuickDesk.app/Contents/PlugIns"
0 commit comments