public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Conrad Kostecki" <conikost@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-games/aseprite/files/, dev-games/aseprite/
Date: Sun,  7 Jan 2024 00:20:24 +0000 (UTC)	[thread overview]
Message-ID: <1704586776.774bfe9d9aeef263ee06d2baeb8769d662f70073.conikost@gentoo> (raw)

commit:     774bfe9d9aeef263ee06d2baeb8769d662f70073
Author:     Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
AuthorDate: Tue Jan  2 19:30:39 2024 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sun Jan  7 00:19:36 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=774bfe9d

dev-games/aseprite: add 1.3.2

Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/33967
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 dev-games/aseprite/Manifest                        |   1 +
 dev-games/aseprite/aseprite-1.3.2.ebuild           | 219 +++++++++++++++++++++
 .../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 ++++++
 6 files changed, 464 insertions(+)

diff --git a/dev-games/aseprite/Manifest b/dev-games/aseprite/Manifest
index 3a17ddaab2ba..4f38c8c61a76 100644
--- a/dev-games/aseprite/Manifest
+++ b/dev-games/aseprite/Manifest
@@ -1,2 +1,3 @@
 DIST Aseprite-v1.2.40-Source.zip 61802371 BLAKE2B f6f586a3ca222de208e6639e3fc94a63f98e487e1975dccd2974ffa71f937384177639e3799fb81f064afaf1c4a048394fab32a30bcda353320ac55c38b17636 SHA512 0a548428a3362f49cb6cecaa061de8371ad3f0bc22d00bc957e21f22316772e854d7ad36ebb7e5b69274eea376bb62fa39abfd4bc02250524c3707f81a628b1f
+DIST Aseprite-v1.3.2-Source.zip 64151421 BLAKE2B 9e23bf62b7d8c6377e36149ce830151d35b48e125a5a99aeb44b0fb1f2f653e53df9b8d74b7127598607561cf6dde4b59f00dd6c6abd08581eddab71feda415d SHA512 cbe1acd1f851f049ceaa948eb59ec1cb1e67c99e9204750f1e38cbedb8122fe0ce63230b63ab537e59d87c88d5ebae03b0785d0eb5195c8ef9a206c8ac71b977
 DIST skia-m102-3338e90707323d2cd3a150276acb9f39933deee2.gh.tar.gz 53944562 BLAKE2B 9da3e8386cd7a18a6ee9362743bee4146c41038af8868a6f5e8a2dce468e4dc4669b488861d117da8d1bd8461b2ad47bfc300774a33a84153bca345d63a929a7 SHA512 9ae0032ee3861ce4958af6eb7047273d28b1faa3823576ef568e3c7faed7f49a9976540a72c3fa38234a4ae6319ac381324eff807938f9763781fd33ad67d075

diff --git a/dev-games/aseprite/aseprite-1.3.2.ebuild b/dev-games/aseprite/aseprite-1.3.2.ebuild
new file mode 100644
index 000000000000..dcf66f4f2316
--- /dev/null
+++ b/dev-games/aseprite/aseprite-1.3.2.ebuild
@@ -0,0 +1,219 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake desktop python-any-r1 toolchain-funcs xdg-utils
+
+SKIA_VER="m102"
+# Last commit in ${SKIA_VER} feature branch
+# Don't use skia.googlesource.com, it produces non-reproducible tarballs
+SKIA_REV="3338e90707323d2cd3a150276acb9f39933deee2"
+
+DESCRIPTION="Animated sprite editor & pixel art tool"
+HOMEPAGE="https://www.aseprite.org"
+SRC_URI="https://github.com/aseprite/aseprite/releases/download/v${PV}/Aseprite-v${PV}-Source.zip
+	https://github.com/google/skia/archive/${SKIA_REV}.tar.gz -> skia-${SKIA_VER}-${SKIA_REV}.gh.tar.gz"
+
+# See https://github.com/aseprite/aseprite#license
+LICENSE="Aseprite-EULA"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="kde test webp"
+RESTRICT="bindist mirror !test? ( test )"
+
+CDEPEND="
+	app-arch/libarchive:=
+	app-text/cmark:=
+	dev-libs/libfmt:=
+	dev-libs/tinyxml
+	media-libs/freetype
+	media-libs/giflib:=
+	media-libs/harfbuzz:=[truetype]
+	media-libs/libjpeg-turbo:=
+	media-libs/libpng:=
+	net-misc/curl
+	sys-libs/zlib:=
+	virtual/opengl
+	x11-libs/libX11
+	x11-libs/libXcursor
+	x11-libs/libXi
+	x11-libs/libxcb:=
+	kde? (
+		dev-qt/qtcore:5
+		dev-qt/qtgui:5
+		kde-frameworks/kio:5
+	)
+	webp? ( media-libs/libwebp:= )"
+RDEPEND="
+	${CDEPEND}
+	gnome-extra/zenity
+"
+DEPEND="
+	${CDEPEND}
+	x11-base/xorg-proto"
+BDEPEND="
+	${PYTHON_DEPS}
+	test? ( dev-cpp/gtest )
+	app-arch/unzip
+	dev-util/gn
+	virtual/pkgconfig"
+
+DOCS=(
+	docs/ase-file-specs.md
+	docs/gpl-palette-extension.md
+	README.md
+)
+
+S="${WORKDIR}"
+
+PATCHES=(
+	"${FILESDIR}/skia-${SKIA_VER}_remove_angle2.patch"
+	"${FILESDIR}/${PN}-1.2.40_shared_libarchive.patch"
+	"${FILESDIR}/${PN}-1.3.2_shared_json11.patch"
+	"${FILESDIR}/${PN}-1.3.2_shared_webp.patch"
+	"${FILESDIR}/${PN}-1.2.35_laf_fixes.patch"
+	"${FILESDIR}/${PN}-1.3.2_shared_fmt.patch"
+	"${FILESDIR}/${PN}-1.3.2_strict-aliasing.patch"
+)
+
+src_prepare() {
+	cmake_src_prepare
+	# Skia: remove custom optimizations
+	sed -i -e 's:"\/\/gn\/skia\:optimize",::g' \
+		"skia-${SKIA_REV}/gn/BUILDCONFIG.gn" || die
+	# Aseprite: don't install tga bundled library
+	sed -i -e '/install/d' src/tga/CMakeLists.txt || die
+	# Aseprite: don't use bundled gtest
+	sed -i -e '/add_subdirectory(googletest)/d' \
+		laf/third_party/CMakeLists.txt || die
+	# Fix shebang in thumbnailer
+	sed -i -e 's:#!/usr/bin/sh:#!/bin/sh:' \
+		src/desktop/linux/aseprite-thumbnailer || die
+}
+
+src_configure() {
+	einfo "Skia configuration"
+	cd "${WORKDIR}/skia-${SKIA_REV}" || die
+
+	tc-export AR CC CXX
+
+	passflags() {
+		local _f _x
+		_f=( ${1} )
+		_x="[$(printf '"%s", ' "${_f[@]}")]"
+		myconf_gn+=( ${2}="${_x}" )
+	}
+
+	local myconf_gn=(
+		ar=\"${AR}\"
+		cc=\"${CC}\"
+		cxx=\"${CXX}\"
+
+		is_official_build=true
+		is_component_build=false
+		is_debug=false
+
+		skia_use_egl=false
+		skia_use_dawn=false
+		skia_use_dng_sdk=false
+		skia_use_metal=false
+		skia_use_sfntly=false
+		skia_use_wuffs=false
+
+		skia_enable_pdf=false
+		skia_enable_svg=false
+		skia_use_expat=false
+		skia_use_ffmpeg=false
+		skia_use_fontconfig=false
+		skia_use_freetype=true
+		skia_use_gl=true
+		skia_use_harfbuzz=true
+		skia_use_icu=false
+		skia_use_libjpeg_turbo_decode=true
+		skia_use_libjpeg_turbo_encode=true
+		skia_use_libpng_decode=true
+		skia_use_libpng_encode=true
+		skia_use_libwebp_decode=$(usex webp true false)
+		skia_use_libwebp_encode=$(usex webp true false)
+		skia_use_lua=false
+		skia_use_vulkan=false
+		skia_use_x11=false
+		skia_use_xps=false
+		skia_use_zlib=true
+	)
+
+	passflags "${CFLAGS}" extra_cflags_c
+	passflags "${CXXFLAGS}" extra_cflags_cc
+	passflags "${LDFLAGS}" extra_ldflags
+	myconf_gn="${myconf_gn[@]}"
+	set -- gn gen --args="${myconf_gn% }" out/Static
+	echo "$@"
+	"$@" || die
+
+	einfo "Aseprite configuration"
+	cd "${WORKDIR}" || die
+
+	local mycmakeargs=(
+		-DENABLE_CCACHE=OFF
+		-DENABLE_DESKTOP_INTEGRATION=ON
+		-DENABLE_STEAM=OFF
+		-DENABLE_TESTS="$(usex test)"
+		-DENABLE_QT_THUMBNAILER="$(usex kde)"
+		-DENABLE_UPDATER=OFF
+		-DENABLE_UI=ON
+		-DENABLE_WEBP="$(usex webp)"
+		-DLAF_WITH_EXAMPLES=OFF
+		-DLAF_WITH_TESTS="$(usex test)"
+		-DFULLSCREEN_PLATFORM=ON
+		-DSKIA_DIR="${WORKDIR}/skia-${SKIA_REV}/"
+		-DSKIA_LIBRARY_DIR="${WORKDIR}/skia-${SKIA_REV}/out/Static/"
+		-DSKIA_LIBRARY="${WORKDIR}/skia-${SKIA_REV}/out/Static/libskia.a"
+		-DSKSHAPER_LIBRARY="${WORKDIR}/skia-${SKIA_REV}/out/Static/libskshaper.a"
+		-DUSE_SHARED_CMARK=ON
+		-DUSE_SHARED_CURL=ON
+		-DUSE_SHARED_FMT=ON
+		-DUSE_SHARED_FREETYPE=ON
+		-DUSE_SHARED_GIFLIB=ON
+		-DUSE_SHARED_HARFBUZZ=ON
+		-DUSE_SHARED_JPEGLIB=ON
+		-DUSE_SHARED_JSON11=OFF		# Custom methods added to bundled version
+		-DUSE_SHARED_LIBARCHIVE=ON
+		-DUSE_SHARED_LIBPNG=ON
+		-DUSE_SHARED_PIXMAN=ON
+		-DUSE_SHARED_TINYXML=ON
+		-DUSE_SHARED_WEBP=ON
+		-DUSE_SHARED_ZLIB=ON
+	)
+	cmake_src_configure
+}
+
+src_compile() {
+	einfo "Skia compilation"
+	cd "${WORKDIR}/skia-${SKIA_REV}" || die
+	eninja -C out/Static
+
+	einfo "Aseprite compilation"
+	cd "${WORKDIR}" || die
+	cmake_src_compile
+}
+
+src_install() {
+	newicon -s 64 "${S}/data/icons/ase64.png" "${PN}.png"
+	cmake_src_install
+}
+
+pkg_postinst() {
+	xdg_desktop_database_update
+	xdg_icon_cache_update
+	xdg_mimeinfo_database_update
+}
+
+pkg_postrm() {
+	xdg_desktop_database_update
+	xdg_icon_cache_update
+	xdg_mimeinfo_database_update
+}

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" <azamat.hackimov@gmail.com>
+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" <azamat.hackimov@gmail.com>
+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" <azamat.hackimov@gmail.com>
+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" <azamat.hackimov@gmail.com>
+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 <cstdio>
++#include <cstring>
+ #include <vector>
+ 
+ namespace dio {
+ 
++template <typename T>
++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<float*>(&v);
++  return *copy_reinterpret_cast<float*>(&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<double*>(&v);
++  return *copy_reinterpret_cast<double*>(&v);
+ }
+ 
+ doc::Palette* AsepriteDecoder::readColorChunk(doc::Palette* prevPal,
+-- 
+2.41.0
+


             reply	other threads:[~2024-01-07  0:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-07  0:20 Conrad Kostecki [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-16 14:18 [gentoo-commits] repo/gentoo:master commit in: dev-games/aseprite/files/, dev-games/aseprite/ Joonas Niilola
2023-02-22  7:42 Sam James
2022-12-24 14:49 Andreas Sturmlechner
2022-11-22 14:01 Joonas Niilola
2022-11-22 14:01 Joonas Niilola
2022-07-26 12:14 Joonas Niilola
2022-07-23  9:13 Joonas Niilola
2016-09-14 11:22 Patrice Clement
2016-04-21 20:12 Patrice Clement

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1704586776.774bfe9d9aeef263ee06d2baeb8769d662f70073.conikost@gentoo \
    --to=conikost@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox