diff --git a/com.aseprite.Aseprite.yaml b/com.aseprite.Aseprite.yaml index b1adf33..851b236 100644 --- a/com.aseprite.Aseprite.yaml +++ b/com.aseprite.Aseprite.yaml @@ -91,30 +91,55 @@ modules: - mkdir -p /app/third_party - cp -r third_party/externals /app/third_party/ - # Make symlinks to libraries that Aseprite expects - - mkdir -p /app/lib/pkgconfig + # Extract and install the bundled static libraries that Aseprite needs - | - echo "Creating symlinks to libraries embedded in Skia's build..." - # WebP - 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 + echo "Extracting and installing static libraries from Skia build..." + # Look for Freetype if [ -f out/Release-x64/libfreetype.a ]; then - cp out/Release-x64/libfreetype.a /app/lib/ - ln -sf /app/lib/libfreetype.a /app/lib/libfreetype.so + echo "Installing libfreetype.a from Skia build" + 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 - # Harfbuzz + + # Look for Harfbuzz if [ -f out/Release-x64/libharfbuzz.a ]; then - cp out/Release-x64/libharfbuzz.a /app/lib/ - ln -sf /app/lib/libharfbuzz.a /app/lib/libharfbuzz.so + echo "Installing libharfbuzz.a from Skia build" + 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 + + # 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 - mkdir -p /app/third_party/externals/icu/flutter @@ -171,7 +196,7 @@ modules: - -DUSE_SHARED_WEBP=OFF - -DUSE_SHARED_FREETYPE=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_LIBRARIES=/app/lib/libwebp.a - -DLIBJPEG_TURBO_INCLUDE_DIR=/app/third_party/externals/libjpeg-turbo @@ -180,6 +205,22 @@ modules: - -DFREETYPE_LIBRARY=/app/lib/libfreetype.a - -DHARFBUZZ_INCLUDE_DIR=/app/third_party/externals/harfbuzz/src - -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: # Use the directory copied into the Docker image - type: dir