nixpkgs-suyu/pkgs/tools/misc/woeusb/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.5 KiB
Nix
Raw Normal View History

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