vendor: add complete multi-platform support (runtime + dev)

This commit is contained in:
LC mac
2026-01-12 17:18:28 +08:00
parent 5d02205353
commit c380986e26
19 changed files with 75 additions and 39 deletions

View File

@@ -14,9 +14,11 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
case "$ARCH" in
x86_64)
PLATFORM="linux-x86_64"
CHECKSUM_CMD="sha256sum"
;;
aarch64|arm64)
PLATFORM="linux-aarch64"
CHECKSUM_CMD="sha256sum"
;;
*)
echo "ERROR: Unsupported Linux architecture: $ARCH"
@@ -27,6 +29,7 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
ARCH=$(uname -m)
if [[ "$ARCH" == "arm64" ]]; then
PLATFORM="macos-arm64"
CHECKSUM_CMD="shasum -a 256"
else
echo "ERROR: Only macOS ARM64 is supported"
exit 1
@@ -51,21 +54,34 @@ if [ ! -d "$VENDOR_PATH" ]; then
ls -d vendor/*/ 2>/dev/null || echo " (none)"
echo ""
if [ "$DEV_MODE" = true ]; then
echo "To build dev wheels:"
if [[ "$PLATFORM" == "linux-x86_64" ]]; then
echo " make vendor-linux-dev"
elif [[ "$PLATFORM" == "linux-aarch64" ]]; then
echo " make vendor-linux-arm-dev"
fi
echo "To build dev wheels for your platform:"
case "$PLATFORM" in
linux-x86_64)
echo " make vendor-linux-dev"
;;
linux-aarch64)
echo " make vendor-linux-arm-dev"
;;
macos-arm64)
echo " make vendor-macos-dev"
;;
esac
else
echo "To build runtime wheels:"
if [[ "$PLATFORM" == "linux-x86_64" ]]; then
echo " make vendor-linux"
elif [[ "$PLATFORM" == "linux-aarch64" ]]; then
echo " make vendor-linux-arm"
elif [[ "$PLATFORM" == "macos-arm64" ]]; then
echo " make vendor-macos"
fi
echo "To build runtime wheels for your platform:"
case "$PLATFORM" in
linux-x86_64)
echo " make vendor-linux"
;;
linux-aarch64)
echo " make vendor-linux-arm"
;;
macos-arm64)
echo " make vendor-macos"
;;
esac
echo ""
echo "Or build all platforms at once:"
echo " make vendor-all"
fi
exit 1
fi
@@ -105,7 +121,7 @@ fi
if [ -f "$VENDOR_PATH/SHA256SUMS" ]; then
echo ""
echo "Verifying checksums..."
(cd "$VENDOR_PATH" && sha256sum -c SHA256SUMS --quiet) || {
(cd "$VENDOR_PATH" && $CHECKSUM_CMD -c SHA256SUMS --quiet) || {
echo "ERROR: Checksum verification failed!"
exit 1
}