90 lines
3.1 KiB
Bash
Executable File
90 lines
3.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Download 32-bit ARM compatible libraries with forced architecture
|
|
|
|
set -e
|
|
|
|
echo "======================================="
|
|
echo " 32-BIT ARM LIBRARY DOWNLOADER"
|
|
echo "======================================="
|
|
echo ""
|
|
|
|
# Remove existing 32-bit folder to ensure clean download
|
|
if [ -d "req_libraries_32bit" ]; then
|
|
echo "🗑️ Removing existing req_libraries_32bit for clean download..."
|
|
rm -rf req_libraries_32bit
|
|
fi
|
|
|
|
# Create fresh directory
|
|
mkdir -p req_libraries_32bit
|
|
|
|
echo "📦 Downloading 32-bit ARM compatible packages..."
|
|
echo " Target architecture: linux_armv7l"
|
|
echo ""
|
|
|
|
# Download with explicit 32-bit ARM platform targeting
|
|
|
|
echo "🔄 Downloading with forced 32-bit architecture (armv7l and armhf)..."
|
|
|
|
# Download for armv7l (wheels only)
|
|
pip download -r requirements.txt -d req_libraries_32bit/ \
|
|
--platform linux_armv7l \
|
|
--only-binary=:all: \
|
|
--python-version 311 \
|
|
--abi cp311 || true
|
|
# Download for armhf (wheels only)
|
|
pip download -r requirements.txt -d req_libraries_32bit/ \
|
|
--platform linux_armhf \
|
|
--only-binary=:all: \
|
|
--python-version 311 \
|
|
--abi cp311 || true
|
|
|
|
# Download Pillow as source if wheel is not available
|
|
echo "🔄 Downloading Pillow source distribution for local build..."
|
|
pip download Pillow -d req_libraries_32bit/ --no-binary=:all: || true
|
|
|
|
echo ""
|
|
echo "📊 Download results:"
|
|
WHEEL_COUNT=$(ls req_libraries_32bit/*.whl 2>/dev/null | wc -l || echo "0")
|
|
echo " Wheel files: $WHEEL_COUNT"
|
|
|
|
if [ "$WHEEL_COUNT" -gt 0 ]; then
|
|
echo ""
|
|
echo "🔍 Key 32-bit packages:"
|
|
if ls req_libraries_32bit/bcrypt*.whl >/dev/null 2>&1; then
|
|
BCRYPT_FILE=$(basename $(ls req_libraries_32bit/bcrypt*.whl | head -1))
|
|
echo " 🔐 BCRYPT: $BCRYPT_FILE"
|
|
if [[ "$BCRYPT_FILE" == *"armv7l"* ]]; then
|
|
echo " ✅ Correct 32-bit architecture"
|
|
else
|
|
echo " ⚠️ Architecture unclear"
|
|
fi
|
|
fi
|
|
|
|
if ls req_libraries_32bit/pillow*.whl >/dev/null 2>&1; then
|
|
PILLOW_FILE=$(basename $(ls req_libraries_32bit/pillow*.whl | head -1))
|
|
echo " 🖼️ PILLOW: $PILLOW_FILE"
|
|
if [[ "$PILLOW_FILE" == *"armv7l"* ]]; then
|
|
echo " ✅ Correct 32-bit architecture"
|
|
fi
|
|
elif ls req_libraries_32bit/Pillow-*.tar.gz >/dev/null 2>&1; then
|
|
PILLOW_SRC=$(basename $(ls req_libraries_32bit/Pillow-*.tar.gz | head -1))
|
|
echo " 🖼️ PILLOW source: $PILLOW_SRC"
|
|
echo " ⚠️ No wheel available for 32-bit ARM. Will need to build locally."
|
|
fi
|
|
|
|
echo ""
|
|
echo "✅ 32-bit libraries download completed!"
|
|
echo ""
|
|
echo "📋 Next steps:"
|
|
echo " 1. Copy this folder to your 32-bit Raspberry Pi"
|
|
echo " 2. Run: ./install_32bit.sh"
|
|
echo " 3. If Pillow wheel is missing, run: ./build_pillow_local.sh (see instructions below)"
|
|
else
|
|
echo "❌ No wheel files downloaded"
|
|
echo ""
|
|
echo "💡 Troubleshooting:"
|
|
echo " • Check internet connection"
|
|
echo " • Verify requirements.txt exists"
|
|
echo " • Some packages may not have 32-bit wheels available"
|
|
fi
|