summary refs log tree commit diff
path: root/pkgs/tools/system/uefitool/common.nix
blob: 7d5ee82dcf984a2eace415851f3f526079d84ce0 (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
{ version, sha256, installFiles }:
{ lib, mkDerivation, fetchFromGitHub, qtbase, qmake, cmake, zip }:

mkDerivation rec {
  passthru = {
    inherit version;
    inherit sha256;
    inherit installFiles;
  };
  pname = "uefitool";
  inherit version;

  src = fetchFromGitHub {
    inherit sha256;
    owner = "LongSoft";
    repo = pname;
    rev = version;
  };

  buildInputs = [ qtbase ];
  nativeBuildInputs = [ qmake cmake zip ];

  configurePhase = ":";
  buildPhase = "bash unixbuild.sh";

  installPhase = ''
    mkdir -p "$out"/bin
    cp ${lib.concatStringsSep " " installFiles} "$out"/bin
  '';

  meta = with lib; {
    description = "UEFI firmware image viewer and editor";
    homepage = "https://github.com/LongSoft/uefitool";
    license = licenses.bsd2;
    maintainers = with maintainers; [ ajs124 ];
    # uefitool supposedly works on other platforms, but their build script only works on linux in nixpkgs
    platforms = platforms.linux;
  };
}