nixpkgs/pkgs/tools/misc/flashrom/default.nix
R-VdP 8467c63749
flashrom: use a udev uaccess tag instead of introducing a custom flashrom group
See https://wiki.archlinux.org/title/Udev#Allowing_regular_users_to_use_devices for more info about the uaccess tag. The udev-acl tag is a legacy implementation, we add it purely for backwards compatibility.
2023-02-17 15:56:51 +01:00

48 lines
1.2 KiB
Nix

{ fetchurl
, fetchpatch
, stdenv
, installShellFiles
, lib
, libftdi1
, libjaylink
, libusb1
, pciutils
, pkg-config
, jlinkSupport ? false
}:
stdenv.mkDerivation rec {
pname = "flashrom";
version = "1.3.0";
src = fetchurl {
url = "https://download.flashrom.org/releases/flashrom-v${version}.tar.bz2";
hash = "sha256-oFMjRFPM0BLnnzRDvcxhYlz5e3/Xy0zdi/v/vosUliM=";
};
nativeBuildInputs = [ pkg-config installShellFiles ];
buildInputs = [ libftdi1 libusb1 pciutils ]
++ lib.optional jlinkSupport libjaylink;
postPatch = ''
substituteInPlace util/flashrom_udev.rules \
--replace 'GROUP="plugdev"' 'TAG+="uaccess", TAG+="udev-acl"'
'';
makeFlags = [ "PREFIX=$(out)" "libinstall" ]
++ lib.optional jlinkSupport "CONFIG_JLINK_SPI=yes";
postInstall = ''
install -Dm644 util/flashrom_udev.rules $out/lib/udev/rules.d/flashrom.rules
'';
meta = with lib; {
homepage = "https://www.flashrom.org";
description = "Utility for reading, writing, erasing and verifying flash ROM chips";
license = licenses.gpl2;
maintainers = with maintainers; [ fpletz felixsinger ];
platforms = platforms.all;
broken = stdenv.isDarwin; # requires DirectHW
};
}