about summary refs log tree commit diff
path: root/pkgs/by-name/sm/smb3-foundry/package.nix
blob: 2f78261f854ec5317eb45227db240126a50d6ca1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib
, stdenv
, fetchFromGitHub
, python3
}:

let
  python = (python3.withPackages (ps: with ps; [
    pyside6
    py65
    qdarkstyle
  ]));
in
stdenv.mkDerivation (finalAttrs: {
  pname = "smb3-foundry";
  version = "1.3.1";

  src = fetchFromGitHub {
    owner = "mchlnix";
    repo = "SMB3-Foundry";
    rev = "refs/tags/${finalAttrs.version}";
    hash = "sha256-8cf7VhvC372Cqi94n2FSHcoCGblpZoZvBXcXq5jU6CY=";
  };

  buildInputs = [ python ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/share/smb3-foundry $out/bin
    cp -r smb3parse foundry scribe data doc VERSION smb3-foundry.py smb3-scribe.py $out/share/smb3-foundry

    ln -s $out/share/smb3-foundry/smb3-foundry.py $out/bin/smb3-foundry
    ln -s $out/share/smb3-foundry/smb3-scribe.py $out/bin/smb3-scribe

    runHook postInstall
  '';

  meta = {
    changelog = "https://github.com/mchlnix/SMB3-Foundry/releases/tag/${finalAttrs.version}";
    description = "Modern Super Mario Bros. 3 Level Editor";
    homepage = "https://github.com/mchlnix/SMB3-Foundry";
    license = lib.licenses.gpl3Only;
    mainProgram = "smb3-foundry";
    maintainers = with lib.maintainers; [ tomasajt ];
    platforms = lib.platforms.unix;
  };
})