mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 03:30:45 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
63 lines
1.7 KiB
Nix
63 lines
1.7 KiB
Nix
{ lib, stdenv, fetchurl, makeWrapper, makeDesktopItem, copyDesktopItems, unzip
|
|
, appimage-run, nix-update-script }:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "ldtk";
|
|
version = "1.5.3";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/deepnight/ldtk/releases/download/v${finalAttrs.version}/ubuntu-distribution.zip";
|
|
hash = "sha256-i7HIcKs10srfvwihGdMEnnmGoqgFWNJhC6vGf81QJWY=";
|
|
};
|
|
|
|
nativeBuildInputs = [ unzip makeWrapper copyDesktopItems appimage-run ];
|
|
|
|
buildInputs = [ appimage-run ];
|
|
|
|
unpackPhase = ''
|
|
runHook preUnpack
|
|
|
|
unzip $src
|
|
appimage-run -x src 'LDtk ${finalAttrs.version} installer.AppImage'
|
|
|
|
runHook postUnpack
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
install -Dm644 'LDtk ${finalAttrs.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/512x512/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" ];
|
|
})
|
|
];
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = with lib; {
|
|
description = "Modern, lightweight and efficient 2D level editor";
|
|
homepage = "https://ldtk.io/";
|
|
changelog = "https://github.com/deepnight/ldtk/releases/tag/v${finalAttrs.version}";
|
|
license = licenses.mit;
|
|
platforms = [ "x86_64-linux" ];
|
|
maintainers = with maintainers; [ felschr ];
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
|
mainProgram = "ldtk";
|
|
};
|
|
})
|