Merge remote-tracking branch 'aur/master'

This commit is contained in:
Sebastiaan de Schaetzen 2025-05-01 14:56:56 +02:00
commit d78893ff42
12 changed files with 596 additions and 0 deletions

62
.SRCINFO Normal file
View File

@ -0,0 +1,62 @@
pkgbase = aseprite
pkgdesc = Create animated sprites and pixel art
pkgver = 1.3.13
pkgrel = 6
url = https://www.aseprite.org/
arch = x86_64
license = LicenseRef-Aseprite-EULA
makedepends = cmake
makedepends = ninja
makedepends = git
makedepends = python
makedepends = libxi
makedepends = gn
makedepends = harfbuzz-icu
makedepends = clang
depends = cmark
depends = libcurl.so
depends = libgif.so
depends = libjpeg.so
depends = zlib
depends = libpng
depends = tinyxml2>=11.0.0
depends = libfreetype.so
depends = libarchive.so
depends = libfmt.so
depends = libwebp.so
depends = libwebpmux.so
depends = libwebpdemux.so
depends = hicolor-icon-theme
depends = libexpat.so=1-64
depends = libharfbuzz.so=0-64
depends = libgl
depends = libfontconfig.so
depends = libxcursor
noextract = Aseprite-v1.3.13-Source.zip
noextract = skia-m102.tar.gz
source = https://github.com/aseprite/aseprite/releases/download/v1.3.13/Aseprite-v1.3.13-Source.zip
source = skia-m102.tar.gz::https://github.com/aseprite/skia/archive/refs/tags/m102-861e4743af.tar.gz
source = aseprite-strings::git+https://github.com/aseprite/strings.git#commit=5499ce2030d831c614f1ce7fdfdaf36a973c21f8
source = desktop.patch
source = shared-fmt.patch
source = shared-libarchive.patch
source = shared-libwebp.patch
source = shared-skia-deps.patch
source = optional-pixman.patch
source = fix-shared-tinyxml2.patch
source = shared-libwebp-found.patch
source = include_cstdint.patch
sha256sums = c2e639c083d99a5a478ded7c86d9d7f4e4ff9ebebf6fedac7f8bfc94d6bd94c1
sha256sums = 8d76c1ad3693e1fc019eb14d806082148eb4ed7d601474aeeaae601b05a9b3ad
sha256sums = 8ee87f57b5792e5751f63fe37cdda8d29053cd4449e1f533e792e15abcfefa79
sha256sums = 8b14e36939e930de581e95abf0591645aa0fcfd47161cf88b062917dbaaef7f9
sha256sums = c3591d376180d99ff8001c3d549c0bd18ef5e4d95f1755ccaa8e2fd65dd5d2b3
sha256sums = 89cd28a5a90ee9dd42e85866b6f954bde526068d94311b0730a62f00f9cfffdb
sha256sums = 0f8adb959d7000697af453d6cf5aaf9984b74868008382aad541d2c29871c751
sha256sums = eb9f544e68b41b5cb1a9ab7a6648db51587e67e94f1a452cb5a84f3d224bf5d0
sha256sums = c2d14f9738a96a9db3695c00ac3d14b1312b6a595b151bd56e19422c86517654
sha256sums = ba02fc060dc930cfd66a8903a5d8a59f981753bdf416e91cc77a48c56c86aea3
sha256sums = 72605d6760c29eb98f2d8d8cf2cc9f9f7d7655bcf7cfc944f6a46b0957adbb14
sha256sums = ce20c8caa61b0e4b478eb08853e1148eba76836027ec04cf5d0f76c4db9ae112
pkgname = aseprite

4
.nvchecker.toml Normal file
View File

@ -0,0 +1,4 @@
[aseprite]
source = "regex"
regex = 'v(\d+\.\d+\.\d+)'
url = "https://github.com/aseprite/aseprite/tags"

194
PKGBUILD Normal file
View File

@ -0,0 +1,194 @@
# Maintainer: Imperator Storm <ImperatorStorm11@protonmail.com>
# Maintainer: Eldred Habert <me@eldred.fr>
# Contributor: Fredrick Brennan <copypaste@kittens.ph>
# Contributor: Andrew Bueide <abueide@protonmail.com>
# Contributor: rouhannb <rouhannb@protonmail.com>
# Contributor: Wilson E. Alvarez <wilson.e.alvarez1@gmail.com>
# Contributor: Benoit Favre <benoit.favre@gmail.com>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Kamil Biduś <kamil.bidus@gmail.com>
# Contributor: Jomar Milan <jomarm@jomarm.com>
pkgname=aseprite
pkgver=1.3.13
_skiaver=m102
_skiahash=861e4743af
pkgrel=6
pkgdesc='Create animated sprites and pixel art'
arch=('x86_64')
url="https://www.aseprite.org/"
license=('LicenseRef-Aseprite-EULA')
depends=(# ~ Aseprite's direct dependencies ~
# pixman is not linked to because we use Skia instead
# harfbuzz is linked statically because Aseprite expects an older version
cmark libcurl.so libgif.so libjpeg.so zlib libpng 'tinyxml2>=11.0.0' libfreetype.so libarchive.so libfmt.so
libwebp.so libwebpmux.so libwebpdemux.so
hicolor-icon-theme # For installing Aseprite's icons
# ~ Skia deps ~
# (Skia links dynamically to HarfBuzz, only Aseprite itself doesn't. >_<)
libexpat.so=1-64 libharfbuzz.so=0-64 libgl
# Already required by Aseprite: libjpeg-turbo libpng zlib freetype2
# These two are only reported by Namcap, but don't seem to be direct dependencies?
libfontconfig.so libxcursor)
makedepends=(# "Meta" dependencies
cmake ninja git python
# Aseprite (including e.g. LAF)
libxi
# Skia
gn harfbuzz-icu
# TODO: Benchmark clang v gcc
# Fuck it, compiling with GCC>=13 is broken and I'm not gonna write a patch to fix it
clang
)
source=("https://github.com/aseprite/aseprite/releases/download/v$pkgver/Aseprite-v$pkgver-Source.zip"
# Which branch a given build of Aseprite requires is noted in its `INSTALL.md`
"skia-$_skiaver.tar.gz::https://github.com/aseprite/skia/archive/refs/tags/$_skiaver-$_skiahash.tar.gz"
aseprite-strings::git+https://github.com/aseprite/strings.git#commit=5499ce2030d831c614f1ce7fdfdaf36a973c21f8
desktop.patch
shared-fmt.patch
# Based on https://patch-diff.githubusercontent.com/raw/aseprite/aseprite/pull/2535.patch
shared-libarchive.patch
# Based on https://patch-diff.githubusercontent.com/raw/aseprite/aseprite/pull/2523.patch
shared-libwebp.patch
shared-skia-deps.patch
optional-pixman.patch
fix-shared-tinyxml2.patch
shared-libwebp-found.patch
include_cstdint.patch)
noextract=("Aseprite-v$pkgver-Source.zip"
"skia-$_skiaver.tar.gz") # Don't extract Aseprite or skia sources at the root
sha256sums=('c2e639c083d99a5a478ded7c86d9d7f4e4ff9ebebf6fedac7f8bfc94d6bd94c1'
'8d76c1ad3693e1fc019eb14d806082148eb4ed7d601474aeeaae601b05a9b3ad'
'8ee87f57b5792e5751f63fe37cdda8d29053cd4449e1f533e792e15abcfefa79'
'8b14e36939e930de581e95abf0591645aa0fcfd47161cf88b062917dbaaef7f9'
'c3591d376180d99ff8001c3d549c0bd18ef5e4d95f1755ccaa8e2fd65dd5d2b3'
'89cd28a5a90ee9dd42e85866b6f954bde526068d94311b0730a62f00f9cfffdb'
'0f8adb959d7000697af453d6cf5aaf9984b74868008382aad541d2c29871c751'
'eb9f544e68b41b5cb1a9ab7a6648db51587e67e94f1a452cb5a84f3d224bf5d0'
'c2d14f9738a96a9db3695c00ac3d14b1312b6a595b151bd56e19422c86517654'
'ba02fc060dc930cfd66a8903a5d8a59f981753bdf416e91cc77a48c56c86aea3'
'72605d6760c29eb98f2d8d8cf2cc9f9f7d7655bcf7cfc944f6a46b0957adbb14'
'ce20c8caa61b0e4b478eb08853e1148eba76836027ec04cf5d0f76c4db9ae112')
_debug="false"
prepare() {
# Extract Aseprite's sources
mkdir -p aseprite
bsdtar -xf "${noextract[0]}" -C aseprite
# Extract Skia's sources
mkdir -p skia
bsdtar xf skia-$_skiaver.tar.gz --strip-components=1 -C skia
# Fix up Aseprite's desktop integration
[[ -n $_debug ]] && echo desktop.patch
env -C aseprite patch -tp1 <desktop.patch
# Allow using more shared libs
[[ -n $_debug ]] && echo shared-fmt.patch
env -C aseprite patch -tp1 <shared-fmt.patch
[[ -n $_debug ]] && echo shared-libarchive.patch
env -C aseprite patch -tp1 <shared-libarchive.patch
[[ -n $_debug ]] && echo shared-libwebp.patch
env -C aseprite patch -tp1 <shared-libwebp.patch
[[ -n $_debug ]] && echo shared-pixman.patch
env -C aseprite patch -tp1 <optional-pixman.patch
# Their "FindSkia" module forcefully tries to use Skia's FreeType and HarfBuzz,
# but we don't clone those because we use the shared ones. Avoid overwriting the settings instead.
[[ -n $_debug ]] && echo shared-skia-deps.patch
env -C aseprite patch -tp1 <shared-skia-deps.patch
# TinyEXIF cannot find tinyxml2 otherwise
[[ -n $_debug ]] && echo fix-shared-tinyxml2.patch
env -C aseprite/third_party/TinyEXIF patch -tp1 <fix-shared-tinyxml2.patch
[[ -n $_debug ]] && echo shared-libwebp-found.patch
env -C aseprite patch -tp1 <shared-libwebp-found.patch
[[ -n $_debug ]] && echo include_cstdint.patch
patch -tp1 <include_cstdint.patch
}
build() {
echo Building Skia...
local _skiadir="$PWD/skia/obj"
export CXX=clang++
export CC=clang
export AR=ar
export NM=nm
# Flags can be found by running `gn args --list "$_skiadir"` from skia's directory.
# (Pipe the output somewhere, there's a LOT of args.)
#
# The flags are chosen to provide the API required by Aseprite and nothing else (if possible),
# so as to reduce the compilation time and final binary size.
#
# Individual rationales:
# is_official_build: Suggested by the build instructions.
# skia_build_fuzzers: We don't care about them.
# skia_enable_pdf: Not used by Aseprite.
# skia_enable_skottie: Not used by Aseprite.
# skia_enable_sksl: laf seems to want to use it... but no references are made anywhere.
# skia_enable_svg: Not used by Aseprite. It seems it has its own SVG exporter.
# skia_use_lib*_{encode,decode}: Aseprite only loads PNG assets, so only libpng is required.
# skia_use_expat: Only required for the Android font manager and SVGCanvas/SVGDevice.
# skia_use_piex: Not used by Aseprite. Only used for reading RAW files.
# skia_use_xps: Not used outside of Windows.
# skia_use_zlib: Only used for PDF and RAW files.
# skia_use_libgifcodec: Only used for GIFs, which Aseprite doesn't use.
# skia_enable_{particles,skparagraph,sktext}: Aseprite does not link against this library.
# gn is bad software
env -C skia gn gen "$_skiadir" --args='is_official_build=true skia_build_fuzzers=false skia_enable_pdf=false skia_enable_skottie=false skia_enable_sksl=false skia_enable_svg=false skia_use_libjpeg_turbo_encode=false skia_use_libjpeg_turbo_decode=false skia_use_libwebp_encode=false skia_use_libwebp_decode=false skia_use_expat=false skia_use_piex=false skia_use_xps=false skia_use_zlib=false skia_use_libgifcodec=false skia_enable_particles=false skia_enable_skparagraph=false skia_enable_sktext=false cc="clang" cxx="clang++"'
ninja -C "$_skiadir" skia modules
echo Building Aseprite...
# Suppress install messages since we install to a temporary area; `install -v` will do the job
cmake -S aseprite -B build -G Ninja -Wno-dev -DCMAKE_INSTALL_MESSAGE=NEVER -DCMAKE_BUILD_TYPE=None \
-DENABLE_UPDATER=OFF -DENABLE_{SCRIPTING,WEBSOCKET}=ON \
-DLAF_WITH_{EXAMPLES,TESTS}=OFF -DLAF_BACKEND=skia \
-DSKIA_DIR="$PWD/skia" -DSKIA_LIBRARY_DIR="$_skiadir" \
-DUSE_SHARED_{CMARK,CURL,FMT,GIFLIB,JPEGLIB,ZLIB,LIBPNG,TINYXML,PIXMAN,FREETYPE,HARFBUZZ,LIBARCHIVE,WEBP}=YES \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 # workaround
cmake --build build
}
check() {
export CXX=clang++
export CC=clang
export AR=ar
export NM=nm
env -C build ctest --output-on-failure
}
package() {
export CXX=clang++
export CC=clang
export AR=ar
export NM=nm
# Now the fun part: components of e.g. `libwebp` get installed as well,
# since we've had to compile it. But we don't want them.
# So, install normally, and then cherry-pick Aseprite's files out of that.
# Use a whitelist to prefer installing not enough (breakage goes noticed),
# instead of too much (cruft rarely goes noticed). Also hope that it doesn't break :)
cmake --install build --prefix=staging --strip
# Install the binary and its `.desktop` file
install -vDm 755 staging/bin/aseprite "$pkgdir/usr/bin/aseprite"
install -vDm 644 aseprite/src/desktop/linux/aseprite.desktop "$pkgdir/usr/share/applications/$pkgname.desktop"
install -vDm 644 aseprite/src/desktop/linux/mime/aseprite.xml "$pkgdir/usr/share/mime/packages/$pkgname.xml"
# Thumbnailer
install -vDm 755 aseprite/src/desktop/linux/aseprite-thumbnailer "$pkgdir/usr/bin/aseprite-thumbnailer"
install -vDm 644 aseprite/src/desktop/linux/gnome/aseprite.thumbnailer "$pkgdir/usr/share/thumbnailers/aseprite.thumbnailer"
# Install the icons in the correct directory (which is not the default)
local _size
for _size in 16 32 48 64 128 256; do
# The installed icon's name is taken from the `.desktop` file
install -vDm 644 staging/share/aseprite/data/icons/ase$_size.png "$pkgdir/usr/share/icons/hicolor/${_size}x$_size/apps/aseprite.png"
done
# Delete the icons to avoid copying them in two places (they aren't used by Aseprite itself)
rm -rf staging/share/aseprite/data/icons
# Install all of the program's data
cp -vrt "$pkgdir/usr/share" staging/share/aseprite
# Also install the licenses
install -vDm 644 -t "$pkgdir/usr/share/licenses/$pkgname" aseprite/{EULA.txt,docs/LICENSES.md}
# Copy the font's license, but leave it in the font directory as well (probably doesn't hurt)
install -vm 644 aseprite/data/fonts/LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/font.txt"
# Copy translations
mkdir -p "$pkgdir/usr/share/$pkgname/data/strings/"
cp -vt "$pkgdir/usr/share/$pkgname/data/strings/" aseprite-strings/*.ini
# Copy translations' license
install -vm 644 aseprite-strings/LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/translations.txt"
}

25
desktop.patch Normal file
View File

@ -0,0 +1,25 @@
diff --git a/src/desktop/linux/aseprite.desktop b/src/desktop/linux/aseprite.desktop
index e23999db8..803a1fc75 100644
--- a/src/desktop/linux/aseprite.desktop
+++ b/src/desktop/linux/aseprite.desktop
@@ -5,7 +5,7 @@ GenericName=Sprite Editor
Comment=Animated sprite editor & pixel art tool
Icon=aseprite
Categories=Graphics;2DGraphics;RasterGraphics
-Exec=aseprite %U
+Exec=aseprite %F
TryExec=aseprite
Terminal=false
StartupNotify=false
diff --git a/src/desktop/linux/mime/aseprite.xml b/src/desktop/linux/mime/aseprite.xml
index 52b2adb92..a656cb3b1 100644
--- a/src/desktop/linux/mime/aseprite.xml
+++ b/src/desktop/linux/mime/aseprite.xml
@@ -7,6 +7,6 @@
</magic>
<glob pattern="*.ase"/>
<glob pattern="*.aseprite"/>
- <icon name="aseprite"/>
+ <icon name="image-x-aseprite"/>
</mime-type>
</mime-info>

24
fix-shared-tinyxml2.patch Normal file
View File

@ -0,0 +1,24 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 674dbd6..1ba8329 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.1)
project(TinyEXIF)
include(GNUInstallDirs)
+find_package(tinyxml2 REQUIRED)
+
#CMAKE_BUILD_TOOL
################################
@@ -141,6 +143,10 @@ if(BUILD_STATIC_LIBS)
endif()
endif()
+ # export targets for find_package config mode
+ export(TARGETS TinyEXIFstatic
+ FILE ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}Targets.cmake)
+
install(TARGETS TinyEXIFstatic
EXPORT ${CMAKE_PROJECT_NAME}Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}

23
include_cstdint.patch Normal file
View File

@ -0,0 +1,23 @@
diff --git a/aseprite/third_party/json11/json11.cpp b/aseprite/third_party/json11/json11.cpp
index b16f409..9a45f8e 100644
--- a/aseprite/third_party/json11/json11.cpp
+++ b/aseprite/third_party/json11/json11.cpp
@@ -24,6 +24,7 @@
#include <cmath>
#include <cstdlib>
#include <cstdio>
+#include <cstdint>
#include <limits>
namespace json11 {
diff --git a/skia/src/sksl/transform/SkSLTransform.h b/skia/src/sksl/transform/SkSLTransform.h
index b2d1f90..6a34284 100644
--- a/skia/src/sksl/transform/SkSLTransform.h
+++ b/skia/src/sksl/transform/SkSLTransform.h
@@ -10,6 +10,7 @@
#include <memory>
#include <vector>
+#include <cstdint>
namespace SkSL {

23
optional-pixman.patch Normal file
View File

@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f16f09660d..40065905d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -271,16 +271,18 @@
include_directories(${TINYXML_INCLUDE_DIR})
# pixman
+if(NOT LAF_BACKEND STREQUAL "skia")
if(USE_SHARED_PIXMAN)
find_library(PIXMAN_LIBRARY NAMES pixman pixman-1)
find_path(PIXMAN_INCLUDE_DIR NAMES pixman.h PATH_SUFFIXES pixman-1)
else()
set(PIXMAN_LIBRARY pixman)
set(PIXMAN_INCLUDE_DIR
${PIXMAN_DIR}/pixman
${CMAKE_BINARY_DIR}) # For pixman-version.h
endif()
include_directories(${PIXMAN_INCLUDE_DIR})
+endif()
# freetype
if(USE_SHARED_FREETYPE)

71
shared-fmt.patch Normal file
View File

@ -0,0 +1,71 @@
--- a/CMakeLists.txt 2022-01-08 00:37:08.165330523 +0100
+++ b/CMakeLists.txt 2022-01-08 00:52:41.163585173 +0100
@@ -54,6 +54,7 @@
option(USE_SHARED_CMARK "Use your installed copy of cmark" off)
option(USE_SHARED_CURL "Use your installed copy of curl" off)
+option(USE_SHARED_FMT "Use your installed copy of fmt" off)
option(USE_SHARED_GIFLIB "Use your installed copy of giflib" off)
option(USE_SHARED_JPEGLIB "Use your installed copy of jpeglib" off)
option(USE_SHARED_ZLIB "Use your installed copy of zlib" off)
@@ -165,6 +165,7 @@
set(SOURCE_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data)
set(CMARK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/cmark)
set(CURL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/curl)
+set(FMT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt)
set(GIFLIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/giflib)
set(LIBJPEG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/jpeg)
set(LIBPNG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libpng)
@@ -204,6 +205,15 @@
set(CURL_STATICLIB ON BOOL)
endif()
+if(USE_SHARED_FMT)
+ find_package(FMT REQUIRED)
+ set(FMT_LIBRARIES fmt::fmt)
+else()
+ set(FMT_FOUND)
+ set(FMT_LIBRARIES fmt)
+ # No need to include extra directories, actually
+endif()
+
# zlib
if(USE_SHARED_ZLIB)
find_package(ZLIB REQUIRED)
--- a/src/app/CMakeLists.txt 2022-01-08 00:37:07.378671200 +0100
+++ b/src/app/CMakeLists.txt 2022-01-08 00:53:13.669969512 +0100
@@ -741,7 +741,7 @@ target_link_libraries(app-lib
${HARFBUZZ_LIBRARIES}
json11
archive_static
- fmt
+ ${FMT_LIBRARIES}
tinyexpr
qoi)
if(ENABLE_PSD)
--- a/src/dio/CMakeLists.txt 2022-01-08 00:41:50.712726972 +0100
+++ b/src/dio/CMakeLists.txt 2022-01-08 00:53:39.936408022 +0100
@@ -10,7 +10,7 @@
target_link_libraries(dio-lib
${ZLIB_LIBRARIES}
- fmt
+ ${FMT_LIBRARIES}
flic-lib
laf-base
fixmath-lib
--- a/third_party/CMakeLists.txt 2022-01-08 00:37:08.165330523 +0100
+++ b/third_party/CMakeLists.txt 2022-01-08 00:54:30.455969136 +0100
@@ -106,7 +106,10 @@
endif()
add_subdirectory(simpleini)
-add_subdirectory(fmt)
+
+if(NOT USE_SHARED_FMT)
+ add_subdirectory(fmt)
+endif()
# Add cmark without tests
if(NOT USE_SHARED_CMARK)

75
shared-libarchive.patch Normal file
View File

@ -0,0 +1,75 @@
From cf84155eb143d821963e8fdf18781dfa164eac9b Mon Sep 17 00:00:00 2001
From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com>
Date: Fri, 9 Oct 2020 02:18:36 +0300
Subject: [PATCH] Make LibArchive as shared library dependency
---
CMakeLists.txt | 11 +++++++++++
src/app/CMakeLists.txt | 2 +-
third_party/CMakeLists.txt | 22 ++++++++++++----------
3 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9cb5a2cdfb..9d95936f36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,6 +60,7 @@ option(USE_SHARED_CURL "Use your installed copy of curl" off)
option(USE_SHARED_GIFLIB "Use your installed copy of giflib" off)
option(USE_SHARED_JPEGLIB "Use your installed copy of jpeglib" off)
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)
option(USE_SHARED_TINYXML "Use your installed copy of tinyxml" off)
option(USE_SHARED_PIXMAN "Use your installed copy of pixman" off)
@@ -200,6 +201,16 @@ else()
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>)
+endif()
+include_directories(${LibArchive_INCLUDE_DIRS})
+
# libpng
if(USE_SHARED_LIBPNG)
find_package(PNG REQUIRED)
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt
index e1e3bc1ae3..4a37838e95 100644
--- a/src/app/CMakeLists.txt
+++ b/src/app/CMakeLists.txt
@@ -651,8 +651,8 @@ target_link_libraries(app-lib
${GIF_LIBRARIES}
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
+ ${LibArchive_LIBRARIES}
json11
- archive_static
${FMT_LIBRARIES}
tinyexpr
qoi)
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index ffd1c0cfcd..4839d4097c 100644
--- a/third_party/CMakeLists.txt.orig
+++ b/third_party/CMakeLists.txt
@@ -110,6 +110,7 @@ endif()
add_subdirectory(json11)
# libarchive
+if(NOT USE_SHARED_LIBARCHIVE)
set(HAVE_WCSCPY 1)
set(HAVE_WCSLEN 1)
@@ -126,6 +127,7 @@ set(ENABLE_CPIO OFF CACHE BOOL "Enable cpio building")
add_subdirectory(libarchive)
target_include_directories(archive_static INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libarchive/libarchive>)
+endif()
# benchmark
if(ENABLE_BENCHMARKS)

View File

@ -0,0 +1,11 @@
diff -ura aseprite.orig/CMakeLists.txt aseprite.new/CMakeLists.txt
--- aseprite.orig/CMakeLists.txt 2024-12-25 12:50:48.325195746 -0800
+++ aseprite.new/CMakeLists.txt 2024-12-25 12:51:47.829384607 -0800
@@ -361,6 +361,7 @@
find_library(WEBPMUX_LIBRARY NAMES webpmux)
set(WEBP_LIBRARIES ${WEBP_LIBRARY} ${WEBPDEMUX_LIBRARY} ${WEBPMUX_LIBRARY})
find_path(WEBP_INCLUDE_DIRS NAMES decode.h PATH_SUFFIXES webp)
+ set(WEBP_FOUND ON)
else()
find_library(WEBP_LIBRARIES webp
NAMES libwebp # required for Windows

63
shared-libwebp.patch Normal file
View File

@ -0,0 +1,63 @@
From ca9e20a87be6dcc8d9b97841535b2320d2eb2f91 Mon Sep 17 00:00:00 2001
From: Drauthius <albert@diserholt.com>
Date: Sat, 26 Sep 2020 10:40:13 +0200
Subject: [PATCH] Shared webp library
Making optional linking with shared system webp library with
-DUSE_SHARED_WEBP option.
---
CMakeLists.txt | 12 +++++++++---
third_party/CMakeLists.txt | 2 +-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index af077f6..fed17ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,7 @@ option(USE_SHARED_TINYXML "Use your installed copy of tinyxml" off)
option(USE_SHARED_PIXMAN "Use your installed copy of pixman" off)
option(USE_SHARED_FREETYPE "Use shared FreeType library" off)
option(USE_SHARED_HARFBUZZ "Use shared HarfBuzz library" off)
+option(USE_SHARED_WEBP "Use your installed copy of webp" off)
option(ENABLE_ASEPRITE_EXE "Compile main Aseprite executable" on)
option(ENABLE_MEMLEAK "Enable memory-leaks detector (only for developers)" off)
option(ENABLE_NEWS "Enable the news in Home tab" on)
@@ -352,7 +352,13 @@ add_subdirectory(laf)
# libwebp
if(ENABLE_WEBP)
# Use libwebp from Skia
- if(LAF_BACKEND STREQUAL "skia")
+ if(USE_SHARED_WEBP)
+ find_library(WEBP_LIBRARY NAMES webp)
+ find_library(WEBPDEMUX_LIBRARY NAMES webpdemux)
+ find_library(WEBPMUX_LIBRARY NAMES webpmux)
+ set(WEBP_LIBRARIES ${WEBP_LIBRARY} ${WEBPDEMUX_LIBRARY} ${WEBPMUX_LIBRARY})
+ find_path(WEBP_INCLUDE_DIRS NAMES decode.h PATH_SUFFIXES webp)
+ else()
find_library(WEBP_LIBRARIES webp
NAMES libwebp # required for Windows
PATHS "${SKIA_LIBRARY_DIR}" NO_DEFAULT_PATH)
@@ -362,10 +368,6 @@ if(ENABLE_WEBP)
else()
set(WEBP_FOUND OFF)
endif()
- else()
- set(WEBP_FOUND ON)
- set(WEBP_LIBRARIES webp webpdemux libwebpmux)
- set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src)
endif()
endif()
message(STATUS "aseprite libwebp: ${WEBP_LIBRARIES}")
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index 4839d4097c..e8c3e83cbc 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -32,7 +32,7 @@ if(NOT USE_SHARED_GIFLIB)
add_subdirectory(giflib)
endif()
-if(ENABLE_WEBP AND NOT LAF_BACKEND STREQUAL "skia")
+if(ENABLE_WEBP AND NOT LAF_BACKEND STREQUAL "skia" AND NOT USE_SHARED_WEBP)
set(WEBP_BUILD_EXTRAS OFF CACHE BOOL "Build extras.")
add_subdirectory(libwebp)
endif()

21
shared-skia-deps.patch Normal file
View File

@ -0,0 +1,21 @@
--- src/laf/cmake/FindSkia.cmake.orig 2022-01-08 02:15:13.417619266 +0100
+++ src/laf/cmake/FindSkia.cmake 2022-01-08 02:15:43.603960491 +0100
@@ -32,14 +32,18 @@
# SkShaper module + freetype + harfbuzz
find_library(SKSHAPER_LIBRARY skshaper PATH "${SKIA_LIBRARY_DIR}")
+if(NOT USE_SHARED_FREETYPE)
set(FREETYPE_FOUND ON)
find_library(FREETYPE_LIBRARY freetype2 PATH "${SKIA_LIBRARY_DIR}" NO_DEFAULT_PATH)
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
set(FREETYPE_INCLUDE_DIRS "${SKIA_DIR}/third_party/externals/freetype/include")
+endif()
+if(NOT USE_SHARED_HARFBUZZ)
find_library(HARFBUZZ_LIBRARY harfbuzz PATH "${SKIA_LIBRARY_DIR}" NO_DEFAULT_PATH)
set(HARFBUZZ_LIBRARIES ${HARFBUZZ_LIBRARY})
set(HARFBUZZ_INCLUDE_DIRS "${SKIA_DIR}/third_party/externals/harfbuzz/src")
+endif()
set(SKIA_LIBRARIES
${SKIA_LIBRARY}