1 { lib, stdenv, fetchFromGitHub, autoreconfHook, makeWrapper
2 , coreutils, dosfstools, findutils, gawk, gnugrep, grub2_light, ncurses, ntfs3g, parted, p7zip, util-linux, wget
5 stdenv.mkDerivation rec {
9 src = fetchFromGitHub {
13 sha256 = "1hbr88sr943s4yqdvbny543jvgvnsa622wq4cmwd23hjsfcrvyiv";
16 patches = [ ./remove-workaround.patch ];
18 nativeBuildInputs = [ autoreconfHook makeWrapper ];
19 buildInputs = [ wxGTK30 ];
22 # Emulate version smudge filter (see .gitattributes, .gitconfig).
23 for file in configure.ac debian/changelog src/woeusb src/woeusb.1 src/woeusbgui.1; do
24 substituteInPlace "$file" \
25 --replace '@@WOEUSB_VERSION@@' '${version}'
28 substituteInPlace src/MainPanel.cpp \
29 --replace "'woeusb " "'$out/bin/woeusb "
33 # don't write data into /
34 substituteInPlace "$out/bin/woeusb" \
35 --replace /media/ /run/woeusb/
37 # woeusbgui launches woeusb with pkexec, which sets
38 # PATH=/usr/sbin:/usr/bin:/sbin:/bin:/root/bin. Perhaps pkexec
39 # should be patched with a less useless default PATH, but for now
40 # we add everything we need manually.
41 wrapProgram "$out/bin/woeusb" \
42 --set PATH '${lib.makeBinPath [ coreutils dosfstools findutils gawk gnugrep grub2_light ncurses ntfs3g parted util-linux wget p7zip ]}'
45 doInstallCheck = true;
48 # woeusb --version checks for missing runtime dependencies.
49 out_version="$("$out/bin/woeusb" --version)"
50 [ "$out_version" = '${version}' ]
54 description = "Create bootable USB disks from Windows ISO images";
55 homepage = "https://github.com/slacka/WoeUSB";
56 license = licenses.gpl3;
57 maintainers = with maintainers; [ bjornfor gnidorah ];
58 platforms = platforms.linux;