1
0

fix(manifest): Fix the build process by extracting and installing static libraries from Skia

This commit is contained in:
Jose Daniel G. Percy 2025-05-07 01:48:30 +08:00
parent b0479bfbf4
commit a0506f94a3

View File

@ -91,31 +91,56 @@ modules:
- mkdir -p /app/third_party - mkdir -p /app/third_party
- cp -r third_party/externals /app/third_party/ - cp -r third_party/externals /app/third_party/
# Make symlinks to libraries that Aseprite expects # Extract and install the bundled static libraries that Aseprite needs
- mkdir -p /app/lib/pkgconfig
- | - |
echo "Creating symlinks to libraries embedded in Skia's build..." echo "Extracting and installing static libraries from Skia build..."
# WebP # Look for Freetype
if [ -f out/Release-x64/libwebp.a ]; then
cp out/Release-x64/libwebp.a /app/lib/
ln -sf /app/lib/libwebp.a /app/lib/libwebp.so
fi
# JPEG
if [ -f out/Release-x64/libjpeg.a ]; then
cp out/Release-x64/libjpeg.a /app/lib/
ln -sf /app/lib/libjpeg.a /app/lib/libjpeg-turbo.so
fi
# Freetype
if [ -f out/Release-x64/libfreetype.a ]; then if [ -f out/Release-x64/libfreetype.a ]; then
cp out/Release-x64/libfreetype.a /app/lib/ echo "Installing libfreetype.a from Skia build"
ln -sf /app/lib/libfreetype.a /app/lib/libfreetype.so cp -f out/Release-x64/libfreetype.a /app/lib/
else
echo "libfreetype.a not found in Skia build output, checking third_party..."
find . -name "libfreetype.a" -exec cp -f {} /app/lib/ \; -print || echo "Failed to find libfreetype.a"
fi fi
# Harfbuzz
# Look for Harfbuzz
if [ -f out/Release-x64/libharfbuzz.a ]; then if [ -f out/Release-x64/libharfbuzz.a ]; then
cp out/Release-x64/libharfbuzz.a /app/lib/ echo "Installing libharfbuzz.a from Skia build"
ln -sf /app/lib/libharfbuzz.a /app/lib/libharfbuzz.so cp -f out/Release-x64/libharfbuzz.a /app/lib/
else
echo "libharfbuzz.a not found in Skia build output, checking third_party..."
find . -name "libharfbuzz.a" -exec cp -f {} /app/lib/ \; -print || echo "Failed to find libharfbuzz.a"
fi fi
# Look for WebP
if [ -f out/Release-x64/libwebp.a ]; then
echo "Installing libwebp.a from Skia build"
cp -f out/Release-x64/libwebp.a /app/lib/
else
echo "libwebp.a not found in Skia build output, checking third_party..."
find . -name "libwebp.a" -exec cp -f {} /app/lib/ \; -print || echo "Failed to find libwebp.a"
fi
# Look for JPEG
if [ -f out/Release-x64/libjpeg.a ]; then
echo "Installing libjpeg.a from Skia build"
cp -f out/Release-x64/libjpeg.a /app/lib/
else
echo "libjpeg.a not found in Skia build output, checking third_party..."
find . -name "libjpeg.a" -exec cp -f {} /app/lib/ \; -print || echo "Failed to find libjpeg.a"
fi
# Create symlinks for libraries that might have different names
echo "Creating symlinks for libraries with different names..."
(cd /app/lib && [ -f libjpeg.a ] && ln -sf libjpeg.a libjpeg-turbo.a || true)
# Create a pkgconfig directory to help CMake find our libraries
mkdir -p /app/lib/pkgconfig
# List installed libraries for debugging
echo "Installed static libraries in /app/lib:"
ls -la /app/lib/*.a || true
# Make sure ICU data file exists and is in the right place # Make sure ICU data file exists and is in the right place
- mkdir -p /app/third_party/externals/icu/flutter - mkdir -p /app/third_party/externals/icu/flutter
- | - |
@ -171,7 +196,7 @@ modules:
- -DUSE_SHARED_WEBP=OFF - -DUSE_SHARED_WEBP=OFF
- -DUSE_SHARED_FREETYPE=OFF - -DUSE_SHARED_FREETYPE=OFF
- -DUSE_SHARED_HARFBUZZ=OFF - -DUSE_SHARED_HARFBUZZ=OFF
# Create various directories that Aseprite might search in # Set library locations explicitly to avoid CMake warnings/errors
- -DWEBP_INCLUDE_DIR=/app/third_party/externals/libwebp/src - -DWEBP_INCLUDE_DIR=/app/third_party/externals/libwebp/src
- -DWEBP_LIBRARIES=/app/lib/libwebp.a - -DWEBP_LIBRARIES=/app/lib/libwebp.a
- -DLIBJPEG_TURBO_INCLUDE_DIR=/app/third_party/externals/libjpeg-turbo - -DLIBJPEG_TURBO_INCLUDE_DIR=/app/third_party/externals/libjpeg-turbo
@ -180,6 +205,22 @@ modules:
- -DFREETYPE_LIBRARY=/app/lib/libfreetype.a - -DFREETYPE_LIBRARY=/app/lib/libfreetype.a
- -DHARFBUZZ_INCLUDE_DIR=/app/third_party/externals/harfbuzz/src - -DHARFBUZZ_INCLUDE_DIR=/app/third_party/externals/harfbuzz/src
- -DHARFBUZZ_LIBRARY=/app/lib/libharfbuzz.a - -DHARFBUZZ_LIBRARY=/app/lib/libharfbuzz.a
build-commands:
# Run the standard build from cmake-ninja
- ninja
# Add additional step to copy all Skia's static libraries that might be needed
- |
echo "Verifying libraries are available before install..."
if [ ! -f /app/lib/libfreetype.a ]; then
echo "ERROR: libfreetype.a is missing"
exit 1
fi
if [ ! -f /app/lib/libharfbuzz.a ]; then
echo "ERROR: libharfbuzz.a is missing"
exit 1
fi
# Install the build artifacts using standard ninja install
- DESTDIR=/app ninja install
sources: sources:
# Use the directory copied into the Docker image # Use the directory copied into the Docker image
- type: dir - type: dir