nixpkgs/pkgs/by-name/wo/woeusb/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

55 lines
1.5 KiB
Nix

{ lib, stdenv, fetchFromGitHub, installShellFiles, makeWrapper
, coreutils, dosfstools, findutils, gawk, gnugrep, grub2_light, ncurses, ntfs3g, parted, p7zip, util-linux, wimlib, wget }:
stdenv.mkDerivation rec {
version = "5.2.4";
pname = "woeusb";
src = fetchFromGitHub {
owner = "WoeUSB";
repo = "WoeUSB";
rev = "v${version}";
sha256 = "sha256-HB1E7rP/U58dyL3j6YnhF5AOGAcHqmA/ZZ5JNBDibco=";
};
nativeBuildInputs = [ installShellFiles makeWrapper ];
postPatch = ''
# Emulate version smudge filter (see .gitattributes, .gitconfig).
for file in sbin/woeusb share/man/man1/woeusb.1; do
substituteInPlace "$file" \
--replace '@@WOEUSB_VERSION@@' '${version}'
done
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mv sbin/woeusb $out/bin
installManPage share/man/man1/woeusb.1
wrapProgram "$out/bin/woeusb" \
--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";
homepage = "https://github.com/WoeUSB/WoeUSB";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ bjornfor ];
platforms = platforms.linux;
mainProgram = "woeusb";
};
}