about summary refs log tree commit diff
path: root/pkgs/by-name/fl/flashgbx/package.nix
blob: c816f7d005280c3fa97df135aa7ac6501e920869 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ lib
, python3Packages
, fetchFromGitHub
, makeDesktopItem
, copyDesktopItems
, qt6
}:

python3Packages.buildPythonApplication rec {
  pname = "flashgbx";
  version = "3.37";

  src = fetchFromGitHub {
    repo = "FlashGBX";
    owner = "lesserkuma";
    rev = version;
    hash = "sha256-3527QmSSpGotFHKTg0yb6MgHKSze+9BECQWqZM3qKsw=";
  };

  desktopItems = [
    (makeDesktopItem {
      name = "flashgbx";
      desktopName = "FlashGBX UI";
      icon = "flashgbx";
      exec = meta.mainProgram;
      comment = "UI for reading and writing Game Boy and Game Boy Advance cartridges";
      categories = [ "Utility" ];
    })
  ];

  postInstall =
  ''
      install -D FlashGBX/res/icon.png $out/share/icons/hicolor/256x256/apps/flashgbx.png
  '';

  pyproject = true;

  nativeBuildInputs = [
    python3Packages.setuptools
    copyDesktopItems
    qt6.wrapQtAppsHook
  ];

  propagatedBuildInputs = with python3Packages; [
    pillow
    pyserial
    pyside6
    python-dateutil
    requests
    setuptools
    qt6.qtbase
  ] ++ lib.optionals stdenv.isLinux [
    qt6.qtwayland
  ];

  meta = with lib; {
    description = "GUI for reading and writing GB and GBA cartridges with the GBxCart RW";
    homepage = "https://github.com/lesserkuma/FlashGBX";
    license = licenses.gpl3Only;
    mainProgram = "flashgbx";
    maintainers = with maintainers; [ grahamnorris ];
  };
}