Merge pull request #146509 from fgaz/libresprite/init

authored by

Sandro and committed by
GitHub
0cfcd37c aa3130f1

+146
+1
nixos/tests/all-tests.nix
··· 230 230 leaps = handleTest ./leaps.nix {}; 231 231 libinput = handleTest ./libinput.nix {}; 232 232 libreddit = handleTest ./libreddit.nix {}; 233 + libresprite = handleTest ./libresprite.nix {}; 233 234 libreswan = handleTest ./libreswan.nix {}; 234 235 lidarr = handleTest ./lidarr.nix {}; 235 236 lightdm = handleTest ./lightdm.nix {};
+30
nixos/tests/libresprite.nix
··· 1 + import ./make-test-python.nix ({ pkgs, ... }: { 2 + name = "libresprite"; 3 + meta = with pkgs.lib.maintainers; { 4 + maintainers = [ fgaz ]; 5 + }; 6 + 7 + machine = { config, pkgs, ... }: { 8 + imports = [ 9 + ./common/x11.nix 10 + ]; 11 + 12 + services.xserver.enable = true; 13 + environment.systemPackages = [ 14 + pkgs.imagemagick 15 + pkgs.libresprite 16 + ]; 17 + }; 18 + 19 + enableOCR = true; 20 + 21 + testScript = 22 + '' 23 + machine.wait_for_x() 24 + machine.succeed("convert -font DejaVu-Sans +antialias label:'IT WORKS' image.png") 25 + machine.execute("libresprite image.png >&2 &") 26 + machine.wait_for_window("LibreSprite v${pkgs.libresprite.version}") 27 + machine.wait_for_text("IT WORKS") 28 + machine.screenshot("screen") 29 + ''; 30 + })
+111
pkgs/applications/editors/libresprite/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + 5 + , cmake 6 + , pkg-config 7 + , ninja 8 + , gtest 9 + 10 + , curl 11 + , freetype 12 + , giflib 13 + , libjpeg 14 + , libpng 15 + , libwebp 16 + , pixman 17 + , tinyxml 18 + , zlib 19 + , SDL2 20 + , SDL2_image 21 + , lua 22 + , AppKit 23 + , Cocoa 24 + , Foundation 25 + 26 + , nixosTests 27 + }: 28 + 29 + stdenv.mkDerivation rec { 30 + pname = "libresprite"; 31 + version = "1.0"; 32 + 33 + src = fetchFromGitHub { 34 + owner = "LibreSprite"; 35 + repo = "LibreSprite"; 36 + rev = "v${version}"; 37 + fetchSubmodules = true; 38 + sha256 = "sha256-d8GmVHYomDb74iSeEhJEVTHvbiVXggXg7xSqIKCUSzY="; 39 + }; 40 + 41 + nativeBuildInputs = [ 42 + cmake 43 + pkg-config 44 + ninja 45 + gtest 46 + ]; 47 + 48 + buildInputs = [ 49 + curl 50 + freetype 51 + giflib 52 + libjpeg 53 + libpng 54 + libwebp 55 + pixman 56 + tinyxml 57 + zlib 58 + SDL2 59 + SDL2_image 60 + lua 61 + # no v8 due to missing libplatform and libbase 62 + ] ++ lib.optionals stdenv.isDarwin [ 63 + AppKit 64 + Cocoa 65 + Foundation 66 + ]; 67 + 68 + cmakeFlags = [ 69 + "-DWITH_DESKTOP_INTEGRATION=ON" 70 + "-DWITH_WEBP_SUPPORT=ON" 71 + ]; 72 + 73 + hardeningDisable = lib.optional stdenv.isDarwin "format"; 74 + 75 + # Install mime icons. Note that the mimetype is still "x-aseprite" 76 + postInstall = '' 77 + src="$out/share/libresprite/data/icons" 78 + for size in 16 32 48 64; do 79 + dst="$out"/share/icons/hicolor/"$size"x"$size" 80 + install -Dm644 "$src"/doc"$size".png "$dst"/mimetypes/aseprite.png 81 + done 82 + ''; 83 + 84 + passthru.tests = { 85 + libresprite-can-open-png = nixosTests.libresprite; 86 + }; 87 + 88 + meta = with lib; { 89 + homepage = "https://libresprite.github.io/"; 90 + description = "Animated sprite editor & pixel art tool, fork of Aseprite"; 91 + license = licenses.gpl2Only; 92 + longDescription = 93 + ''LibreSprite is a program to create animated sprites. Its main features are: 94 + 95 + - Sprites are composed by layers & frames (as separated concepts). 96 + - Supported color modes: RGBA, Indexed (palettes up to 256 colors), and Grayscale. 97 + - Load/save sequence of PNG files and GIF animations (and FLC, FLI, JPG, BMP, PCX, TGA). 98 + - Export/import animations to/from Sprite Sheets. 99 + - Tiled drawing mode, useful to draw patterns and textures. 100 + - Undo/Redo for every operation. 101 + - Real-time animation preview. 102 + - Multiple editors support. 103 + - Pixel-art specific tools like filled Contour, Polygon, Shading mode, etc. 104 + - Onion skinning. 105 + ''; 106 + maintainers = with maintainers; [ fgaz ]; 107 + platforms = platforms.all; 108 + # https://github.com/LibreSprite/LibreSprite/issues/308 109 + broken = stdenv.isDarwin && stdenv.isAarch64; 110 + }; 111 + }
+4
pkgs/top-level/all-packages.nix
··· 26430 26430 }); 26431 26431 libreoffice-still-unwrapped = libreoffice-still.libreoffice; 26432 26432 26433 + libresprite = callPackage ../applications/editors/libresprite { 26434 + inherit (darwin.apple_sdk.frameworks) AppKit Cocoa Foundation; 26435 + }; 26436 + 26433 26437 libvmi = callPackage ../development/libraries/libvmi { }; 26434 26438 26435 26439 libutp = callPackage ../applications/networking/p2p/libutp { };