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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

114 lines
2.5 KiB
Nix
Raw Normal View History

2021-11-18 17:26:04 +00:00
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, ninja
, gtest
, curl
, freetype
, giflib
, libjpeg
, libpng
, libwebp
2024-11-17 14:07:57 +00:00
, libarchive
2021-11-18 17:26:04 +00:00
, pixman
2024-11-17 14:07:57 +00:00
, tinyxml-2
2021-11-18 17:26:04 +00:00
, zlib
, SDL2
, SDL2_image
, lua
, AppKit
, Cocoa
, Foundation
2021-11-18 18:10:48 +00:00
, nixosTests
2021-11-18 17:26:04 +00:00
}:
2024-02-19 14:50:14 +00:00
stdenv.mkDerivation (finalAttrs: {
2021-11-18 17:26:04 +00:00
pname = "libresprite";
2024-11-17 14:07:57 +00:00
version = "1.1";
2021-11-18 17:26:04 +00:00
src = fetchFromGitHub {
owner = "LibreSprite";
repo = "LibreSprite";
2024-02-19 14:50:14 +00:00
rev = "v${finalAttrs.version}";
2021-11-18 17:26:04 +00:00
fetchSubmodules = true;
2024-11-17 14:07:57 +00:00
hash = "sha256-piA/hLQqdfyVH4GPu5ElXZtowQL9AGaK7GhZOME4L0Q=";
2021-11-18 17:26:04 +00:00
};
nativeBuildInputs = [
cmake
pkg-config
ninja
gtest
];
buildInputs = [
curl
freetype
giflib
libjpeg
libpng
libwebp
2024-11-17 14:07:57 +00:00
libarchive
2021-11-18 17:26:04 +00:00
pixman
2024-11-17 14:07:57 +00:00
tinyxml-2
2021-11-18 17:26:04 +00:00
zlib
SDL2
SDL2_image
lua
# no v8 due to missing libplatform and libbase
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
AppKit
Cocoa
Foundation
];
cmakeFlags = [
"-DWITH_DESKTOP_INTEGRATION=ON"
"-DWITH_WEBP_SUPPORT=ON"
];
hardeningDisable = lib.optional stdenv.hostPlatform.isDarwin "format";
# Install mime icons. Note that the mimetype is still "x-aseprite"
postInstall = ''
src="$out/share/libresprite/data/icons"
for size in 16 32 48 64; do
dst="$out"/share/icons/hicolor/"$size"x"$size"
install -Dm644 "$src"/doc"$size".png "$dst"/mimetypes/aseprite.png
done
'';
2021-11-18 18:10:48 +00:00
passthru.tests = {
libresprite-can-open-png = nixosTests.libresprite;
};
2024-11-17 14:07:57 +00:00
meta = {
2021-11-18 17:26:04 +00:00
homepage = "https://libresprite.github.io/";
description = "Animated sprite editor & pixel art tool, fork of Aseprite";
2024-11-17 14:07:57 +00:00
license = lib.licenses.gpl2Only;
longDescription = ''
LibreSprite is a program to create animated sprites. Its main features are:
2021-11-18 17:26:04 +00:00
- 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.
'';
2024-11-17 14:07:57 +00:00
maintainers = with lib.maintainers; [ fgaz ];
platforms = lib.platforms.all;
2021-11-18 17:26:04 +00:00
# https://github.com/LibreSprite/LibreSprite/issues/308
2022-05-29 09:19:53 +01:00
broken = stdenv.hostPlatform.isDarwin;
2021-11-18 17:26:04 +00:00
};
2024-02-19 14:50:14 +00:00
})