2021-05-28 09:39:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, installShellFiles, makeWrapper
|
|
|
|
, coreutils, dosfstools, findutils, gawk, gnugrep, grub2_light, ncurses, ntfs3g, parted, p7zip, util-linux, wimlib, wget }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-28 09:39:13 +00:00
|
|
|
version = "5.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "woeusb";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-05-28 09:39:13 +00:00
|
|
|
owner = "WoeUSB";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "WoeUSB";
|
|
|
|
rev = "v${version}";
|
2021-05-28 09:39:13 +00:00
|
|
|
sha256 = "1qakk7lnj71m061rn72nabk4c37vw0vkx2a28xgxas8v8cwvkkam";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Emulate version smudge filter (see .gitattributes, .gitconfig).
|
2021-05-28 09:39:13 +00:00
|
|
|
for file in sbin/woeusb share/man/man1/woeusb.1; do
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace "$file" \
|
|
|
|
--replace '@@WOEUSB_VERSION@@' '${version}'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv sbin/woeusb $out/bin
|
|
|
|
installManPage share/man/man1/woeusb.1
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
wrapProgram "$out/bin/woeusb" \
|
2021-05-28 09:39:13 +00:00
|
|
|
--set PATH '${lib.makeBinPath [ coreutils dosfstools findutils gawk gnugrep grub2_light ncurses ntfs3g parted p7zip util-linux wget wimlib ]}'
|
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
postInstallCheck = ''
|
|
|
|
# woeusb --version checks for missing runtime dependencies.
|
|
|
|
out_version="$("$out/bin/woeusb" --version)"
|
|
|
|
[ "$out_version" = '${version}' ]
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Create bootable USB disks from Windows ISO images";
|
2021-05-28 09:39:13 +00:00
|
|
|
homepage = "https://github.com/WoeUSB/WoeUSB";
|
|
|
|
license = licenses.gpl3Plus;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|