2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, makeWrapper
|
2020-11-24 15:29:28 +00:00
|
|
|
, coreutils, dosfstools, findutils, gawk, gnugrep, grub2_light, ncurses, ntfs3g, parted, p7zip, util-linux, wget
|
2017-12-22 05:20:11 +00:00
|
|
|
, wxGTK30 }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-02-15 12:39:59 +00:00
|
|
|
version = "3.3.1";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "woeusb";
|
2017-12-22 05:20:11 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "slacka";
|
|
|
|
repo = "WoeUSB";
|
|
|
|
rev = "v${version}";
|
2020-02-15 12:39:59 +00:00
|
|
|
sha256 = "1hbr88sr943s4yqdvbny543jvgvnsa622wq4cmwd23hjsfcrvyiv";
|
2017-12-22 05:20:11 +00:00
|
|
|
};
|
|
|
|
|
2019-10-09 03:00:25 +01:00
|
|
|
patches = [ ./remove-workaround.patch ];
|
|
|
|
|
2018-11-25 10:24:31 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper ];
|
|
|
|
buildInputs = [ wxGTK30 ];
|
2017-12-22 05:20:11 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Emulate version smudge filter (see .gitattributes, .gitconfig).
|
|
|
|
for file in configure.ac debian/changelog src/woeusb src/woeusb.1 src/woeusbgui.1; do
|
|
|
|
substituteInPlace "$file" \
|
|
|
|
--replace '@@WOEUSB_VERSION@@' '${version}'
|
|
|
|
done
|
|
|
|
|
|
|
|
substituteInPlace src/MainPanel.cpp \
|
|
|
|
--replace "'woeusb " "'$out/bin/woeusb "
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# don't write data into /
|
|
|
|
substituteInPlace "$out/bin/woeusb" \
|
|
|
|
--replace /media/ /run/woeusb/
|
|
|
|
|
|
|
|
# woeusbgui launches woeusb with pkexec, which sets
|
|
|
|
# PATH=/usr/sbin:/usr/bin:/sbin:/bin:/root/bin. Perhaps pkexec
|
|
|
|
# should be patched with a less useless default PATH, but for now
|
|
|
|
# we add everything we need manually.
|
|
|
|
wrapProgram "$out/bin/woeusb" \
|
2021-01-15 09:19:50 +00:00
|
|
|
--set PATH '${lib.makeBinPath [ coreutils dosfstools findutils gawk gnugrep grub2_light ncurses ntfs3g parted util-linux wget p7zip ]}'
|
2017-12-22 05:20:11 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
postInstallCheck = ''
|
|
|
|
# woeusb --version checks for missing runtime dependencies.
|
|
|
|
out_version="$("$out/bin/woeusb" --version)"
|
|
|
|
[ "$out_version" = '${version}' ]
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-12-22 05:20:11 +00:00
|
|
|
description = "Create bootable USB disks from Windows ISO images";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/slacka/WoeUSB";
|
2017-12-22 05:20:11 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ bjornfor gnidorah ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|