From e9a3f9e5688f6a7456bea00b469a00c30776c47b Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 7 Feb 2024 22:37:37 +0000 Subject: [PATCH 1/2] wxSVG: fix build failure against `gcc-13` Without the change `wxSVG` fails the build in `master` as https://hydra.nixos.org/build/248172755: libwx_gtk3u_xrc-3.2.so: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:416: svgview] Error 1 This happens due to mix of `gcc-12` / `gcc-13` `libstdc++` libraries. THe fix just applies upstream fix for `wxSVG` for `gcc-13`. --- pkgs/development/libraries/wxSVG/default.nix | 6 ++++++ pkgs/top-level/all-packages.nix | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/wxSVG/default.nix b/pkgs/development/libraries/wxSVG/default.nix index 5e9b9f2fcb72..51b60282cd35 100644 --- a/pkgs/development/libraries/wxSVG/default.nix +++ b/pkgs/development/libraries/wxSVG/default.nix @@ -23,6 +23,12 @@ stdenv.mkDerivation rec { hash = "sha256-rkcykfjQpf6voGzScMgmxr6tS86yud1vzs8tt8JeJII="; }; + postPatch = '' + # Apply upstream patch for gcc-13 support: + # https://sourceforge.net/p/wxsvg/git/ci/7b17fe365fb522618fb3520d7c5c1109b138358f/ + sed -i src/cairo/SVGCanvasCairo.cpp -e '1i #include ' + ''; + nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 366091870825..dff6afdffc2b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -25506,7 +25506,6 @@ with pkgs; wxSVG = callPackage ../development/libraries/wxSVG { wxGTK = wxGTK32; - stdenv = gcc12Stdenv; }; wtk = callPackage ../development/libraries/wtk { }; From 0d1390ecc81a34cf965b166ca4ef435d93b284d1 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 7 Feb 2024 22:41:08 +0000 Subject: [PATCH 2/2] wxSVG: enable build parallelism --- pkgs/development/libraries/wxSVG/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/wxSVG/default.nix b/pkgs/development/libraries/wxSVG/default.nix index 51b60282cd35..0119a2c03776 100644 --- a/pkgs/development/libraries/wxSVG/default.nix +++ b/pkgs/development/libraries/wxSVG/default.nix @@ -42,6 +42,8 @@ stdenv.mkDerivation rec { wxGTK ] ++ lib.optional stdenv.isDarwin Cocoa; + enableParallelBuilding = true; + meta = with lib; { homepage = "https://wxsvg.sourceforge.net/"; description = "A SVG manipulation library built with wxWidgets";