From a12d29ca1f2115b041dc59ab3471816bdef955f9 Mon Sep 17 00:00:00 2001 From: aki Date: Wed, 7 May 2025 12:16:35 +0800 Subject: [PATCH] build(manifest): Another attemp at Skia dependencies and adjusting library linking --- com.aseprite.Aseprite.yaml | 19 ++++++++++--------- skia-deps.patch | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 skia-deps.patch diff --git a/com.aseprite.Aseprite.yaml b/com.aseprite.Aseprite.yaml index 8f9679f..9d98f1e 100644 --- a/com.aseprite.Aseprite.yaml +++ b/com.aseprite.Aseprite.yaml @@ -256,18 +256,17 @@ modules: # -DUSE_SHARED_WEBP=OFF # Unused by Aseprite's CMake - -DUSE_SHARED_FREETYPE=OFF # Bundled static with Skia - -DUSE_SHARED_HARFBUZZ=OFF # Bundled static with Skia - # The following explicit paths were unused by Aseprite's CMake. - # Aseprite likely finds these via Skia's CMake config or other means. + # The following explicit paths are generally handled by FindSkia.cmake when SKIA_DIR is set # - -DWebP_INCLUDE_DIRS=/app/third_party/externals/libwebp/src # - -DWebP_LIBRARIES=/app/lib/libwebp.a # - -DJPEG_INCLUDE_DIRS=/app/third_party/externals/libjpeg-turbo # - -DJPEG_LIBRARIES=/app/lib/libjpeg.a - - -DFreetype_INCLUDE_DIRS=/app/third_party/externals/freetype/include - - -DFreetype_LIBRARIES=/app/lib/libfreetype.a - - -DFreetype_LIBRARY=/app/lib/libfreetype.a - - -DHarfBuzz_INCLUDE_DIRS=/app/third_party/externals/harfbuzz/src - - -DHarfBuzz_LIBRARIES=/app/lib/libharfbuzz.a - - -DHarfBuzz_LIBRARY=/app/lib/libharfbuzz.a + # - -DFreetype_INCLUDE_DIRS=/app/third_party/externals/freetype/include # Handled by FindSkia.cmake via SKIA_DIR + # - -DFreetype_LIBRARIES=/app/lib/libfreetype2.a # Handled by FindSkia.cmake + # - -DFreetype_LIBRARY=/app/lib/libfreetype2.a # Handled by FindSkia.cmake + # - -DHarfBuzz_INCLUDE_DIRS=/app/third_party/externals/harfbuzz/src # Handled by FindSkia.cmake via SKIA_DIR + # - -DHarfBuzz_LIBRARIES=/app/lib/libharfbuzz.a # Handled by FindSkia.cmake + # - -DHarfBuzz_LIBRARY=/app/lib/libharfbuzz.a # Handled by FindSkia.cmake build-commands: # Standard ninja build - ninja @@ -276,7 +275,7 @@ modules: - | echo "Verifying required libraries..." if [ ! -f /app/lib/libskia.a ]; then echo "ERROR: libskia.a missing"; exit 1; fi - if [ ! -f /app/lib/libfreetype.a ]; then echo "ERROR: libfreetype.a missing"; exit 1; fi + if [ ! -f /app/lib/libfreetype2.a ]; then echo "ERROR: libfreetype2.a missing"; exit 1; fi if [ ! -f /app/lib/libharfbuzz.a ]; then echo "ERROR: libharfbuzz.a missing"; exit 1; fi echo "All required libraries present." @@ -286,6 +285,8 @@ modules: # Use the directory copied into the Docker image - type: dir path: /sources/aseprite + - type: patch + path: skia-deps.patch # Install desktop file and icon after build/install post-install: # Install files from the source directory (/sources/aseprite) diff --git a/skia-deps.patch b/skia-deps.patch new file mode 100644 index 0000000..022d626 --- /dev/null +++ b/skia-deps.patch @@ -0,0 +1,17 @@ +--- a/laf/cmake/FindSkia.cmake ++++ b/laf/cmake/FindSkia.cmake +@@ -143,7 +143,10 @@ + ${SKIA_DIR} + ${FREETYPE_INCLUDE_DIRS} + ${HARFBUZZ_INCLUDE_DIRS} +- ${PNG_INCLUDE_DIRS}) +-target_link_libraries(skia INTERFACE ${SKIA_LIBRARIES}) ++ ${PNG_INCLUDE_DIRS} ++ ) ++target_link_libraries(skia INTERFACE ++ ${SKIA_LIBRARIES} ++ ${FREETYPE_LIBRARIES} ++ ${HARFBUZZ_LIBRARIES}) + target_compile_definitions(skia INTERFACE + SK_INTERNAL + SK_GAMMA_SRGB