@@ -48,36 +48,57 @@ jobs:
4848 run : |
4949 echo "🔧 Installing BPG (Better Portable Graphics) tools..."
5050
51+ # Create local bin directory for BPG tools
52+ BPG_BIN_DIR="$HOME/.local/bin"
53+ mkdir -p "$BPG_BIN_DIR"
54+
55+ # Add to PATH for this session and future steps
56+ echo "$BPG_BIN_DIR" >> $GITHUB_PATH
57+ export PATH="$BPG_BIN_DIR:$PATH"
58+
5159 # Check if BPG tools are already installed
5260 if command -v bpgenc &> /dev/null && command -v bpgdec &> /dev/null; then
5361 echo "✅ BPG tools already installed"
5462 bpgenc 2>&1 | head -n 3 || true
5563 else
5664 echo "📦 Installing BPG tools from source..."
5765
58- # Install required dependencies
59- sudo apt-get update
60- sudo apt-get install -y build-essential cmake libjpeg-dev libpng-dev libtiff-dev
66+ # Check if build tools are available, skip dependency installation if not root
67+ if ! command -v gcc &> /dev/null || ! command -v make &> /dev/null; then
68+ echo "⚠️ Build tools not available, attempting to continue without installing dependencies..."
69+ echo "🔍 Available compilers:"
70+ which gcc || echo "gcc not found"
71+ which clang || echo "clang not found"
72+ which make || echo "make not found"
73+ fi
6174
6275 # Download and compile BPG
6376 cd /tmp
6477 wget -q https://bellard.org/bpg/bpg-0.9.8.tar.gz
6578 tar xzf bpg-0.9.8.tar.gz
6679 cd bpg-0.9.8
6780
68- # Compile BPG tools
69- make
70-
71- # Install to system
72- sudo cp bpgenc bpgdec /usr/local/bin/
73- sudo chmod +x /usr/local/bin/bpgenc /usr/local/bin/bpgdec
74-
75- # Verify installation
76- if command -v bpgenc &> /dev/null && command -v bpgdec &> /dev/null; then
77- echo "✅ BPG tools installed successfully"
78- bpgenc 2>&1 | head -n 3 || true
81+ # Try to compile BPG tools
82+ echo "🔨 Compiling BPG tools..."
83+ if make; then
84+ echo "✅ BPG compilation successful"
85+
86+ # Install to user bin directory
87+ cp bpgenc bpgdec "$BPG_BIN_DIR/"
88+ chmod +x "$BPG_BIN_DIR/bpgenc" "$BPG_BIN_DIR/bpgdec"
89+
90+ # Verify installation
91+ if command -v bpgenc &> /dev/null && command -v bpgdec &> /dev/null; then
92+ echo "✅ BPG tools installed successfully to $BPG_BIN_DIR"
93+ bpgenc 2>&1 | head -n 3 || true
94+ else
95+ echo "❌ BPG tools installation failed - not found in PATH"
96+ exit 1
97+ fi
7998 else
80- echo "❌ BPG tools installation failed"
99+ echo "❌ BPG compilation failed"
100+ echo "🔍 Checking for required dependencies..."
101+ pkg-config --exists libjpeg libpng libtiff-4 || echo "Some image libraries may be missing"
81102 exit 1
82103 fi
83104 fi
0 commit comments