ldtk: use finalAttrs pattern with mkDerivation instead of rec

This commit is contained in:
Felix Schröter 2023-06-08 21:05:20 +02:00
parent efa1227dca
commit 24114b5f83
No known key found for this signature in database
GPG Key ID: 671E39E6744C807D

View File

@ -1,12 +1,12 @@
{ lib, stdenv, fetchurl, makeWrapper, makeDesktopItem, copyDesktopItems, unzip
, appimage-run }:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "ldtk";
version = "1.3.3";
src = fetchurl {
url = "https://github.com/deepnight/ldtk/releases/download/v${version}/ubuntu-distribution.zip";
url = "https://github.com/deepnight/ldtk/releases/download/v${finalAttrs.version}/ubuntu-distribution.zip";
hash = "sha256-egvAe4nAzPDBeTaAzrqhlDsG60bGNnKXB5Vt16vIZrQ";
};
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
runHook preUnpack
unzip $src
appimage-run -x src 'LDtk ${version} installer.AppImage'
appimage-run -x src 'LDtk ${finalAttrs.version} installer.AppImage'
runHook postUnpack
'';
@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
installPhase = ''
runHook preInstall
install -Dm644 'LDtk ${version} installer.AppImage' $out/share/ldtk.AppImage
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/1024x1024/apps/ldtk.png
@ -50,10 +50,10 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "Modern, lightweight and efficient 2D level editor";
homepage = "https://ldtk.io/";
changelog = "https://github.com/deepnight/ldtk/releases/tag/v${version}";
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 ];
};
}
})