Add option to use shared libarchive. https://github.com/aseprite/aseprite/issues/1681 https://github.com/aseprite/aseprite/pull/2535 --- aseprite/CMakeLists.txt.orig 2024-08-21 17:10:38.000000000 -0500 +++ aseprite/CMakeLists.txt 2024-08-28 12:36:10.000000000 -0500 @@ -44,2 +44,3 @@ option(USE_SHARED_ZLIB "Use your installed copy of zlib" off) +option(USE_SHARED_LIBARCHIVE "Use your installed copy of libarchive" off) option(USE_SHARED_LIBPNG "Use your installed copy of libpng" off) @@ -214,6 +215,17 @@ endif() include_directories(${ZLIB_INCLUDE_DIRS}) +# libarchive +if(USE_SHARED_LIBARCHIVE) + find_package(LibArchive REQUIRED) +else() + set(LibArchive_FOUND) + set(LibArchive_LIBRARIES archive_static) + set(LibArchive_INCLUDE_DIRS $) + add_definitions(-DLIBARCHIVE_STATIC) +endif() +include_directories(${LibArchive_INCLUDE_DIRS}) + # libpng if(USE_SHARED_LIBPNG) find_package(PNG REQUIRED) --- aseprite/src/app/CMakeLists.txt.orig 2024-08-21 17:10:38.000000000 -0500 +++ aseprite/src/app/CMakeLists.txt 2024-08-28 12:36:10.000000000 -0500 @@ -87,9 +87,6 @@ DEPENDS ${GEN_DEP} ${widget_files} ${string_files} "${SOURCE_DATA_DIR}/gui.xml") list(APPEND generated_files ${output_fn}) -# libarchive definitions -add_definitions(-DLIBARCHIVE_STATIC) - ###################################################################### # app-lib target @@ -759,8 +756,8 @@ ${ZLIB_LIBRARIES} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES} + ${LibArchive_LIBRARIES} json11 - archive_static fmt tinyexpr qoi) --- aseprite/third_party/CMakeLists.txt.orig 2024-08-21 17:10:38.000000000 -0500 +++ aseprite/third_party/CMakeLists.txt 2024-08-28 12:38:17.000000000 -0500 @@ -116,6 +116,7 @@ add_subdirectory(json11) # libarchive +if(NOT USE_SHARED_LIBARCHIVE) set(HAVE_WCSCPY 1) set(HAVE_WCSLEN 1) @@ -137,6 +138,7 @@ add_subdirectory(libarchive) target_include_directories(archive_static INTERFACE $) +endif() # benchmark if(ENABLE_BENCHMARKS)