跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

build-qemu-windows.sh

47 行 · 2.0 KB历史下载
1#!/usr/bin/env bash
2set -euo pipefail
3
4source_dir=$(cygpath -u "$1")
5build_dir=$(cygpath -u "$2")
6output_dir=$(cygpath -u "$3")
7patch_dir=$(cygpath -u "$4")
8
9for patch_file in "$patch_dir"/*.patch; do
10 patch -d "$source_dir" -p1 < "$patch_file"
11done
12mkdir -p "$build_dir" "$output_dir"
13cd "$build_dir"
14"$source_dir/configure" --target-list=x86_64-softmmu --without-default-features \
15 --prefix=C:/CageQemu --bindir=. --datadir=share --with-suffix= \
16 --extra-cflags=-D_WIN32_WINNT=0x0A00 \
17 --enable-whpx --enable-tcg --enable-pixman --enable-slirp --enable-tools \
18 --disable-docs --disable-guest-agent --disable-werror \
19 --disable-debug-info
20ninja -j 6 qemu-system-x86_64.exe qemu-img.exe
21cp qemu-system-x86_64.exe qemu-img.exe "$output_dir/"
22strip "$output_dir"/*.exe
23
24# Copy the DLL dependency closure from this toolchain, using the same versions
25# that were linked into the executables. Windows system DLLs remain system-owned.
26pending=("$output_dir"/*.exe)
27packages=()
28while ((${#pending[@]})); do
29 binary=${pending[0]}
30 pending=("${pending[@]:1}")
31 while read -r dll; do
32 if [[ -f "$MINGW_PREFIX/bin/$dll" && ! -f "$output_dir/$dll" ]]; then
33 cp "$MINGW_PREFIX/bin/$dll" "$output_dir/$dll"
34 packages+=("$(pacman -Qqo "$MINGW_PREFIX/bin/$dll")")
35 pending+=("$output_dir/$dll")
36 fi
37 done < <(objdump -p "$binary" | awk '/DLL Name:/ {print $3}')
38done
39pacman -Q > "$output_dir/build-packages.txt"
40# Keep the exact source package identity with cached binaries. A later runner
41# must not collect the source of whichever library version happens to be installed.
42for package in "${packages[@]}"; do
43 read -r name version < <(pacman -Q "$package")
44 base=$(awk '/^%BASE%$/ {getline; print; exit}' "/var/lib/pacman/local/$name-$version/desc")
45 [[ -n "$base" ]] || { echo "Source package identity missing for $package" >&2; exit 1; }
46 printf '%s %s\n' "$base" "$version"
47done | sort -u > "$output_dir/build-source-packages.txt"