Commit 9d511f87 authored by Anderson Torres's avatar Anderson Torres
Browse files

blockattack: refactor

- finalAttrs
- strictDeps
- split outputs
- no nested with in meta
- updateScript
parent 446bb88b
Loading
Loading
Loading
Loading
+24 −10
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, SDL2
, SDL2_image
, SDL2_mixer
, SDL2_ttf
, boost
, cmake
, fetchFromGitHub
, gettext
, gitUpdater
, physfs
, pkg-config
, stdenv
, zip
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "blockattack";
  version = "2.8.0";

  src = fetchFromGitHub {
    owner = "blockattack";
    repo = "blockattack-game";
    rev = "v${version}";
    rev = "v${finalAttrs.version}";
    hash = "sha256-2oKesdr2eNZhDlGrFRiH5/8APFkGJfxPCNvzFoIumdQ=";
  };

  nativeBuildInputs = [
    SDL2
    cmake
    pkg-config
    gettext
@@ -41,19 +43,31 @@ stdenv.mkDerivation rec {
    physfs
  ];

  outputs = [
    "out"
    "man"
  ];

  strictDeps = true;

  preConfigure = ''
    patchShebangs packdata.sh source/misc/translation/*.sh
    chmod +x ./packdata.sh
    ./packdata.sh
  '';

  meta = with lib; {
  passthru = {
    updateScript = gitUpdater { };
  };

  meta = {
    homepage = "https://blockattack.net/";
    description = "An open source clone of Panel de Pon (aka Tetris Attack)";
    mainProgram = "blockattack";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ AndersonTorres ];
    platforms = platforms.unix;
    broken = stdenv.isDarwin;
    changelog = "https://github.com/blockattack/blockattack-game/blob/${finalAttrs.src.rev}/CHANGELOG.md";
    license = with lib.licenses; [ gpl2Plus ];
    mainProgram = "blockattack";
    maintainers = with lib.maintainers; [ AndersonTorres ];
    inherit (SDL2.meta) platforms;
  };
}
})