From bf2f15d2a517ddcdd46544a0d3a5e758da80303e Mon Sep 17 00:00:00 2001 From: superherointj Date: Sun, 26 Apr 2026 09:54:00 -0300 Subject: [PATCH] polybarFull: fix gcc15 build by bumping i3ipcpp to C++17 The i3ipcpp submodule (used when i3Support=true) forces -std=c++11, but the jsoncpp library is compiled with C++17 (JSONCPP_HAS_STRING_VIEW=1). This causes an ABI mismatch: i3ipcpp resolves operator[](const char*) but the jsoncpp library only exports operator[](std::string_view), resulting in undefined references at link time. Fix by changing i3ipcpp's compile standard from C++11 to C++17 to match the jsoncpp ABI. Polybar itself already uses C++17. --- pkgs/by-name/po/polybar/package.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/po/polybar/package.nix b/pkgs/by-name/po/polybar/package.nix index d1375d9d8e20..1890481c389c 100644 --- a/pkgs/by-name/po/polybar/package.nix +++ b/pkgs/by-name/po/polybar/package.nix @@ -102,8 +102,15 @@ stdenv.mkDerivation (finalAttrs: { # Replace hardcoded /etc when copying and reading the default config. postPatch = '' - substituteInPlace CMakeLists.txt --replace "/etc" $out + substituteInPlace CMakeLists.txt --replace-fail "/etc" $out substituteAllInPlace src/utils/file.cpp + # Fix gcc15 build: i3ipcpp forces -std=c++11 but the jsoncpp library was + # compiled with C++17 (JSONCPP_HAS_STRING_VIEW=1), causing ABI mismatch. + # The i3ipcpp code resolves operator[](const char*) but the library only + # exports operator[](std::string_view). Bump i3ipcpp to C++17 to match. + substituteInPlace lib/i3ipcpp/CMakeLists.txt --replace-fail \ + "-std=c++11" \ + "-std=c++17" ''; postInstall = ''