From 640b2d3ddc8fdeaea59c213db01b4020ffe71ca7 Mon Sep 17 00:00:00 2001 From: Huang Rui Date: Sat, 23 May 2026 18:55:35 +0800 Subject: [PATCH] sci-electronics/kicad: add 9.0.9-r1, drop 9.0.9, fix gcc-16 build - Backport upstream 10.x move of KICAD_MANAGER_FRAME::GetCurrentFileName() out of header (fixes bitmap2component link under gcc-16). - Tighten ngspice dep to >=sci-electronics/ngspice-27.1[shared]. Signed-off-by: Huang Rui Part-of: https://github.com/gentoo/gentoo/pull/46259 Signed-off-by: Sam James --- ...ad-9.0.9-gcc16-bitmap2component-link.patch | 52 +++++++++++++++++++ ...cad-9.0.9.ebuild => kicad-9.0.9-r1.ebuild} | 3 +- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 sci-electronics/kicad/files/kicad-9.0.9-gcc16-bitmap2component-link.patch rename sci-electronics/kicad/{kicad-9.0.9.ebuild => kicad-9.0.9-r1.ebuild} (98%) diff --git a/sci-electronics/kicad/files/kicad-9.0.9-gcc16-bitmap2component-link.patch b/sci-electronics/kicad/files/kicad-9.0.9-gcc16-bitmap2component-link.patch new file mode 100644 index 0000000000000..30432c12418f4 --- /dev/null +++ b/sci-electronics/kicad/files/kicad-9.0.9-gcc16-bitmap2component-link.patch @@ -0,0 +1,52 @@ +From: Huang Rui +Date: Wed, 27 May 2026 00:00:00 +0800 +Subject: [PATCH] kicad: move KICAD_MANAGER_FRAME::GetCurrentFileName() out of header + +The inline definition in kicad_manager_frame.h causes the compiler to +emit a weak symbol for KICAD_MANAGER_FRAME::GetCurrentFileName() in +every TU that includes the header (e.g. common/eda_base_frame.cpp, +which needs the type for a static_cast). That weak symbol references +the out-of-line KICAD_MANAGER_FRAME::GetProjectFileName(), defined in +kicad/kicad_manager_frame.cpp. + +When standalone tools like bitmap2component link only libcommon.a (not +the kicad/ project-manager sources), the linker pulls in the weak +GetCurrentFileName symbol from eda_base_frame.cpp.o and fails on the +unresolved GetProjectFileName. + +gcc <= 15 elided the weak symbol because nothing in those TUs used it. +gcc 16 emits it, breaking the link with: + + undefined reference to `KICAD_MANAGER_FRAME::GetProjectFileName() const' + +Backports the kicad 10.x layout: declaration in the header, definition +in the .cpp. Same body, no behavior change. +--- a/kicad/kicad_manager_frame.h ++++ b/kicad/kicad_manager_frame.h +@@ -81,10 +81,7 @@ + */ + void RecreateBaseLeftToolbar(); + +- wxString GetCurrentFileName() const override +- { +- return GetProjectFileName(); +- } ++ wxString GetCurrentFileName() const override; + + /** + * @brief Creates a project and imports a non-KiCad Schematic and PCB +--- a/kicad/kicad_manager_frame.cpp ++++ b/kicad/kicad_manager_frame.cpp +@@ -491,6 +491,12 @@ + } + + ++wxString KICAD_MANAGER_FRAME::GetCurrentFileName() const ++{ ++ return GetProjectFileName(); ++} ++ ++ + const wxString KICAD_MANAGER_FRAME::GetProjectFileName() const + { + return Pgm().GetSettingsManager().IsProjectOpen() ? Prj().GetProjectFullName() : diff --git a/sci-electronics/kicad/kicad-9.0.9.ebuild b/sci-electronics/kicad/kicad-9.0.9-r1.ebuild similarity index 98% rename from sci-electronics/kicad/kicad-9.0.9.ebuild rename to sci-electronics/kicad/kicad-9.0.9-r1.ebuild index 68791e168646c..f06c67612861d 100644 --- a/sci-electronics/kicad/kicad-9.0.9.ebuild +++ b/sci-electronics/kicad/kicad-9.0.9-r1.ebuild @@ -72,7 +72,7 @@ COMMON_DEPEND=" >=sci-libs/opencascade-7.5.0:0= >=x11-libs/cairo-1.8.8:= >=x11-libs/pixman-0.30 - >sci-electronics/ngspice-27[shared] + >=sci-electronics/ngspice-27.1[shared] virtual/zlib:= x11-libs/wxGTK:${WX_GTK_VER}=[X,opengl] $(python_gen_cond_dep ' @@ -122,6 +122,7 @@ src_unpack() { PATCHES=( "${FILESDIR}"/${PN}-9.0.6-fix-cmake4-compat.patch # Bug 970924 + "${FILESDIR}"/${P}-gcc16-bitmap2component-link.patch ) src_prepare() {