ltris: refactor

- finalAttrs design pattern
- get rid of nested with
- set meta.mainProgram
This commit is contained in:
Anderson Torres 2024-02-24 23:46:41 -03:00
parent ad383118e3
commit 39ba389b87

View file

@ -1,17 +1,17 @@
{ lib
, stdenv
, fetchurl
, SDL
, SDL_mixer
, directoryListingUpdater
, fetchurl
, stdenv
}:
stdenv.mkDerivation rec {
pname = "ltris";
stdenv.mkDerivation (finalAttrs: {
pname = "lgames-ltris";
version = "1.2.7";
src = fetchurl {
url = "mirror://sourceforge/lgames/${pname}-${version}.tar.gz";
url = "mirror://sourceforge/lgames/ltris-${finalAttrs.version}.tar.gz";
hash = "sha256-EpHGpkLQa57hU6wKLnhVosmD6DnGGPGilN8E2ClSXLA=";
};
@ -23,17 +23,18 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "format" ];
passthru.updateScript = directoryListingUpdater {
inherit pname version;
inherit (finalAttrs) pname version;
url = "https://lgames.sourceforge.io/LTris/";
extraRegex = "(?!.*-win(32|64)).*";
};
meta = with lib; {
meta = {
homepage = "https://lgames.sourceforge.io/LTris/";
description = "Tetris clone from the LGames series";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ AndersonTorres ciil ];
license = with lib.licenses; [ gpl2Plus ];
mainProgram = "ltris";
maintainers = with lib.maintainers; [ AndersonTorres ];
inherit (SDL.meta) platforms;
broken = stdenv.isDarwin;
};
}
})