about summary refs log tree commit diff
path: root/pkgs/tools/misc/woeusb-ng/default.nix
blob: 821eb73a4a89615f6103986651df0aa7e89aec1e (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
{ lib
, python3Packages
, fetchFromGitHub
, wrapGAppsHook
, p7zip
, parted
, grub2
}:

with python3Packages;

buildPythonApplication rec {
  pname = "woeusb-ng";
  version = "0.2.12";

  src = fetchFromGitHub {
    owner = "WoeUSB";
    repo = "WoeUSB-ng";
    rev = "v${version}";
    hash = "sha256-2opSiXbbk0zDRt6WqMh97iAt6/KhwNDopOas+OZn6TU=";
  };

  postPatch = ''
    substituteInPlace setup.py WoeUSB/*.py miscellaneous/* \
      --replace "/usr/local/" "$out/" \
      --replace "/usr/" "$out/"
  '';

  nativeBuildInputs = [
    wrapGAppsHook
  ];

  propagatedBuildInputs = [
    p7zip
    parted
    grub2
    termcolor
    wxpython
    six
  ];

  preConfigure = ''
    mkdir -p $out/bin $out/share/applications $out/share/polkit-1/actions
  '';

  # Unable to access the X Display, is $DISPLAY set properly?
  doCheck = false;

  meta = with lib; {
    description = "A tool to create a Windows USB stick installer from a real Windows DVD or image";
    homepage = "https://github.com/WoeUSB/WoeUSB-ng";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ stunkymonkey ];
    platforms = platforms.linux;
  };
}