biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / editors / ldtk / default.nix
blob4e05fc2b39117db68506f00fe72245a8f323befe
1 { lib, stdenv, fetchurl, makeWrapper, makeDesktopItem, copyDesktopItems, unzip
2 , appimage-run, nix-update-script }:
4 stdenv.mkDerivation (finalAttrs: {
5   pname = "ldtk";
6   version = "1.5.3";
8   src = fetchurl {
9     url = "https://github.com/deepnight/ldtk/releases/download/v${finalAttrs.version}/ubuntu-distribution.zip";
10     hash = "sha256-i7HIcKs10srfvwihGdMEnnmGoqgFWNJhC6vGf81QJWY=";
11   };
13   nativeBuildInputs = [ unzip makeWrapper copyDesktopItems appimage-run ];
15   buildInputs = [ appimage-run ];
17   unpackPhase = ''
18     runHook preUnpack
20     unzip $src
21     appimage-run -x src 'LDtk ${finalAttrs.version} installer.AppImage'
23     runHook postUnpack
24   '';
26   installPhase = ''
27     runHook preInstall
29     install -Dm644 'LDtk ${finalAttrs.version} installer.AppImage' $out/share/ldtk.AppImage
30     makeWrapper ${appimage-run}/bin/appimage-run $out/bin/ldtk \
31       --add-flags $out/share/ldtk.AppImage
32     install -Dm644 src/ldtk.png $out/share/icons/hicolor/512x512/apps/ldtk.png
34     runHook postInstall
35   '';
37   desktopItems = [
38     (makeDesktopItem {
39       name = "ldtk";
40       exec = "ldtk";
41       icon = "ldtk";
42       terminal = false;
43       desktopName = "LDtk";
44       comment = "2D level editor";
45       categories = [ "Utility" ];
46       mimeTypes = [ "application/json" ];
47     })
48   ];
50   passthru.updateScript = nix-update-script { };
52   meta = with lib; {
53     description = "Modern, lightweight and efficient 2D level editor";
54     homepage = "https://ldtk.io/";
55     changelog = "https://github.com/deepnight/ldtk/releases/tag/v${finalAttrs.version}";
56     license = licenses.mit;
57     platforms = [ "x86_64-linux" ];
58     maintainers = with maintainers; [ felschr ];
59     sourceProvenance = with sourceTypes; [ binaryBytecode ];
60     mainProgram = "ldtk";
61   };