1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/by-name/un/unyaffs/package.nix
2024-11-12 10:05:54 +02:00

46 lines
1,006 B
Nix

{
fetchFromGitHub,
lib,
stdenv,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "unyaffs";
version = "0.9";
src = fetchFromGitHub {
owner = "whataday";
repo = "unyaffs";
rev = "${finalAttrs.version}";
hash = "sha256-FcuPaxq74gVJ6UlOhFPSMtuwUAJVV/sAxAQojhmVXCs=";
};
preBuild = ''
sed -i '54i #if defined(__linux__)' unyaffs.c
sed -i '55i #include <sys/sysmacros.h>' unyaffs.c
sed -i '56i #endif' unyaffs.c
'';
installPhase = ''
runHook preInstall
install -Dm755 unyaffs -t $out/bin
runHook postInstall
'';
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
versionCheckProgramArg = "-V";
meta = {
description = "Tool to extract files from a YAFFS2 file system image";
homepage = "https://github.com/whataday/unyaffs";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ KSJ2000 ];
mainProgram = "unyaffs";
};
})