From eeaa0526a32383470a2160fa598237b3623a5d68 Mon Sep 17 00:00:00 2001 From: kyren Date: Tue, 8 Nov 2022 08:18:32 -0500 Subject: [PATCH] aseprite-unfree: 1.2.16.3 -> 1.2.40 Also updates aseprite skia fork and skia deps, includes the following patches from AUR: - shared-libwebp.patch - shared-skia-deps.patch --- .../applications/editors/aseprite/default.nix | 38 +++++++-------- .../editors/aseprite/shared-libwebp.patch | 47 +++++++++++++++++++ .../editors/aseprite/shared-skia-deps.patch | 21 +++++++++ .../editors/aseprite/skia-deps.nix | 12 ++--- .../editors/aseprite/skia-make-deps.sh | 2 +- pkgs/applications/editors/aseprite/skia.nix | 31 +++++------- 6 files changed, 106 insertions(+), 45 deletions(-) create mode 100644 pkgs/applications/editors/aseprite/shared-libwebp.patch create mode 100644 pkgs/applications/editors/aseprite/shared-skia-deps.patch diff --git a/pkgs/applications/editors/aseprite/default.nix b/pkgs/applications/editors/aseprite/default.nix index 58342ab1393a..99a1c8adec43 100644 --- a/pkgs/applications/editors/aseprite/default.nix +++ b/pkgs/applications/editors/aseprite/default.nix @@ -1,7 +1,7 @@ -{ stdenv, lib, callPackage, fetchFromGitHub, fetchpatch, cmake, ninja, pkg-config +{ stdenv, lib, callPackage, fetchFromGitHub, cmake, ninja, pkg-config , curl, freetype, giflib, libjpeg, libpng, libwebp, pixman, tinyxml, zlib , harfbuzzFull, glib, fontconfig, pcre -, libX11, libXext, libXcursor, libXxf86vm, libGL +, libX11, libXext, libXcursor, libXxf86vm, libGL, libXi , unfree ? false , cmark }: @@ -15,16 +15,16 @@ let in stdenv.mkDerivation rec { pname = "aseprite"; - version = if unfree then "1.2.16.3" else "1.1.7"; + version = if unfree then "1.2.40" else "1.1.7"; src = fetchFromGitHub { owner = "aseprite"; repo = "aseprite"; rev = "v${version}"; fetchSubmodules = true; - sha256 = if unfree - then "16yn7y9xdc5jd50cq7bmsm320gv23pp71lr8hg2nmynzc8ibyda8" - else "0gd49lns2bpzbkwax5jf9x1xmg1j8ij997kcxr2596cwiswnw4di"; + hash = if unfree + then "sha256-KUdJA6HTAKrLT8xrwFikVDbc5RODysclcsEyQekMRZo=" + else "sha256-sRFuuY6cmVRE7myelGREMrzaQ09Olq74XP8uoS1NpD0="; }; nativeBuildInputs = [ @@ -37,24 +37,20 @@ stdenv.mkDerivation rec { ] ++ lib.optionals unfree [ cmark harfbuzzFull glib fontconfig pcre - skia libGL + skia libGL libXi ]; - patches = if !unfree then [ + patches = lib.optionals (!unfree) [ ./allegro-glibc-2.30.patch - ] else [ - (fetchpatch { - url = "https://github.com/lfont/aseprite/commit/f1ebc47012d3fed52306ed5922787b4b98cc0a7b.patch"; - sha256 = "03xg7x6b9iv7z18vzlqxhcfphmx4v3qhs9f5rgf38ppyklca5jyw"; - }) - (fetchpatch { - url = "https://github.com/orivej/aseprite/commit/ea87e65b357ad0bd65467af5529183b5a48a8c17.patch"; - sha256 = "1vwn8ivap1pzdh444sdvvkndp55iz146nhmd80xbm8cyzn3qmg91"; - }) + ] ++ lib.optionals unfree [ + ./shared-libwebp.patch + ./shared-skia-deps.patch ]; - postPatch = '' + postPatch = if (!unfree) then '' sed -i src/config.h -e "s-\\(#define VERSION\\) .*-\\1 \"$version\"-" + '' else '' + sed -i src/ver/CMakeLists.txt -e "s-set(VERSION \".*\")-set(VERSION \"$version\")-" ''; cmakeFlags = [ @@ -73,15 +69,17 @@ stdenv.mkDerivation rec { ] ++ lib.optionals unfree [ "-DUSE_SHARED_CMARK=ON" "-DUSE_SHARED_HARFBUZZ=ON" - # Aseprite needs internal freetype headers. - "-DUSE_SHARED_FREETYPE=OFF" + "-DUSE_SHARED_WEBP=ON" # Disable libarchive programs. "-DENABLE_CAT=OFF" "-DENABLE_CPIO=OFF" "-DENABLE_TAR=OFF" # UI backend. + "-DLAF_WITH_EXAMPLES=OFF" "-DLAF_OS_BACKEND=skia" + "-DENABLE_DESKTOP_INTEGRATION=ON" "-DSKIA_DIR=${skia}" + "-DSKIA_LIBRARY_DIR=${skia}/out/Release" ]; postInstall = '' diff --git a/pkgs/applications/editors/aseprite/shared-libwebp.patch b/pkgs/applications/editors/aseprite/shared-libwebp.patch new file mode 100644 index 000000000000..20191f46b8b1 --- /dev/null +++ b/pkgs/applications/editors/aseprite/shared-libwebp.patch @@ -0,0 +1,47 @@ +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) +@@ -328,14 +351,17 @@ 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) + 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() +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() \ No newline at end of file diff --git a/pkgs/applications/editors/aseprite/shared-skia-deps.patch b/pkgs/applications/editors/aseprite/shared-skia-deps.patch new file mode 100644 index 000000000000..a6ab472bbe95 --- /dev/null +++ b/pkgs/applications/editors/aseprite/shared-skia-deps.patch @@ -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} \ No newline at end of file diff --git a/pkgs/applications/editors/aseprite/skia-deps.nix b/pkgs/applications/editors/aseprite/skia-deps.nix index e5655ca8315d..3c92c649bebf 100644 --- a/pkgs/applications/editors/aseprite/skia-deps.nix +++ b/pkgs/applications/editors/aseprite/skia-deps.nix @@ -2,13 +2,13 @@ { angle2 = fetchgit { url = "https://chromium.googlesource.com/angle/angle.git"; - rev = "956ab4d9fab36be9929e63829475d4d69b2c681c"; - sha256 = "0fcw04wwkn3ixr9l9k0d32n78r9g72p31ii9i5spsq2d0wlylr38"; + rev = "8718783526307a3fbb35d4c1ad4e8101262a0d73"; + sha256 = "0c90q8f4syvwcayw58743sa332dcpkmblwh3ffkjqn5ygym04xji"; }; dng_sdk = fetchgit { url = "https://android.googlesource.com/platform/external/dng_sdk.git"; - rev = "96443b262250c390b0caefbf3eed8463ba35ecae"; - sha256 = "1rsr7njhj7c5p87hfznj069fdc3qqhvvnq9sa2rb8c4q849rlzx6"; + rev = "c8d0c9b1d16bfda56f15165d39e0ffa360a11123"; + sha256 = "1nlq082aij7q197i5646bi4vd2il7fww6sdwhqisv2cs842nyfwm"; }; piex = fetchgit { url = "https://android.googlesource.com/platform/external/piex.git"; @@ -17,7 +17,7 @@ }; sfntly = fetchgit { url = "https://chromium.googlesource.com/external/github.com/googlei18n/sfntly.git"; - rev = "b18b09b6114b9b7fe6fc2f96d8b15e8a72f66916"; - sha256 = "0zf1h0dibmm38ldypccg4faacvskmd42vsk6zbxlfcfwjlqm6pp4"; + rev = "b55ff303ea2f9e26702b514cf6a3196a2e3e2974"; + sha256 = "1qi5rfzmwfrji46x95g6dsb03i1v26700kifl2hpgm3pqhr7afpz"; }; } diff --git a/pkgs/applications/editors/aseprite/skia-make-deps.sh b/pkgs/applications/editors/aseprite/skia-make-deps.sh index 5e12c4f5c858..bee69cc40d9d 100755 --- a/pkgs/applications/editors/aseprite/skia-make-deps.sh +++ b/pkgs/applications/editors/aseprite/skia-make-deps.sh @@ -2,7 +2,7 @@ FILTER=$1 OUT=skia-deps.nix -REVISION=89e4ca4352d05adc892f5983b108433f29b2c0c2 +REVISION=861e4743af6d9bf6077ae6dda7274e5a136ee4e2 DEPS=$(curl -s https://raw.githubusercontent.com/aseprite/skia/$REVISION/DEPS) THIRD_PARTY_DEPS=$(echo "$DEPS" | grep third_party | grep "#" -v | sed 's/"//g') diff --git a/pkgs/applications/editors/aseprite/skia.nix b/pkgs/applications/editors/aseprite/skia.nix index 2de61c7e20f1..71fa62157d8a 100644 --- a/pkgs/applications/editors/aseprite/skia.nix +++ b/pkgs/applications/editors/aseprite/skia.nix @@ -1,37 +1,29 @@ -{ stdenv, lib, fetchFromGitHub, fetchgit, python2, gn, ninja +{ stdenv, lib, fetchFromGitHub, fetchgit, python3, gn, ninja , fontconfig, expat, icu58, libglvnd, libjpeg, libpng, libwebp, zlib -, mesa, libX11 +, mesa, libX11, harfbuzzFull }: let # skia-deps.nix is generated by: ./skia-make-deps.sh 'angle2|dng_sdk|piex|sfntly' depSrcs = import ./skia-deps.nix { inherit fetchgit; }; - gnOld = gn.overrideAttrs (oldAttrs: rec { - version = "20190403"; - src = fetchgit { - url = "https://gn.googlesource.com/gn"; - rev = "64b846c96daeb3eaf08e26d8a84d8451c6cb712b"; - sha256 = "1v2kzsshhxn0ck6gd5w16gi2m3higwd9vkyylmsczxfxnw8skgpy"; - }; - }); in stdenv.mkDerivation { pname = "skia"; - version = "aseprite-m71"; + version = "aseprite-m102"; src = fetchFromGitHub { owner = "aseprite"; repo = "skia"; - # latest commit from aseprite-m71 branch - rev = "89e4ca4352d05adc892f5983b108433f29b2c0c2"; # TODO: Remove the gnOld override - sha256 = "0n3vrkswvi6rib9zv2pzi18h3j5wm7flmgkgaikcm6q7iw4l2c7x"; + # latest commit from aseprite-m102 branch + rev = "861e4743af6d9bf6077ae6dda7274e5a136ee4e2"; + hash = "sha256-IlZbalmHl549uDUfPG8hlzub8TLWhG0EsV6HVAPdsl0="; }; - nativeBuildInputs = [ python2 gnOld ninja ]; + nativeBuildInputs = [ python3 gn ninja ]; buildInputs = [ fontconfig expat icu58 libglvnd libjpeg libpng libwebp zlib - mesa libX11 + mesa libX11 harfbuzzFull ]; preConfigure = with depSrcs; '' @@ -44,13 +36,13 @@ stdenv.mkDerivation { configurePhase = '' runHook preConfigure - gn gen out/Release --args="is_debug=false is_official_build=true" + gn gen out/Release --args="is_debug=false is_official_build=true extra_cflags=[\"-I${harfbuzzFull.dev}/include/harfbuzz\"]" runHook postConfigure ''; buildPhase = '' runHook preBuild - ninja -C out/Release skia + ninja -C out/Release skia modules runHook postBuild ''; @@ -69,8 +61,11 @@ stdenv.mkDerivation { include/gpu \ include/private \ include/utils \ + include/third_party/skcms/*.h \ out/Release/*.a \ src/gpu/**/*.h \ + src/core/*.h \ + modules/skshaper/include/*.h \ third_party/externals/angle2/include \ third_party/skcms/**/*.h '';