From bd956879e8160f0bc80d9837413af4a93a431126 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 25 Dec 2023 21:58:18 +0000 Subject: [PATCH] usbguard: fix build against gcc-13 Without the change build fails on `staging-next` as: usbguard> In file included from src/Library/Base64.cpp:23: usbguard> src/Library/Base64.hpp:34:34: error: 'uint8_t' does not name a type usbguard> 34 | std::string base64Encode(const uint8_t* buffer, size_t buflen); usbguard> | ^~~~~~~ usbguard> src/Library/Base64.hpp:26:1: note: 'uint8_t' is defined in header ''; did you forget to '#include '? usbguard> 25 | #include usbguard> +++ |+#include usbguard> 26 | #include The change pulls in upstream fix. --- pkgs/os-specific/linux/usbguard/default.nix | 11 +++++++++++ pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/usbguard/default.nix b/pkgs/os-specific/linux/usbguard/default.nix index 46e9ee3d0a55..e43ee0b421dc 100644 --- a/pkgs/os-specific/linux/usbguard/default.nix +++ b/pkgs/os-specific/linux/usbguard/default.nix @@ -1,6 +1,7 @@ { stdenv , lib , fetchFromGitHub +, fetchpatch , autoreconfHook , installShellFiles , nixosTests @@ -32,6 +33,16 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; + patches = [ + # Pull upstream fix for gcc-13: + # https://github.com/USBGuard/usbguard/pull/586 + (fetchpatch { + name = "gcc-13.patch"; + url = "https://github.com/USBGuard/usbguard/commit/22b1e0897af977cc96af926c730ff948bd120bb5.patch"; + hash = "sha256-yw0ZHcn6naHcsfsqdBB/aTgCwvEHecew/6HDmjyY2ZA="; + }) + ]; + nativeBuildInputs = [ autoreconfHook installShellFiles diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a4b6f26ea8f5..1b8f43006f6d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28983,7 +28983,7 @@ with pkgs; upscayl = callPackage ../applications/graphics/upscayl { }; - usbguard = disable-warnings-if-gcc13 (callPackage ../os-specific/linux/usbguard { }); + usbguard = callPackage ../os-specific/linux/usbguard { }; usbguard-notifier = callPackage ../os-specific/linux/usbguard-notifier { };