diff --git a/pkgs/by-name/fl/flashrom/0002-tests-erase-parenthesize-braced-initializer.patch b/pkgs/by-name/fl/flashrom/0002-tests-erase-parenthesize-braced-initializer.patch deleted file mode 100644 index fdad7832431b..000000000000 --- a/pkgs/by-name/fl/flashrom/0002-tests-erase-parenthesize-braced-initializer.patch +++ /dev/null @@ -1,50 +0,0 @@ -From ba84c4aba56420315973026288e7b336006336a9 Mon Sep 17 00:00:00 2001 -From: edef -Date: Tue, 30 Jul 2024 03:14:37 +0000 -Subject: [PATCH] tests/erase: parenthesize braced initializer - -memcpy is a macro on Darwin, and thus requires braced initializer lists -to be parenthesized. ---- - tests/erase_func_algo.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/tests/erase_func_algo.c b/tests/erase_func_algo.c -index 576923f8..b13ee70c 100644 ---- a/tests/erase_func_algo.c -+++ b/tests/erase_func_algo.c -@@ -1233,13 +1233,13 @@ static void erase_unwritable_regions_skipflag_on_test_success(void **state) - - // This test needs special block erase to emulate protected regions. - memcpy(g_test_erase_injector, -- (erasefunc_t *const[]){ -+ ((erasefunc_t *const[]){ - block_erase_chip_with_protected_region_1, - block_erase_chip_with_protected_region_2, - block_erase_chip_with_protected_region_3, - block_erase_chip_with_protected_region_4, - block_erase_chip_with_protected_region_5, -- }, -+ }), - sizeof(g_test_erase_injector) - ); - -@@ -1322,13 +1322,13 @@ static void write_unwritable_regions_skipflag_on_test_success(void **state) { - - // This test needs special block erase to emulate protected regions. - memcpy(g_test_erase_injector, -- (erasefunc_t *const[]){ -+ ((erasefunc_t *const[]){ - block_erase_chip_with_protected_region_1, - block_erase_chip_with_protected_region_2, - block_erase_chip_with_protected_region_3, - block_erase_chip_with_protected_region_4, - block_erase_chip_with_protected_region_5, -- }, -+ }), - sizeof(g_test_erase_injector) - ); - --- -2.45.2 - diff --git a/pkgs/by-name/fl/flashrom/package.nix b/pkgs/by-name/fl/flashrom/package.nix index 75404ada546d..100cd76fc6b9 100644 --- a/pkgs/by-name/fl/flashrom/package.nix +++ b/pkgs/by-name/fl/flashrom/package.nix @@ -7,6 +7,7 @@ libftdi1, libjaylink, libusb1, + openssl, meson, ninja, pciutils, @@ -17,24 +18,21 @@ stdenv.mkDerivation rec { pname = "flashrom"; - version = "1.4.0"; + version = "1.5.1"; src = fetchurl { - url = "https://download.flashrom.org/releases/flashrom-${version}.tar.xz"; - hash = "sha256-rX7htJI5xvtPj1XjZwb81zFDXbGkvS+rPYDx9yUIzO4="; + url = "https://download.flashrom.org/releases/flashrom-v${version}.tar.xz"; + hash = "sha256-H5NLB27UnqziA2Vewkn8eGGmuOh/5K73MuR7bkhbYpM="; }; - patches = - [ - # Release notes for 1.4.0 state that Promontory chipsets are unsupported, and that attempting to read flash on those systems may crash the system. - # The patch that removes this (broken) support only made it into the 1.3.0 release, seemingly by mistake, and the relevant code has been essentially untouched since. - # We cherry-pick the upstream patch from 1.3.0, though amended to reference the relevant bug in the error message, rather than requesting the user email upstream. - # https://ticket.coreboot.org/issues/370 - # https://review.coreboot.org/c/flashrom/+/68824 - ./0001-sb600spi.c-Drop-Promontory-support.patch - ] - # Darwin's memcpy is a macro, and requires braced initializer lists to be parenthesized - ++ lib.optional stdenv.isDarwin ./0002-tests-erase-parenthesize-braced-initializer.patch; + patches = [ + # Release notes for 1.4.0 state that Promontory chipsets are unsupported, and that attempting to read flash on those systems may crash the system. + # The patch that removes this (broken) support only made it into the 1.3.0 release, seemingly by mistake, and the relevant code has been essentially untouched since. + # We cherry-pick the upstream patch from 1.3.0, though amended to reference the relevant bug in the error message, rather than requesting the user email upstream. + # https://ticket.coreboot.org/issues/370 + # https://review.coreboot.org/c/flashrom/+/68824 + ./0001-sb600spi.c-Drop-Promontory-support.patch + ]; nativeBuildInputs = [ meson @@ -45,11 +43,12 @@ stdenv.mkDerivation rec { ]; buildInputs = [ + openssl cmocka libftdi1 libusb1 ] - ++ lib.optionals (!stdenv.isDarwin) [ pciutils ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pciutils ] ++ lib.optional jlinkSupport libjaylink; postPatch = '' @@ -57,6 +56,14 @@ stdenv.mkDerivation rec { --replace 'GROUP="plugdev"' 'TAG+="uaccess", TAG+="udev-acl"' ''; + mesonFlags = [ + (lib.mesonOption "programmer" "auto") + (lib.mesonEnable "man-pages" true) + (lib.mesonEnable "tests" (!stdenv.buildPlatform.isDarwin)) + ]; + + doCheck = !stdenv.hostPlatform.isDarwin; + postInstall = '' install -Dm644 $NIX_BUILD_TOP/$sourceRoot/util/flashrom_udev.rules $out/lib/udev/rules.d/flashrom.rules '';