Add option to use shared libarchive.
https://github.com/aseprite/aseprite/issues/1681
https://github.com/aseprite/aseprite/pull/2535
--- aseprite/CMakeLists.txt.orig	2025-01-02 08:04:16.000000000 -0600
+++ aseprite/CMakeLists.txt	2025-01-26 05:30:41.000000000 -0600
@@ -71,2 +71,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)
@@ -239,6 +240,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 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libarchive/libarchive>)
+  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	2025-01-02 08:04:16.000000000 -0600
+++ aseprite/src/app/CMakeLists.txt	2025-01-26 05:37:22.000000000 -0600
@@ -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
 
@@ -752,8 +749,8 @@
   ${GIF_LIBRARIES}
   ${PNG_LIBRARIES}
   ${ZLIB_LIBRARIES}
+  ${LibArchive_LIBRARIES}
   json11
-  archive_static
   fmt
   tinyexpr
   qoi)
--- aseprite/third_party/CMakeLists.txt.orig	2025-01-26 05:30:40.000000000 -0600
+++ aseprite/third_party/CMakeLists.txt	2025-01-26 05:30:41.000000000 -0600
@@ -130,6 +130,7 @@
 add_subdirectory(json11 EXCLUDE_FROM_ALL)
 
 # libarchive
+if(NOT USE_SHARED_LIBARCHIVE)
 set(HAVE_WCSCPY 1)
 set(HAVE_WCSLEN 1)
 
@@ -151,6 +152,7 @@
 add_subdirectory(libarchive)
 target_include_directories(archive_static INTERFACE
   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libarchive/libarchive>)
+endif()
 
 # benchmark
 if(ENABLE_BENCHMARKS)
