about summary refs log tree commit diff
path: root/pkgs/applications/virtualization/quickgui/default.nix
blob: f4420c6aeac3ebe3281206bb613ada6df9d0bfb0 (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
64
65
66
67
{ stdenvNoCC
, lib
, fetchurl
, autoPatchelfHook
, dpkg
, wrapGAppsHook3
, quickemu
, gnome
}:

stdenvNoCC.mkDerivation rec {
  pname = "quickgui";
  version = "1.2.8";

  src = fetchurl {
    url = "https://github.com/quickemu-project/quickgui/releases/download/v${version}/quickgui_${version}-1_lunar1.0_amd64.deb";
    sha256 = "sha256-crnV7OWH5UbkMM/TxTIOlXmvqBgjFmQG7RxameMOjH0=";
  };

  nativeBuildInputs = [
    autoPatchelfHook
    dpkg
    wrapGAppsHook3
  ];

  buildInputs = [
    quickemu
    gnome.zenity
  ];

  strictDeps = true;

  unpackCmd = "dpkg-deb -x $curSrc source";

  installPhase = ''
    runHook preInstall

    mv usr $out

    runHook postInstall
  '';

  preFixup = ''
    gappsWrapperArgs+=(
      --prefix PATH : ${lib.makeBinPath [ quickemu gnome.zenity ]}
    )
  '';

  postFixup = ''
    substituteInPlace $out/share/applications/quickgui.desktop \
      --replace "/usr" $out

    # quickgui PR 88
    echo "Categories=System;" >> $out/share/applications/quickgui.desktop
  '';

  meta = with lib; {
    description = "A Flutter frontend for quickemu";
    homepage = "https://github.com/quickemu-project/quickgui";
    changelog = "https://github.com/quickemu-project/quickgui/releases/tag/v${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ heyimnova ];
    platforms = [ "x86_64-linux" ];
    sourceProvenance = [ sourceTypes.binaryNativeCode ];
    mainProgram = "quickgui";
  };
}