From 79713e75fcc5c5cb55d1b1beac008683b57c8805 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 7 Jan 2024 06:54:34 +0000 Subject: gentoo auto-resync : 07:01:2024 - 06:54:33 --- .../aseprite/files/aseprite-1.3.2_shared_fmt.patch | 52 ++++++++++++++ .../files/aseprite-1.3.2_shared_json11.patch | 56 +++++++++++++++ .../files/aseprite-1.3.2_shared_webp.patch | 81 ++++++++++++++++++++++ .../files/aseprite-1.3.2_strict-aliasing.patch | 55 +++++++++++++++ 4 files changed, 244 insertions(+) create mode 100644 dev-games/aseprite/files/aseprite-1.3.2_shared_fmt.patch create mode 100644 dev-games/aseprite/files/aseprite-1.3.2_shared_json11.patch create mode 100644 dev-games/aseprite/files/aseprite-1.3.2_shared_webp.patch create mode 100644 dev-games/aseprite/files/aseprite-1.3.2_strict-aliasing.patch (limited to 'dev-games/aseprite/files') diff --git a/dev-games/aseprite/files/aseprite-1.3.2_shared_fmt.patch b/dev-games/aseprite/files/aseprite-1.3.2_shared_fmt.patch new file mode 100644 index 000000000000..ddb32c5b672d --- /dev/null +++ b/dev-games/aseprite/files/aseprite-1.3.2_shared_fmt.patch @@ -0,0 +1,52 @@ +From 7afccfca25ffe17aba5dada1dab663c8b6228ab1 Mon Sep 17 00:00:00 2001 +From: "Azamat H. Hackimov" +Date: Tue, 2 Jan 2024 20:00:12 +0300 +Subject: [PATCH] Use shared fmt library + +Added option -DUSE_SHARED_FMT +--- + CMakeLists.txt | 5 +++++ + third_party/CMakeLists.txt | 4 +++- + 2 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2fc29252b..e49373323 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,6 +39,7 @@ enable_testing() + + 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 libfmt" 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_JSON11 "Use your installed copy of json11" off) +@@ -197,6 +198,10 @@ if(NOT USE_SHARED_CURL) + set(CURL_STATICLIB ON BOOL) + endif() + ++if(USE_SHARED_FMT) ++ find_package(fmt REQUIRED) ++endif() ++ + # zlib + if(USE_SHARED_ZLIB) + find_package(ZLIB REQUIRED) +diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt +index babbd4742..3c83991a4 100644 +--- a/third_party/CMakeLists.txt ++++ b/third_party/CMakeLists.txt +@@ -113,7 +113,9 @@ if(NOT USE_SHARED_HARFBUZZ AND NOT LAF_BACKEND STREQUAL "skia") + 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) +-- +2.41.0 + diff --git a/dev-games/aseprite/files/aseprite-1.3.2_shared_json11.patch b/dev-games/aseprite/files/aseprite-1.3.2_shared_json11.patch new file mode 100644 index 000000000000..98b10f76b58d --- /dev/null +++ b/dev-games/aseprite/files/aseprite-1.3.2_shared_json11.patch @@ -0,0 +1,56 @@ +From 7fa34e4a478ae4e4eab4031e626040a9db210417 Mon Sep 17 00:00:00 2001 +From: "Azamat H. Hackimov" +Date: Sun, 10 Jul 2022 19:53:06 +0300 +Subject: [PATCH 1/3] Use shared json11 library + +Added option -DUSE_SHARED_JSON11 +--- + CMakeLists.txt | 7 +++++++ + third_party/CMakeLists.txt | 6 +++++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f099e1deb..c4f364185 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,6 +41,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_GIFLIB "Use your installed copy of giflib" off) + option(USE_SHARED_JPEGLIB "Use your installed copy of jpeglib" off) ++option(USE_SHARED_JSON11 "Use your installed copy of json11" 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) +@@ -299,6 +300,12 @@ else() + endif() + include_directories(${JPEG_INCLUDE_DIRS}) + ++if(USE_SHARED_JSON11) ++ find_package(PkgConfig QUIET) ++ pkg_check_modules(JSON11 json11) ++ include_directories(${JSON11_INCLUDE_DIRS}) ++endif() ++ + if(USE_SHARED_CMARK) + find_library(CMARK_LIBRARIES NAMES cmark) + find_path(CMARK_INCLUDE_DIRS NAMES cmark.h) +diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt +index bdd52435c..88eea9b5e 100644 +--- a/third_party/CMakeLists.txt ++++ b/third_party/CMakeLists.txt +@@ -123,7 +123,11 @@ if(NOT USE_SHARED_CMARK) + endif() + + # JSON +-add_subdirectory(json11) ++if(NOT USE_SHARED_JSON11) ++ add_library(json11 STATIC json11/json11.cpp) ++ target_include_directories(json11 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/json11) ++ #target_compile_options(json11 PRIVATE -fPIC -fno-rtti -fno-exceptions -Wall) ++endif() + + # libarchive + if(NOT USE_SHARED_LIBARCHIVE) +-- +2.41.0 + diff --git a/dev-games/aseprite/files/aseprite-1.3.2_shared_webp.patch b/dev-games/aseprite/files/aseprite-1.3.2_shared_webp.patch new file mode 100644 index 000000000000..3026b7641e6d --- /dev/null +++ b/dev-games/aseprite/files/aseprite-1.3.2_shared_webp.patch @@ -0,0 +1,81 @@ +From 06d5d4cd307e9ee0b83bdbff71729dab1305ea9a Mon Sep 17 00:00:00 2001 +From: "Azamat H. Hackimov" +Date: Sun, 10 Jul 2022 20:14:00 +0300 +Subject: [PATCH 2/4] Use shared webp library + +Added option -DUSE_SHARED_WEBP +--- + CMakeLists.txt | 28 ++++++++++++++++++---------- + third_party/CMakeLists.txt | 2 +- + 2 files changed, 19 insertions(+), 11 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c4f364185..ba05f8d84 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -47,6 +47,7 @@ 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) ++option(USE_SHARED_WEBP "Use your installed copy of webp" off) + option(USE_SHARED_FREETYPE "Use shared FreeType library" off) + option(USE_SHARED_HARFBUZZ "Use shared HarfBuzz library" off) + option(ENABLE_ASEPRITE_EXE "Compile main Aseprite executable" on) +@@ -342,24 +343,31 @@ set(UNDO_TESTS ${ENABLE_TESTS} CACHE BOOL "Enable undo tests") + if(ENABLE_DRM) + add_subdirectory(drm) + endif() +-add_subdirectory(laf) + + # libwebp + if(ENABLE_WEBP) +- # Use libwebp from Skia +- if(LAF_BACKEND STREQUAL "skia") +- find_library(WEBP_LIBRARIES webp +- NAMES libwebp # required for Windows +- PATHS "${SKIA_LIBRARY_DIR}" NO_DEFAULT_PATH) +- set(WEBP_INCLUDE_DIR "${SKIA_DIR}/third_party/externals/libwebp/src") ++ if(USE_SHARED_WEBP) ++ find_package(PkgConfig QUIET) ++ pkg_check_modules(WEBP libwebp libwebpdemux libwebpmux) ++ include_directories(${WEBP_INCLUDE_DIR}) + else() +- set(WEBP_LIBRARIES webp webpdemux libwebpmux) +- set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src) ++ # Use libwebp from Skia ++ if(LAF_BACKEND STREQUAL "skia") ++ find_library(WEBP_LIBRARIES webp ++ NAMES libwebp # required for Windows ++ PATHS "${SKIA_LIBRARY_DIR}" NO_DEFAULT_PATH) ++ set(WEBP_INCLUDE_DIR "${SKIA_DIR}/third_party/externals/libwebp/src") ++ else() ++ set(WEBP_LIBRARIES webp webpdemux libwebpmux) ++ set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src) ++ endif() ++ include_directories(${WEBP_INCLUDE_DIR}) + endif() +- include_directories(${WEBP_INCLUDE_DIR}) + endif() + message(STATUS "aseprite libwebp: ${WEBP_LIBRARIES}") + ++add_subdirectory(laf) ++ + # LAF libraries + Aseprite are compiled with config.h + target_include_directories(laf-base PUBLIC src) + target_compile_definitions(laf-base PUBLIC HAVE_CONFIG_H) +diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt +index 88eea9b5e..31aa3e52f 100644 +--- a/third_party/CMakeLists.txt ++++ b/third_party/CMakeLists.txt +@@ -33,7 +33,7 @@ if(NOT USE_SHARED_GIFLIB) + add_subdirectory(giflib) + endif() + +-if(ENABLE_WEBP AND NOT LAF_BACKEND STREQUAL "skia") ++if(ENABLE_WEBP AND NOT USE_SHARED_WEBP AND NOT LAF_BACKEND STREQUAL "skia") + set(WEBP_BUILD_EXTRAS OFF CACHE BOOL "Build extras.") + set(WEBP_BUILD_ANIM_UTILS OFF CACHE BOOL "Build animation utilities.") + set(WEBP_BUILD_CWEBP OFF CACHE BOOL "Build the cwebp command line tool.") +-- +2.41.0 + diff --git a/dev-games/aseprite/files/aseprite-1.3.2_strict-aliasing.patch b/dev-games/aseprite/files/aseprite-1.3.2_strict-aliasing.patch new file mode 100644 index 000000000000..de88b29a82aa --- /dev/null +++ b/dev-games/aseprite/files/aseprite-1.3.2_strict-aliasing.patch @@ -0,0 +1,55 @@ +From 4e2066a7eb108503bfea2092672329e19ffbde49 Mon Sep 17 00:00:00 2001 +From: "Azamat H. Hackimov" +Date: Tue, 2 Jan 2024 21:09:04 +0300 +Subject: [PATCH] Fix strict-aliasing warnings + +--- + src/dio/aseprite_decoder.cpp | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/dio/aseprite_decoder.cpp b/src/dio/aseprite_decoder.cpp +index e01fbba32..209a67307 100644 +--- a/src/dio/aseprite_decoder.cpp ++++ b/src/dio/aseprite_decoder.cpp +@@ -28,10 +28,20 @@ + #include "zlib.h" + + #include ++#include + #include + + namespace dio { + ++template ++T ++copy_reinterpret_cast(const void* ptr) ++{ ++ T tmp; ++ std::memcpy(&tmp, ptr, sizeof(T)); ++ return tmp; ++} ++ + bool AsepriteDecoder::decode() + { + bool ignore_old_color_chunks = false; +@@ -425,7 +435,7 @@ float AsepriteDecoder::readFloat() + + // Little endian. + int v = ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1); +- return *reinterpret_cast(&v); ++ return *copy_reinterpret_cast(&v); + } + + double AsepriteDecoder::readDouble() +@@ -465,7 +475,7 @@ double AsepriteDecoder::readDouble() + ((long long)b3 << 16) | + ((long long)b2 << 8) | + (long long)b1); +- return *reinterpret_cast(&v); ++ return *copy_reinterpret_cast(&v); + } + + doc::Palette* AsepriteDecoder::readColorChunk(doc::Palette* prevPal, +-- +2.41.0 + -- cgit v1.2.3