nixpkgs/pkgs/applications/editors/aseprite/default.nix

71 lines
2 KiB
Nix
Raw Normal View History

2017-09-12 00:29:00 +00:00
{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig
2017-09-11 23:44:33 +00:00
, curl, freetype, giflib, libjpeg, libpng, libwebp, pixman, tinyxml, zlib
, libX11, libXext, libXcursor, libXxf86vm
2017-09-12 00:29:00 +00:00
, unfree ? false
, cmark
2013-09-28 14:57:14 +00:00
}:
2017-09-12 00:29:00 +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
2013-09-28 14:57:14 +00:00
stdenv.mkDerivation rec {
2017-09-11 23:44:33 +00:00
name = "aseprite-${version}";
2017-09-12 00:29:00 +00:00
version = if unfree then "1.2-beta12" else "1.1.7";
2013-09-28 14:57:14 +00:00
2017-09-11 23:44:33 +00:00
src = fetchFromGitHub {
owner = "aseprite";
repo = "aseprite";
rev = "v${version}";
fetchSubmodules = true;
2017-09-12 00:29:00 +00:00
sha256 = if unfree
then "1zgsr03d4vwdj2qyiwfwfqsbqngp85n13i3xwbkfkbja036c5yhc"
else "0gd49lns2bpzbkwax5jf9x1xmg1j8ij997kcxr2596cwiswnw4di";
2013-09-28 14:57:14 +00:00
};
2017-09-11 23:44:33 +00:00
nativeBuildInputs = [ cmake pkgconfig ];
2013-09-28 14:57:14 +00:00
buildInputs = [
2017-09-11 23:44:33 +00:00
curl freetype giflib libjpeg libpng libwebp pixman tinyxml zlib
libX11 libXext libXcursor libXxf86vm
2017-09-12 00:29:00 +00:00
] ++ lib.optionals unfree [ cmark ];
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"
# Aseprite needs internal freetype headers.
"-DUSE_SHARED_FREETYPE=OFF"
# Disable libarchive programs.
"-DENABLE_CAT=OFF"
"-DENABLE_CPIO=OFF"
"-DENABLE_TAR=OFF"
2013-09-28 14:57:14 +00:00
];
2017-09-12 00:29:00 +00:00
postInstall = lib.optionalString unfree ''
# Delete unneeded artifacts of bundled libraries.
rm -rf $out/include $out/lib
2013-09-28 14:57:14 +00:00
'';
2017-09-11 23:44:33 +00:00
enableParallelBuilding = true;
2013-09-28 14:57:14 +00:00
2017-09-12 00:29:00 +00:00
meta = with lib; {
homepage = https://www.aseprite.org/;
2017-09-11 23:44:33 +00:00
description = "Animated sprite editor & pixel art tool";
2017-09-12 00:29:00 +00:00
license = if unfree then licenses.unfree else licenses.gpl2;
2017-09-11 23:44:33 +00:00
maintainers = with maintainers; [ orivej ];
platforms = platforms.linux;
2013-09-28 14:57:14 +00:00
};
}