Merge pull request #146509 from fgaz/libresprite/init

This commit is contained in:
Sandro 2021-11-19 17:00:10 +01:00 committed by GitHub
commit 0cfcd37c77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 146 additions and 0 deletions

View File

@ -230,6 +230,7 @@ in
leaps = handleTest ./leaps.nix {};
libinput = handleTest ./libinput.nix {};
libreddit = handleTest ./libreddit.nix {};
libresprite = handleTest ./libresprite.nix {};
libreswan = handleTest ./libreswan.nix {};
lidarr = handleTest ./lidarr.nix {};
lightdm = handleTest ./lightdm.nix {};

View File

@ -0,0 +1,30 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "libresprite";
meta = with pkgs.lib.maintainers; {
maintainers = [ fgaz ];
};
machine = { config, pkgs, ... }: {
imports = [
./common/x11.nix
];
services.xserver.enable = true;
environment.systemPackages = [
pkgs.imagemagick
pkgs.libresprite
];
};
enableOCR = true;
testScript =
''
machine.wait_for_x()
machine.succeed("convert -font DejaVu-Sans +antialias label:'IT WORKS' image.png")
machine.execute("libresprite image.png >&2 &")
machine.wait_for_window("LibreSprite v${pkgs.libresprite.version}")
machine.wait_for_text("IT WORKS")
machine.screenshot("screen")
'';
})

View File

@ -0,0 +1,111 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, ninja
, gtest
, curl
, freetype
, giflib
, libjpeg
, libpng
, libwebp
, pixman
, tinyxml
, zlib
, SDL2
, SDL2_image
, lua
, AppKit
, Cocoa
, Foundation
, nixosTests
}:
stdenv.mkDerivation rec {
pname = "libresprite";
version = "1.0";
src = fetchFromGitHub {
owner = "LibreSprite";
repo = "LibreSprite";
rev = "v${version}";
fetchSubmodules = true;
sha256 = "sha256-d8GmVHYomDb74iSeEhJEVTHvbiVXggXg7xSqIKCUSzY=";
};
nativeBuildInputs = [
cmake
pkg-config
ninja
gtest
];
buildInputs = [
curl
freetype
giflib
libjpeg
libpng
libwebp
pixman
tinyxml
zlib
SDL2
SDL2_image
lua
# no v8 due to missing libplatform and libbase
] ++ lib.optionals stdenv.isDarwin [
AppKit
Cocoa
Foundation
];
cmakeFlags = [
"-DWITH_DESKTOP_INTEGRATION=ON"
"-DWITH_WEBP_SUPPORT=ON"
];
hardeningDisable = lib.optional stdenv.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
'';
passthru.tests = {
libresprite-can-open-png = nixosTests.libresprite;
};
meta = with lib; {
homepage = "https://libresprite.github.io/";
description = "Animated sprite editor & pixel art tool, fork of Aseprite";
license = licenses.gpl2Only;
longDescription =
''LibreSprite 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 maintainers; [ fgaz ];
platforms = platforms.all;
# https://github.com/LibreSprite/LibreSprite/issues/308
broken = stdenv.isDarwin && stdenv.isAarch64;
};
}

View File

@ -26430,6 +26430,10 @@ with pkgs;
});
libreoffice-still-unwrapped = libreoffice-still.libreoffice;
libresprite = callPackage ../applications/editors/libresprite {
inherit (darwin.apple_sdk.frameworks) AppKit Cocoa Foundation;
};
libvmi = callPackage ../development/libraries/libvmi { };
libutp = callPackage ../applications/networking/p2p/libutp { };