2021-01-19 06:50:56 +00:00
|
|
|
{ stdenv, lib, callPackage, fetchFromGitHub, fetchpatch, cmake, ninja, pkg-config
|
2019-06-04 13:16:34 +01:00
|
|
|
, curl, freetype, giflib, libjpeg, libpng, libwebp, pixman, tinyxml, zlib
|
|
|
|
, harfbuzzFull, glib, fontconfig, pcre
|
|
|
|
, libX11, libXext, libXcursor, libXxf86vm, libGL
|
2017-09-12 01:29:00 +01:00
|
|
|
, unfree ? false
|
|
|
|
, cmark
|
2013-09-28 15:57:14 +01:00
|
|
|
}:
|
|
|
|
|
2020-02-18 07:49:03 +00:00
|
|
|
# Unfree version is not redistributable:
|
|
|
|
# https://dev.aseprite.org/2016/09/01/new-source-code-license/
|
|
|
|
# Consider supporting the developer: https://aseprite.org/#buy
|
|
|
|
|
2019-06-04 13:16:34 +01:00
|
|
|
let
|
|
|
|
skia = callPackage ./skia.nix {};
|
|
|
|
in
|
2013-09-28 15:57:14 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "aseprite";
|
2020-02-18 07:49:03 +00:00
|
|
|
version = if unfree then "1.2.16.3" else "1.1.7";
|
2013-09-28 15:57:14 +01:00
|
|
|
|
2017-09-12 00:44:33 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aseprite";
|
|
|
|
repo = "aseprite";
|
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
2017-09-12 01:29:00 +01:00
|
|
|
sha256 = if unfree
|
2020-02-18 07:49:03 +00:00
|
|
|
then "16yn7y9xdc5jd50cq7bmsm320gv23pp71lr8hg2nmynzc8ibyda8"
|
2017-09-12 01:29:00 +01:00
|
|
|
else "0gd49lns2bpzbkwax5jf9x1xmg1j8ij997kcxr2596cwiswnw4di";
|
2013-09-28 15:57:14 +01:00
|
|
|
};
|
|
|
|
|
2019-06-04 13:16:34 +01:00
|
|
|
nativeBuildInputs = [
|
2021-01-19 06:50:56 +00:00
|
|
|
cmake pkg-config
|
2019-06-04 13:16:34 +01:00
|
|
|
] ++ lib.optionals unfree [ ninja ];
|
2017-09-12 00:44:33 +01:00
|
|
|
|
2013-09-28 15:57:14 +01:00
|
|
|
buildInputs = [
|
2019-06-04 13:16:34 +01:00
|
|
|
curl freetype giflib libjpeg libpng libwebp pixman tinyxml zlib
|
2017-09-12 00:44:33 +01:00
|
|
|
libX11 libXext libXcursor libXxf86vm
|
2019-06-04 13:16:34 +01:00
|
|
|
] ++ lib.optionals unfree [
|
|
|
|
cmark
|
|
|
|
harfbuzzFull glib fontconfig pcre
|
|
|
|
skia libGL
|
|
|
|
];
|
2018-09-10 03:39:28 +01:00
|
|
|
|
aseprite: fix build with glibc 2.30
Otherwise it fails with:
In file included from /build/source/src/allegro/include/allegro/base.h:41,
from /build/source/src/allegro/include/allegro.h:25,
from /build/source/src/./she/alleg4/alleg_surface.h:11,
from /build/source/src/she/alleg4/alleg_surface.cpp:11:
/build/source/src/allegro/include/allegro/alcompat.h:44:22: error: conflicting declaration of C function 'fixed fadd(fixed, fixed)'
44 | AL_ALIAS(fixed fadd(fixed x, fixed y), fixadd(x, y))
| ^~~~
/build/source/src/allegro/include/allegro/internal/alconfig.h:164:49: note: in definition of macro 'AL_ALIAS'
164 | static __attribute__((unused)) __inline__ DECL \
| ^~~~
In file included from /nix/store/y57skwl8a5vbkrjrc30ygdw9vr1p6n19-gcc-9.2.0/include/c++/9.2.0/cmath:45,
from /nix/store/y57skwl8a5vbkrjrc30ygdw9vr1p6n19-gcc-9.2.0/include/c++/9.2.0/math.h:36,
from /build/source/src/./base/base.h:13,
from /build/source/src/./config.h:40,
from /build/source/src/she/alleg4/alleg_surface.cpp:8:
/nix/store/2v6pi2wj3lcsc3j48n7flx9mgqyii1lv-glibc-2.30-dev/include/bits/mathcalls-narrow.h:24:20: note: previous declaration 'float fadd(double, double)'
24 | __MATHCALL_NARROW (__MATHCALL_NAME (add), __MATHCALL_REDIR_NAME (add), 2);
| ^~~~~~~~~~~~~~~
2020-02-18 06:05:09 +00:00
|
|
|
patches = if !unfree then [
|
|
|
|
./allegro-glibc-2.30.patch
|
|
|
|
] else [
|
2018-09-10 03:39:28 +01:00
|
|
|
(fetchpatch {
|
2019-06-04 13:16:34 +01:00
|
|
|
url = "https://github.com/lfont/aseprite/commit/f1ebc47012d3fed52306ed5922787b4b98cc0a7b.patch";
|
|
|
|
sha256 = "03xg7x6b9iv7z18vzlqxhcfphmx4v3qhs9f5rgf38ppyklca5jyw";
|
2018-09-10 03:39:28 +01:00
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/orivej/aseprite/commit/ea87e65b357ad0bd65467af5529183b5a48a8c17.patch";
|
|
|
|
sha256 = "1vwn8ivap1pzdh444sdvvkndp55iz146nhmd80xbm8cyzn3qmg91";
|
|
|
|
})
|
|
|
|
];
|
2017-09-12 01:29:00 +01:00
|
|
|
|
2017-09-30 12:15:53 +01:00
|
|
|
postPatch = ''
|
|
|
|
sed -i src/config.h -e "s-\\(#define VERSION\\) .*-\\1 \"$version\"-"
|
|
|
|
'';
|
|
|
|
|
2017-09-12 01:29:00 +01:00
|
|
|
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"
|
|
|
|
"-DWITH_DESKTOP_INTEGRATION=ON"
|
|
|
|
"-DWITH_WEBP_SUPPORT=ON"
|
|
|
|
] ++ lib.optionals unfree [
|
|
|
|
"-DUSE_SHARED_CMARK=ON"
|
2018-09-10 03:39:28 +01:00
|
|
|
"-DUSE_SHARED_HARFBUZZ=ON"
|
2017-09-12 01:29:00 +01:00
|
|
|
# Aseprite needs internal freetype headers.
|
|
|
|
"-DUSE_SHARED_FREETYPE=OFF"
|
|
|
|
# Disable libarchive programs.
|
|
|
|
"-DENABLE_CAT=OFF"
|
|
|
|
"-DENABLE_CPIO=OFF"
|
|
|
|
"-DENABLE_TAR=OFF"
|
2019-06-04 13:16:34 +01:00
|
|
|
# UI backend.
|
|
|
|
"-DLAF_OS_BACKEND=skia"
|
|
|
|
"-DSKIA_DIR=${skia}"
|
2013-09-28 15:57:14 +01:00
|
|
|
];
|
|
|
|
|
2017-09-12 05:50:16 +01:00
|
|
|
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
|
2017-09-12 01:29:00 +01:00
|
|
|
# Delete unneeded artifacts of bundled libraries.
|
2017-09-12 05:50:16 +01:00
|
|
|
rm -rf "$out"/include "$out"/lib
|
2013-09-28 15:57:14 +01:00
|
|
|
'';
|
|
|
|
|
2020-03-25 22:32:03 +00:00
|
|
|
passthru = { inherit skia; };
|
|
|
|
|
2017-09-12 01:29:00 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.aseprite.org/";
|
2017-09-12 00:44:33 +01:00
|
|
|
description = "Animated sprite editor & pixel art tool";
|
2017-09-12 01:29:00 +01:00
|
|
|
license = if unfree then licenses.unfree else licenses.gpl2;
|
2019-06-04 13:16:34 +01:00
|
|
|
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.
|
|
|
|
'' + lib.optionalString unfree
|
|
|
|
''
|
|
|
|
This version is not redistributable: https://dev.aseprite.org/2016/09/01/new-source-code-license/
|
|
|
|
Consider supporting the developer: https://aseprite.org/#buy
|
|
|
|
'';
|
2017-09-12 00:44:33 +01:00
|
|
|
maintainers = with maintainers; [ orivej ];
|
|
|
|
platforms = platforms.linux;
|
2013-09-28 15:57:14 +01:00
|
|
|
};
|
|
|
|
}
|