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

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

59 lines
1.5 KiB
Nix
Raw Normal View History

2022-06-24 21:03:04 +00:00
{ lib, stdenv, fetchurl, makeWrapper, makeDesktopItem, copyDesktopItems, unzip
, appimage-run }:
stdenv.mkDerivation rec {
pname = "ldtk";
2023-01-06 18:39:05 +00:00
version = "1.2.3";
2022-06-24 21:03:04 +00:00
src = fetchurl {
url = "https://github.com/deepnight/ldtk/releases/download/v${version}/ubuntu-distribution.zip";
2023-01-06 18:39:05 +00:00
sha256 = "sha256-G54PQriKbm1fTqxD3J2O9bD4FBZuwqkfFPV+412nRGA=";
2022-06-24 21:03:04 +00:00
};
nativeBuildInputs = [ unzip makeWrapper copyDesktopItems appimage-run ];
buildInputs = [ appimage-run ];
unpackPhase = ''
runHook preUnpack
unzip $src
appimage-run -x src 'LDtk ${version} installer.AppImage'
runHook postUnpack
'';
installPhase = ''
runHook preInstall
install -Dm644 'LDtk ${version} installer.AppImage' $out/share/ldtk.AppImage
makeWrapper ${appimage-run}/bin/appimage-run $out/bin/ldtk \
--add-flags $out/share/ldtk.AppImage
install -Dm644 src/ldtk.png $out/share/icons/hicolor/1024x1024/apps/ldtk.png
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "ldtk";
exec = "ldtk";
icon = "ldtk";
terminal = false;
desktopName = "LDtk";
comment = "2D level editor";
categories = [ "Utility" ];
mimeTypes = [ "application/json" ];
})
];
meta = with lib; {
homepage = "https://ldtk.io/";
description = "Modern, lightweight and efficient 2D level editor";
license = licenses.mit;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ felschr ];
sourceProvenance = with sourceTypes; [ binaryBytecode ];
};
}