about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2021-11-18 18:26:04 +0100
committerFrancesco Gazzetta <fgaz@fgaz.me>2021-11-19 15:09:48 +0100
commit6ac64dc1c403ce6fce6c00a59a46dedfe0b12160 (patch)
tree16d860dfe2365d021f780908d1ceb36bc1476fd0
parentda059cffc1eada2d25a7ef61a73597fc617f9337 (diff)
libresprite: init at 1.0
-rw-r--r--pkgs/applications/editors/libresprite/default.nix105
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 109 insertions, 0 deletions
diff --git a/pkgs/applications/editors/libresprite/default.nix b/pkgs/applications/editors/libresprite/default.nix
new file mode 100644
index 0000000000000..2221eded720c2
--- /dev/null
+++ b/pkgs/applications/editors/libresprite/default.nix
@@ -0,0 +1,105 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+
+, cmake
+, pkg-config
+, ninja
+, gtest
+
+, curl
+, freetype
+, giflib
+, libjpeg
+, libpng
+, libwebp
+, pixman
+, tinyxml
+, zlib
+, SDL2
+, SDL2_image
+, lua
+, AppKit
+, Cocoa
+, Foundation
+}:
+
+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
+  '';
+
+  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;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 38f71bc5e1632..7801bd038ee0b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -26421,6 +26421,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 { };