binwalk: add PATH wrapper (#401501)

This commit is contained in:
Felix Bargfeldt 2025-04-27 00:22:10 +02:00 committed by GitHub
commit 68da4756d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,55 +33,44 @@
xz, xz,
zlib, zlib,
zstd, zstd,
_7zz, p7zip,
makeBinaryWrapper,
}: }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage (finalAttrs: {
pname = "binwalk"; pname = "binwalk";
version = "3.1.0"; version = "3.1.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ReFirmLabs"; owner = "ReFirmLabs";
repo = "binwalk"; repo = "binwalk";
tag = "v${version}"; tag = "v${finalAttrs.version}";
hash = "sha256-em+jOnhCZH5EEJrhXTHmxiwpMcBr5oNU1+5IJ1H/oco="; hash = "sha256-em+jOnhCZH5EEJrhXTHmxiwpMcBr5oNU1+5IJ1H/oco=";
}; };
useFetchCargoVendor = true; useFetchCargoVendor = true;
cargoHash = "sha256-cnJVeuvNNApEHqgZDcSgqkH3DKAr8+HkqXUH9defTCA="; cargoHash = "sha256-cnJVeuvNNApEHqgZDcSgqkH3DKAr8+HkqXUH9defTCA=";
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [
pkg-config
makeBinaryWrapper
];
# https://github.com/ReFirmLabs/binwalk/commits/master/dependencies # https://github.com/ReFirmLabs/binwalk/commits/master/dependencies
buildInputs = [ buildInputs = [
bzip2 bzip2
cabextract
dmg2img
dtc dtc
dumpifs
fontconfig fontconfig
gnutar
jefferson
lzfse
lzo lzo
lzop
lz4
openssl_3 openssl_3
python3.pkgs.python-lzo python3.pkgs.python-lzo
sasquatch
sleuthkit
srec2bin
ubi_reader
ucl ucl
uefi-firmware-parser
unyaffs
unzip unzip
vmlinux-to-elf
xz xz
zlib zlib
zstd ];
_7zz
] ++ lib.optionals enableUnfree [ unrar ]; dontUseCargoParallelTests = true;
# skip broken tests # skip broken tests
checkFlags = checkFlags =
@ -110,10 +99,37 @@ rustPlatform.buildRustPackage rec {
doInstallCheck = true; doInstallCheck = true;
versionCheckProgramArg = "-V"; versionCheckProgramArg = "-V";
postInstall = ''
wrapProgram $out/bin/binwalk --suffix PATH : ${
lib.makeBinPath (
[
p7zip
cabextract
dmg2img
dumpifs
jefferson
vmlinux-to-elf
lz4
lzfse
lzop
sasquatch
srec2bin
gnutar
sleuthkit
ubi_reader
uefi-firmware-parser
unyaffs
zstd
]
++ lib.optionals enableUnfree [ unrar ]
)
}
'';
meta = { meta = {
description = "Firmware Analysis Tool"; description = "Firmware Analysis Tool";
homepage = "https://github.com/ReFirmLabs/binwalk"; homepage = "https://github.com/ReFirmLabs/binwalk";
changelog = "https://github.com/ReFirmLabs/binwalk/releases/tag/v${version}"; changelog = "https://github.com/ReFirmLabs/binwalk/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit; license = lib.licenses.mit;
platforms = lib.platforms.unix; platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ maintainers = with lib.maintainers; [
@ -122,4 +138,4 @@ rustPlatform.buildRustPackage rec {
]; ];
mainProgram = "binwalk"; mainProgram = "binwalk";
}; };
} })