2022-07-14 12:49:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, makeDesktopItem, copyDesktopItems, unzip
|
2023-07-15 17:15:38 +00:00
|
|
|
, appimage-run, nix-update-script }:
|
2022-07-14 12:49:19 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-07-14 12:49:19 +00:00
|
|
|
pname = "ldtk";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.3.3";
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-07-15 17:15:38 +00:00
|
|
|
url = "https://github.com/deepnight/ldtk/releases/download/v${finalAttrs.version}/ubuntu-distribution.zip";
|
|
|
|
hash = "sha256-egvAe4nAzPDBeTaAzrqhlDsG60bGNnKXB5Vt16vIZrQ";
|
2022-07-14 12:49:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip makeWrapper copyDesktopItems appimage-run ];
|
|
|
|
|
|
|
|
buildInputs = [ appimage-run ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
runHook preUnpack
|
|
|
|
|
|
|
|
unzip $src
|
2023-07-15 17:15:38 +00:00
|
|
|
appimage-run -x src 'LDtk ${finalAttrs.version} installer.AppImage'
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
runHook postUnpack
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
install -Dm644 'LDtk ${finalAttrs.version} installer.AppImage' $out/share/ldtk.AppImage
|
2022-07-14 12:49:19 +00:00
|
|
|
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" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Modern, lightweight and efficient 2D level editor";
|
2023-04-29 16:46:19 +00:00
|
|
|
homepage = "https://ldtk.io/";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/deepnight/ldtk/releases/tag/v${finalAttrs.version}";
|
2022-07-14 12:49:19 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = with maintainers; [ felschr ];
|
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|