Merge pull request #317258 from vigress8/upd-aseprite

aseprite: 1.3.6 -> 1.3.7
This commit is contained in:
superherointj 2024-06-17 12:21:32 -03:00 committed by GitHub
commit 62431fd38d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 438 additions and 235 deletions

View File

@ -21822,6 +21822,12 @@
githubId = 5837359;
name = "Adrian Pistol";
};
vigress8 = {
email = "vig@disroot.org";
github = "vigress8";
githubId = 150687949;
name = "Vigress";
};
vikanezrimaya = {
email = "vika@fireburn.ru";
github = "vikanezrimaya";

View File

@ -1,112 +0,0 @@
{ 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, libXi
, cmark
}:
# Unfree version is not redistributable:
# https://dev.aseprite.org/2016/09/01/new-source-code-license/
# Consider supporting the developer: https://aseprite.org/#buy
let
skia = callPackage ./skia.nix {};
in
stdenv.mkDerivation rec {
pname = "aseprite";
version = "1.3.6";
src = fetchFromGitHub {
owner = "aseprite";
repo = "aseprite";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-17f6pIGsOIswnyY63pjHKEEYuCo43kf25mPLBv4vQAs=";
};
nativeBuildInputs = [
cmake pkg-config ninja
];
buildInputs = [
curl freetype giflib libjpeg libpng libwebp pixman tinyxml zlib
libX11 libXext libXcursor libXxf86vm
cmark
harfbuzzFull glib fontconfig pcre
skia libGL libXi
];
patches = [
./shared-libwebp.patch
./shared-skia-deps.patch
];
postPatch = ''
sed -i src/ver/CMakeLists.txt -e "s-set(VERSION \".*\")-set(VERSION \"$version\")-"
'';
cmakeFlags = [
"-DENABLE_UPDATER=OFF"
"-DUSE_SHARED_CURL=ON"
"-DUSE_SHARED_FREETYPE=ON"
"-DUSE_SHARED_GIFLIB=ON"
"-DUSE_SHARED_JPEGLIB=ON"
"-DUSE_SHARED_LIBPNG=ON"
"-DUSE_SHARED_LIBWEBP=ON"
"-DUSE_SHARED_PIXMAN=ON"
"-DUSE_SHARED_TINYXML=ON"
"-DUSE_SHARED_ZLIB=ON"
"-DUSE_SHARED_CMARK=ON"
"-DUSE_SHARED_HARFBUZZ=ON"
"-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 = ''
# Install desktop icons.
src="$out/share/aseprite/data/icons"
for size in 16 32 48 64; do
dst="$out"/share/icons/hicolor/"$size"x"$size"
install -Dm644 "$src"/ase"$size".png "$dst"/apps/aseprite.png
install -Dm644 "$src"/doc"$size".png "$dst"/mimetypes/aseprite.png
done
# Delete unneeded artifacts of bundled libraries.
rm -rf "$out"/include "$out"/lib
'';
passthru = { inherit skia; };
meta = with lib; {
homepage = "https://www.aseprite.org/";
description = "Animated sprite editor & pixel art tool";
license = licenses.unfree;
longDescription =
''Aseprite is a program to create animated sprites. Its main features are:
- Sprites are composed by layers & frames (as separated concepts).
- Supported color modes: RGBA, Indexed (palettes up to 256 colors), and Grayscale.
- Load/save sequence of PNG files and GIF animations (and FLC, FLI, JPG, BMP, PCX, TGA).
- Export/import animations to/from Sprite Sheets.
- Tiled drawing mode, useful to draw patterns and textures.
- Undo/Redo for every operation.
- Real-time animation preview.
- Multiple editors support.
- Pixel-art specific tools like filled Contour, Polygon, Shading mode, etc.
- Onion skinning.
This version is not redistributable: https://dev.aseprite.org/2016/09/01/new-source-code-license/
Consider supporting the developer: https://aseprite.org/#buy
'';
maintainers = with maintainers; [ orivej ];
platforms = platforms.linux;
};
}

View File

@ -1,37 +0,0 @@
#!/usr/bin/env bash
FILTER=$1
OUT=skia-deps.nix
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')
function write_fetch_defs ()
{
while read -r DEP; do
NAME=$(echo "$DEP" | cut -d: -f1 | cut -d/ -f3 | sed 's/ //g')
URL=$(echo "$DEP" | cut -d: -f2- | cut -d@ -f1 | sed 's/ //g')
REV=$(echo "$DEP" | cut -d: -f2- | cut -d@ -f2 | sed 's/[ ,]//g')
echo "Fetching $NAME@$REV"
PREFETCH=$(nix-prefetch-git --rev "$REV" "$URL")
(
cat <<EOF
$NAME = fetchgit {
url = "$URL";
rev = "$REV";
sha256 = $(echo $PREFETCH | jq '.sha256');
};
EOF
) >> "$OUT"
echo "----------"
echo
done <<< "$1"
}
echo "{ fetchgit }:" > "$OUT"
echo "{" >> "$OUT"
write_fetch_defs "$(echo "$THIRD_PARTY_DEPS" | grep -E "$FILTER")"
echo "}" >> "$OUT"

View File

@ -1,80 +0,0 @@
{ stdenv, lib, fetchFromGitHub, fetchgit, python3, gn, ninja
, fontconfig, expat, icu, libglvnd, libjpeg, libpng, libwebp, zlib
, 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; };
in
stdenv.mkDerivation {
pname = "skia";
version = "aseprite-m102";
src = fetchFromGitHub {
owner = "aseprite";
repo = "skia";
# latest commit from aseprite-m102 branch
rev = "861e4743af6d9bf6077ae6dda7274e5a136ee4e2";
hash = "sha256-IlZbalmHl549uDUfPG8hlzub8TLWhG0EsV6HVAPdsl0=";
};
nativeBuildInputs = [ python3 gn ninja ];
buildInputs = [
fontconfig expat icu libglvnd libjpeg libpng libwebp zlib
mesa libX11 harfbuzzFull
];
preConfigure = with depSrcs; ''
mkdir -p third_party/externals
ln -s ${angle2} third_party/externals/angle2
ln -s ${dng_sdk} third_party/externals/dng_sdk
ln -s ${piex} third_party/externals/piex
ln -s ${sfntly} third_party/externals/sfntly
'';
configurePhase = ''
runHook preConfigure
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 modules
runHook postBuild
'';
installPhase = ''
mkdir -p $out
# Glob will match all subdirs.
shopt -s globstar
# All these paths are used in some way when building aseprite.
cp -r --parents -t $out/ \
include/codec \
include/config \
include/core \
include/effects \
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
'';
meta = with lib; {
description = "Skia is a complete 2D graphic library for drawing Text, Geometries, and Images";
homepage = "https://skia.org/";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
platforms = platforms.all;
};
}

View File

@ -0,0 +1,171 @@
{
clangStdenv,
cmake,
cmark,
curl,
fetchFromGitHub,
fetchpatch,
fmt,
fontconfig,
freetype,
giflib,
gitUpdater,
glib,
harfbuzzFull,
lib,
libGL,
libjpeg,
libpng,
libwebp,
libX11,
libXcursor,
libXext,
libXi,
libXxf86vm,
ninja,
pcre2,
pixman,
pkg-config,
skia-aseprite,
tinyxml-2,
zlib,
}:
clangStdenv.mkDerivation (finalAttrs: {
pname = "aseprite";
version = "1.3.7";
src = fetchFromGitHub {
owner = "aseprite";
repo = "aseprite";
rev = "v" + finalAttrs.version;
fetchSubmodules = true;
hash = "sha256-75kYJXmyags0cW2D5Ksq1uUrFSCAkFOdmn7Ya/6jLXc=";
};
nativeBuildInputs = [
cmake
ninja
pkg-config
];
buildInputs = [
cmark
curl
fmt
fontconfig
freetype
giflib
glib
harfbuzzFull
libGL
libjpeg
libpng
libwebp
libX11
libXcursor
libXext
libXi
libXxf86vm
pcre2
pixman
skia-aseprite
tinyxml-2
zlib
];
patches = [
# https://github.com/aseprite/aseprite/issues/4486
# FIXME: remove on next release.
(fetchpatch {
name = "ENABLE_UPDATER-fix.patch";
url = "https://github.com/aseprite/aseprite/commit/8fce589.patch";
hash = "sha256-DbL6kK//gQXbsXEn/t+KTuoM7E9ocPAsVqEO+lYrka4=";
})
./shared-fmt.patch
./shared-libwebp.patch
./shared-skia-deps.patch
];
postPatch =
let
# Translation strings
strings = fetchFromGitHub {
owner = "aseprite";
repo = "strings";
rev = "e18a09fefbb6cd904e506183d5fbe08558a52ed4";
hash = "sha256-GyCCxbhgf0vST20EH/+KkNLrF+U9Xzgpxlao8s925PQ=";
};
in
''
sed -i src/ver/CMakeLists.txt -e "s-set(VERSION \".*\")-set(VERSION \"$version\")-"
rm -rf data/strings
cp -r ${strings} data/strings
'';
cmakeFlags = [
"-DENABLE_DESKTOP_INTEGRATION=ON"
"-DENABLE_UPDATER=OFF"
"-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_LIBPNG=ON"
"-DUSE_SHARED_LIBWEBP=ON"
"-DUSE_SHARED_PIXMAN=ON"
"-DUSE_SHARED_TINYXML=ON"
"-DUSE_SHARED_WEBP=ON"
"-DUSE_SHARED_ZLIB=ON"
# Disable libarchive programs.
"-DENABLE_CAT=OFF"
"-DENABLE_CPIO=OFF"
"-DENABLE_TAR=OFF"
# UI backend.
"-DLAF_OS_BACKEND=skia"
"-DLAF_WITH_EXAMPLES=OFF"
"-DSKIA_DIR=${skia-aseprite}"
"-DSKIA_LIBRARY_DIR=${skia-aseprite}/lib"
];
postInstall = ''
# Install desktop icons.
src="$out/share/aseprite/data/icons"
for size in 16 32 48 64 128 256; do
dst="$out"/share/icons/hicolor/"$size"x"$size"
install -Dm644 "$src"/ase"$size".png "$dst"/apps/aseprite.png
install -Dm644 "$src"/doc"$size".png "$dst"/mimetypes/image-x-aseprite.png
done
# Delete unneeded artifacts of bundled libraries.
rm -rf "$out"/{include,lib,man}
'';
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
meta = {
homepage = "https://www.aseprite.org/";
description = "Animated sprite editor & pixel art tool";
license = lib.licenses.unfree;
longDescription = ''
Aseprite is a program to create animated sprites. Its main features are:
- Sprites are composed by layers & frames (as separated concepts).
- Supported color modes: RGBA, Indexed (palettes up to 256 colors), and Grayscale.
- Load/save sequence of PNG files and GIF animations (and FLC, FLI, JPG, BMP, PCX, TGA).
- Export/import animations to/from Sprite Sheets.
- Tiled drawing mode, useful to draw patterns and textures.
- Undo/Redo for every operation.
- Real-time animation preview.
- Multiple editors support.
- Pixel-art specific tools like filled Contour, Polygon, Shading mode, etc.
- Onion skinning.
'';
maintainers = with lib.maintainers; [
orivej
vigress8
];
platforms = lib.platforms.linux;
};
})

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)

View File

@ -3,21 +3,21 @@
angle2 = fetchgit {
url = "https://chromium.googlesource.com/angle/angle.git";
rev = "8718783526307a3fbb35d4c1ad4e8101262a0d73";
sha256 = "0c90q8f4syvwcayw58743sa332dcpkmblwh3ffkjqn5ygym04xji";
hash = "sha256-UXYCqn++WCyncwNyuuq8rIkxlB7koMK9Ynx7TRzCIDE=";
};
dng_sdk = fetchgit {
url = "https://android.googlesource.com/platform/external/dng_sdk.git";
rev = "c8d0c9b1d16bfda56f15165d39e0ffa360a11123";
sha256 = "1nlq082aij7q197i5646bi4vd2il7fww6sdwhqisv2cs842nyfwm";
hash = "sha256-lTtvBUGaia0jhrxpw7k7NIq2SVyGmBJPCvjIqAQCmNo=";
};
piex = fetchgit {
url = "https://android.googlesource.com/platform/external/piex.git";
rev = "bb217acdca1cc0c16b704669dd6f91a1b509c406";
sha256 = "05ipmag6k55jmidbyvg5mkqm69zfw03gfkqhi9jnjlmlbg31y412";
hash = "sha256-IhAfxlu0UmllihBP9wbg7idT8azlbb9arLKUaZ6qNxY=";
};
sfntly = fetchgit {
url = "https://chromium.googlesource.com/external/github.com/googlei18n/sfntly.git";
rev = "b55ff303ea2f9e26702b514cf6a3196a2e3e2974";
sha256 = "1qi5rfzmwfrji46x95g6dsb03i1v26700kifl2hpgm3pqhr7afpz";
hash = "sha256-/zp1MsR31HehoC5OAI4RO8QBlm7mldQNiTI7Xr/LJeI=";
};
}

View File

@ -0,0 +1,115 @@
{
aseprite,
clangStdenv,
expat,
fetchFromGitHub,
fetchgit,
fontconfig,
gn,
harfbuzzFull,
icu,
lib,
libglvnd,
libjpeg,
libpng,
libwebp,
libX11,
mesa,
ninja,
python3,
zlib,
}:
let
# deps.nix is generated by ./update.sh
depSrcs = import ./deps.nix { inherit fetchgit; };
in
clangStdenv.mkDerivation (finalAttrs: {
pname = "skia-aseprite";
version = "m102-861e4743af";
src = fetchFromGitHub {
owner = "aseprite";
repo = "skia";
rev = finalAttrs.version;
hash = "sha256-IlZbalmHl549uDUfPG8hlzub8TLWhG0EsV6HVAPdsl0=";
};
nativeBuildInputs = [
gn
ninja
python3
];
preConfigure = with depSrcs; ''
mkdir -p third_party/externals
ln -s ${angle2} third_party/externals/angle2
ln -s ${dng_sdk} third_party/externals/dng_sdk
ln -s ${piex} third_party/externals/piex
ln -s ${sfntly} third_party/externals/sfntly
'';
configurePhase = ''
runHook preConfigure
gn gen lib --args="is_debug=false is_official_build=true extra_cflags=[\"-I${harfbuzzFull.dev}/include/harfbuzz\"]"
runHook postConfigure
'';
buildInputs = [
expat
fontconfig
harfbuzzFull
icu
libglvnd
libjpeg
libpng
libwebp
libX11
mesa
zlib
];
buildPhase = ''
runHook preBuild
ninja -C lib skia modules
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
# Glob will match all subdirs.
shopt -s globstar
# All these paths are used in some way when building Aseprite.
cp -r --parents -t $out/ \
include/codec \
include/config \
include/core \
include/effects \
include/gpu \
include/private \
include/utils \
include/third_party/skcms/*.h \
lib/*.a \
modules/skshaper/include/*.h \
src/core/*.h \
src/gpu/**/*.h \
third_party/externals/angle2/include \
third_party/skcms/**/*.h
runHook postInstall
'';
passthru.updateScript = [ ./update.sh ] ++ builtins.attrNames depSrcs;
meta = {
description = "Complete 2D graphic library for drawing Text, Geometries, and Images (Aseprite's fork)";
homepage = "https://skia.org/";
downloadPage = "https://github.com/aseprite/skia";
license = lib.licenses.bsd3;
inherit (aseprite.meta) maintainers;
platforms = lib.platforms.all;
};
})

View File

@ -0,0 +1,71 @@
#!/usr/bin/env nix-shell
#!nix-shell --pure -i bash
#!nix-shell -p cacert curl git jq nix-prefetch-git
# shellcheck shell=bash
# vim: set tabstop=2 shiftwidth=2 expandtab:
set -euo pipefail
shopt -s inherit_errexit
[ $# -gt 0 ] || {
printf >&2 'usage: %s <deps>' "$0"
exit 1
}
pkgpath=$(git rev-parse --show-toplevel)/pkgs/by-name/sk/skia-aseprite
depfilter=$(tr ' ' '|' <<< "$*")
depfile=$pkgpath/deps.nix
pkgfile=$pkgpath/package.nix
update_deps() {
local deps third_party_deps name url rev hash prefetch
version=$(sed -n 's|.*version = "\(.*\)".*|\1|p' < "$pkgfile")
deps=$(curl -fsS https://raw.githubusercontent.com/aseprite/skia/$version/DEPS)
third_party_deps=$(sed -n 's|[ ",]||g; s|:| |; s|@| |; s|^third_party/externals/||p' <<< "$deps")
filtered=$(grep -E -- "$depfilter" <<< "$third_party_deps")
if [[ -z $filtered ]]; then
printf >&2 '%s: error: filter "%s" matched nothing' "$0" "$depfilter"
return 1
fi
printf '{ fetchgit }:\n{\n'
while read -r name url rev; do
printf >&2 'Fetching %s@%s\n' "$name" "$rev"
prefetch=$(nix-prefetch-git --quiet --rev "$rev" "$url")
hash=$(jq -r '.hash' <<< "$prefetch")
cat << EOF
$name = fetchgit {
url = "$url";
rev = "$rev";
hash = "$hash";
};
EOF
# `read` could exit with a non-zero code without a newline at the end
done < <(printf '%s\n' "$filtered")
printf '}\n'
}
update_version() {
local newver newrev
newver=$(
curl --fail \
--header 'Accept: application/vnd.github+json' \
--location --show-error --silent \
${GITHUB_TOKEN:+ --user \":$GITHUB_TOKEN\"} \
https://api.github.com/repos/aseprite/skia/releases/latest \
| jq -r .tag_name
)
newhash=$(nix-prefetch-git --quiet --rev "$newver" https://github.com/aseprite/skia.git | jq -r '.hash')
sed \
-e 's|version = ".*"|version = "'$newver'"|' \
-e 's|hash = ".*"|hash = "'$newhash'"|' \
-- "$pkgfile"
}
temp=$(mktemp)
trap 'ret=$?; rm -rf -- "$temp"; exit $ret' EXIT
update_version > "$temp"
cp "$temp" "$pkgfile"
update_deps > "$temp"
cp "$temp" "$depfile"

View File

@ -29569,8 +29569,6 @@ with pkgs;
asap = callPackage ../tools/audio/asap { };
aseprite = callPackage ../applications/editors/aseprite { };
assign-lb-ip = callPackage ../applications/networking/cluster/assign-lb-ip { };
astroid = callPackage ../applications/networking/mailreaders/astroid {